-
Notifications
You must be signed in to change notification settings - Fork 645
goLanguageServer: set completion follow up command from middleware #3084
Conversation
Middleware checks both `editor.parameterHints.enabled` and `[go].editor.parameterHints.enabled`. The language specific config takes precedence as long as it is defined. vscode.workspace.getConfiguration behaves differently when querying the language-specific configuration section ('[go]') so I couldn't query [go].editor.parameterHints directly using getConfiguration. Tested manually. (sorry) Fixes microsoft#3075
const ret = next(document, position, context, token); | ||
|
||
const isThenable = <T>(obj: vscode.ProviderResult<T>): obj is Thenable<T> => obj && (<any>obj)['then']; | ||
if (isThenable<vscode.CompletionItem[] | vscode.CompletionList | null | undefined>(ret)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we expecting ret
to be a thenable resolving to null or undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vscode.ProviderResult (the return type of next) allows null or undefined.
If I understood the upstream conversations, it looks like Are we planning to remove the call to the command from |
Yes. This will handle the fact that we can't respect user's VS Code configurations in |
My concern is for users that have this change in the extension, but uses the gopls that is also running the |
There is only one command in each completion item and this PR is overriding it. |
* master: goLanguageServer: set completion follow up command from middleware (microsoft#3084) Add stacktrace dump and better error messages on EXC_BAD_ACCESS panics (microsoft#2904) Address mismatch on path separators in debug config (microsoft#2010) (microsoft#3108) Include the link to release note/package overview in the update prompt, and update gopls default version (microsoft#3041) bug_report.md: Fix "architecture" typo. (microsoft#3095) telemetry.ts: send telemetry only if aiKey is not an empty string(microsoft#3091)
…sync microsoft/vscode-go@d53b1b3 * 'master' of https://github.com/microsoft/vscode-go: goLanguageServer: set completion follow up command from middleware (microsoft#3084) Add stacktrace dump and better error messages on EXC_BAD_ACCESS panics (microsoft#2904) Address mismatch on path separators in debug config (microsoft#2010) (microsoft#3108)
Merge branch 'master' of https://github.com/microsoft/vscode-go@d53b1b3 * 'master' of https://github.com/microsoft/vscode-go: goLanguageServer: set completion follow up command from middleware (microsoft#3084) Add stacktrace dump and better error messages on EXC_BAD_ACCESS panics (microsoft#2904) Address mismatch on path separators in debug config (microsoft#2010) (microsoft#3108) Created by `git pull --no-ff --log upstream master` Change-Id: Id38768f3ec1bd01fa81325978f51f314fc1c08cb GitHub-Last-Rev: 3a8de3f GitHub-Pull-Request: #17 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/224240 Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Middleware checks both
editor.parameterHints.enabled
and[go].editor.parameterHints.enabled
. The language specificconfig takes precedence as long as it is defined.
vscode.workspace.getConfiguration behaves differently when
querying the language-specific configuration section ('[go]')
so I couldn't query [go].editor.parameterHints directly using
getConfiguration.
Tested manually. (sorry)
Fixes #3075