-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get argument completion with gopls #326
Comments
Hi. This should be relatively easy to fix. Lsp-mode had custom code for every server, eglot doesn't (just two minor exceptions). I will think about adding one more, or adding something else. I'll have to install gopls first, but i was going to have to do that anyway. Hope it's not too hard. |
Should be fixed. For your specific problem, see https://github.com/joaotavora/eglot#per-project-server-configuration |
Yes, it is fixed. Thanks for your work. |
Hi, @joaotavora I'm still facing this issue. I'm on
If I enter (:jsonrpc "2.0" :result
(:contents
(:kind "markdown" :value "```go\nfunc reflect.DeepEqual(x interface{}, y interface{}) bool\n```\n\n[`reflect.DeepEqual` on pkg.go.dev](https://pkg.go.dev/reflect#DeepEqual)\n\nDeepEqual reports whether x and y are “deeply equal,” defined as follows\\.\nTwo values of identical type are deeply equal if one of the following cases applies\\.\nValues of distinct types are never deeply equal\\.\n\nArray values are deeply equal when their corresponding elements are deeply equal\\.\n\nStruct values are deeply equal if their corresponding fields,\nboth exported and unexported, are deeply equal\\.\n\nFunc values are deeply equal if both are nil\\; otherwise they are not deeply equal\\.\n\nInterface values are deeply equal if they hold deeply equal concrete values\\.\n\nMap values are deeply equal when all of the following are true\\:\nthey are both nil or both non\\-nil, they have the same length,\nand either they are the same map object or their corresponding keys\n\\(matched using Go equality\\) map to deeply equal values\\.\n\nPointer values are deeply equal if they are equal using Go\\'s \\=\\= operator\nor if they point to deeply equal values\\.\n\nSlice values are deeply equal when all of the following are true\\:\nthey are both nil or both non\\-nil, they have the same length,\nand either they point to the same initial entry of the same underlying array\n\\(that is, \\&x\\[0\\] \\=\\= \\&y\\[0\\]\\) or their corresponding elements \\(up to length\\) are deeply equal\\.\nNote that a non\\-nil empty slice and a nil slice \\(for example, \\[\\]byte\\{\\} and \\[\\]byte\\(nil\\)\\)\nare not deeply equal\\.\n\nOther values \\- numbers, bools, strings, and channels \\- are deeply equal\nif they are equal using Go\\'s \\=\\= operator\\.\n\nIn general DeepEqual is a recursive relaxation of Go\\'s \\=\\= operator\\.\nHowever, this idea is impossible to implement without some inconsistency\\.\nSpecifically, it is possible for a value to be unequal to itself,\neither because it is of func type \\(uncomparable in general\\)\nor because it is a floating\\-point NaN value \\(not equal to itself in floating\\-point comparison\\),\nor because it is an array, struct, or interface containing\nsuch a value\\.\nOn the other hand, pointer values are always equal to themselves,\neven if they point at or contain such problematic values,\nbecause they compare equal using Go\\'s \\=\\= operator, and that\nis a sufficient condition to be deeply equal, regardless of content\\.\nDeepEqual has been defined so that the same short\\-cut applies\nto slices and maps\\: if x and y are the same slice or the same map,\nthey are deeply equal regardless of content\\.\n\nAs DeepEqual traverses the data values it may find a cycle\\. The\nsecond and subsequent times that DeepEqual compares two pointer\nvalues that have been compared before, it treats the values as\nequal rather than examining the values to which they point\\.\nThis ensures that DeepEqual terminates\\.\n")
:range
(:start
(:line 13 :character 9)
:end
(:line 13 :character 18)))
:id 120) |
Also tweak eglot-show-workspace-configuration a bit. * README.md (Workspace configuration): Rework. * eglot.el (eglot-show-workspace-configuration): Rework. (eglot--workspace-configuration-plist): New helper.
This helps users configure servers such as Gopls, which doesn't support didChangeConfiguration signals. * README.md (Per-project server configuration): New section. * eglot.el (eglot-workspace-configuration): Fix docstring. (eglot-signal-didChangeConfiguration): Rename a variable. (eglot-handle-request workspace/configuration): New request handler.
This helps users configure servers such as Gopls, which doesn't support didChangeConfiguration signals. * README.md (Per-project server configuration): New section. * eglot.el (eglot-workspace-configuration): Fix docstring. (eglot-signal-didChangeConfiguration): Rename a variable. (eglot-handle-request workspace/configuration): New request handler.
This helps users configure servers such as Gopls, which doesn't support didChangeConfiguration signals. * README.md (Per-project server configuration): New section. * eglot.el (eglot-workspace-configuration): Fix docstring. (eglot-signal-didChangeConfiguration): Rename a variable. (eglot-handle-request workspace/configuration): New request handler. #326: joaotavora/eglot#326
This helps users configure servers such as Gopls, which doesn't support didChangeConfiguration signals. * README.md (Per-project server configuration): New section. * eglot.el (eglot-workspace-configuration): Fix docstring. (eglot-signal-didChangeConfiguration): Rename a variable. (eglot-handle-request workspace/configuration): New request handler. GitHub-reference: fix joaotavora/eglot#326
With
yas-minor-mode
enabled, eglot + gopls still can't complete function argument, for example,but lsp-mode with the same gopls can:
Through
gopls -logfile=/tmp/gopls.log -rpc.trace
, the response from gopls and lsp-mode are different, for eglot, it returnsbut for lsp-mode, it returns
By reading lsp-go.el, I assume
usePlaceholders
needs to be set to true, but the following doesn't work (no argument completion and gopls still returnsErrorf(${1:})
)and by grep usePlaceholders in the log, it has
but with lsp-mode, the log has something different
I know eglot doesn't support
workspace/configuration
according to the README.md. Is it because gopls doesn't support didChangeConfiguration? How can I setusePlaceholders
for gopls with eglot if it's possible?The text was updated successfully, but these errors were encountered: