Skip to content
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

Default folding configuration is ignored when using LSP #98099

Closed
hyangah opened this issue May 18, 2020 · 5 comments
Closed

Default folding configuration is ignored when using LSP #98099

hyangah opened this issue May 18, 2020 · 5 comments

Comments

@hyangah
Copy link

hyangah commented May 18, 2020

When LSP is enabled, the folding marker listed in vscode/extensions/go/language-configuration.json seems to be ignored.
microsoft/vscode-go#3249

Is this intentional?

Is there any way to use this default foldingRange information while using LSP?

The //#region .... //#endregion is not part of the language spec so handling this is beyond the language server's responsibility. Either we need to teach vscode to use both information sources, or combine the info from LanguageClient middleware.

@kieferrm
Copy link
Member

VS Code allows to have multiple folding range providers. So, when the user enables the LS, your extension can add a folding range provider that adds region support.

@hyangah
Copy link
Author

hyangah commented May 20, 2020

Thanks @kieferrm
That's what I originally expected, but we are seeing different behavior. (microsoft/vscode-go#3249) It seems to me that only the result from LS's folding range resultsis reflected and the default foldingRange information is ignore. Should I reopen this issue?

@hyangah hyangah changed the title support default folding configuration while using LSP Default folding configuration is ignored when using LSP May 20, 2020
@ramya-rao-a
Copy link
Contributor

@hyangah I believe what @kieferrm is saying is that the language server should update its folding range provider to support region support.

@kieferrm, I believe what @hyangah is asking is whether it is by design that only 1 provider's result is used by VS Code or is it right to expect that VS Code should respect both the default folding provider and the one from language server. This ask would similar to other providers, for example completion. When multiple completion providers are registered for the same language, results from all of them are combined by VS Code.

Personally, I feel that only 1 provider should be respected as otherwise conflict resolution can get tricky

@stamblerre
Copy link

@hyangah I believe what @kieferrm is saying is that the language server should update its folding range provider to support region support.

Just to follow up on this - this isn't possible because this syntax is editor, not language, specific. Combining the results from multiple folding range providers would be the only way to get this to work correctly.

@hyangah
Copy link
Author

hyangah commented Jun 16, 2020

@kieferrm @ramya-rao-a
This is not a language specific but very specific to VS Code. So, I agree that this is not the function of the language server. Either it should be done by the vscode-go extension or the vscode itself.

My question was whether it's intentional or a bug to disable the existing default vscode's folding provider (that defined and implemented #region) when the language server is activated.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants