-
Notifications
You must be signed in to change notification settings - Fork 184
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
[ST4] gopls: LSP not showing all completions provided by language server #1228
Comments
I'm seeing this same issue with |
With respect to gopls: "gopls": {
"command": [
"$home/go/bin/gopls"
],
"enabled": true,
"settings": {
"gopls.completeUnimported": true,
},
}, And this file: package main
func main() {
} Type We seem to do everything correctly here:
Notice these two log lines:
This is after the completion response. After these log lines gopls works correctly. It seems to me gopls should EDIT: go info:
|
That said, with this file: package main
import (
"net/http"
)
func main() {
} I cannot seem to reproduce the set up of typing |
@rwols Interesting, I will look into it more and try from a clean project. I'll see about looking into gopls code as well |
Ubuntu 19.10,
|
Was this found to be specific to |
@predragnikolic you are getting a message there from gopls saying that the code has failed to compile. I don't know why it's that, I don't code in go. (Note that it could still be an LSP bug if we'd, for example, fail to synchronize document properly but it's probably unlikely in such a small example) |
I have same problem with ST/4084 and LSP/1.0.10. My reproduce steps:
If above steps can not reproduce(show correct completion list), then
But, if press TAB/Enter after 3, then input '.', then ST show correct completion list. |
I'm having the same issue (as described in #1680). |
I'm unable to replicate this failure in VSCode FWIW, though from memory I have found gopls to be flaky with VSCode in other situations, so the success may just be luck. |
I just did a bunch more testing with VSCode and while this exact issue replicates less frequently than with Sublime, it and other issues do also occur, so it seems to me it's likely (still) a bug in gopls. |
same 💩. How can this be fixed to work normally? I also use Vim, Nova with the same gopls, but there is no such problem. After you enter the dot, autocomplete is empty, but autocomplete returns a list when:
https://user-images.githubusercontent.com/29234307/128247383-8912c385-2693-45d8-8edd-d70479caf6d9.mov |
Logging the server communication would tell clearly whether it's a bug in the server - https://lsp.sublimetext.io/troubleshooting/#self-help-instructions |
Screen.Recording.2021-08-05.at.20.42.27.mp4VersionsSublime Text: Build 4112 LSP Settings
Sublime Text Settings
Test Source
LSP Server Logstype tm characters on the keyboard, and we get a list that is visible and correct.
then type . characters on the keyboard, and we get a list that is visible and correct.
but very quickly the autocomplete list remains empty
after I enter . symbol, then delete .. symbols
and and re-enter . symbol, the list is visible again
|
Thanks for a detailed report. I've reproduced, minimized and created a core issue for it: sublimehq/sublime_text#4727. |
BTW. I'm not sure if that's the same issue as the initial one since the results are quite different. |
@rchl that's not the intial issue. The initial one was that not all completions were shown. I encountered the same problem as the intial one. I originally opened a issue sublimelsp/LSP-gopls#13 but @rwols mentioned this issue. So the initial issue isn't fixed. LSP gopls troubleshootTroubleshooting: goplsVersion
Server Test Run
Server Configuration
[
"${storage_path}/LSP-gopls/bin/gopls"
]
"C:\Users\Max\AppData\Local\Sublime Text\Package Storage/LSP-gopls/bin/gopls"
{}
{
"gopls": {
"allowImplicitNetworkAccess": false,
"allowModfileModifications": false,
"analyses": {},
"annotations": {},
"buildFlags": [],
"codelenses": {},
"completionBudget": "100ms",
"diagnosticsDelay": "250ms",
"directoryFilters": [],
"env": {},
"expandWorkspaceToModule": true,
"experimentalPackageCacheKey": true,
"experimentalPostfixCompletions": true,
"experimentalTemplateSupport": false,
"experimentalWorkspaceModule": false,
"gofumpt": false,
"hoverKind": "FullDocumentation",
"importShortcut": "Both",
"linkTarget": "pkg.go.dev",
"linksInHover": true,
"local": "",
"matcher": "Fuzzy",
"memoryMode": "Normal",
"semanticTokens": false,
"staticcheck": false,
"symbolMatcher": "Fuzzy",
"symbolStyle": "Dynamic",
"usePlaceholders": false,
"verboseOutput": false
}
}
{} Active view
{
"auto_complete_selector": "meta.tag, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc",
"lsp_active": true,
"syntax": "Packages/Go/Go.sublime-syntax"
}
Project / Workspace
[]
LSP configuration{
"clients": {
"clangd": {
"enabled": true
}
},
"log_debug": true,
"log_server": [
"panel"
],
"show_code_actions": "",
"show_code_lens": "phantom",
"show_diagnostics_count_in_view_status": true
} System PATH
I did some testing and with the following LSP setting the problem wont occur.
ExampleIn my case i used the code
When entering fmt (without pressing TAB) and entering a dot after it this autocomplete is shown:
Entering a dot after this lead to
When entering fmt (with pressing TAB) and entering a dot after it this autocomplete is shown:
Then entering TAB
And then entering a dot
|
Thanks for the logs. Very useful. Apart from the the fact that LSP trimmed the completions responses done after the |
This is an issue that I've already reported - sublimehq/sublime_text#4855 |
Any progress on this? It's now been 1.5 years. |
This appears to be an issue in core Sublime. Which is why it hasn’t move. Let me check if updating gopls helps |
Is this still valid? |
It looks like both related ST issues (sublimehq/sublime_text#4727 and sublimehq/sublime_text#4855) are fixed so this should not be an issue anymore. (I'll also remove it from #2007) |
Yes. Same. I'm tired of this nonsense. |
I'll look at this shortly. If needed I'll open an issue on sublimes repo |
@TerminalFi A while back, I saw the same behavior with LSP-jdtls too, if that helps. |
My educated guess is that the didChange notification for gopls and jdtls is written against VSCode internal behavior and these two language servers actually have a race condition. |
Not sure how you came to that conclusion when the LSP logs show the completions are available just not being displayed. Am I missing something ? |
I think it's this issue: Completions: Filtering with custom completion prefix |
If that's the case, and given that issue has been open for two years, a resolution is not looking exactly promising... |
No, I made a premature statement and you're right to point out the missing context. |
OK, looks like a regression happened in ST 4138. |
LSP is failing to provide a full completion list even though gopls provides the full list from the initial communication.
st4000-exploration
http.
and you'll receive with only 1-2 items..
and retype it, you'll receive the entire list of items.Behavior
Expected
Log
Log contents
The text was updated successfully, but these errors were encountered: