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

Provide possibility to configure the top displayed label in outline view for Language Servers #62839

Closed
apupier opened this issue Nov 9, 2018 · 15 comments
Assignees
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities outline Source outline view issues release-notes Release notes issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@apupier
Copy link
Contributor

apupier commented Nov 9, 2018

When there are several language servers contributing an outline for a file. They are both displayed. They are grouped in separate trees. The top level display name seems to use the extension name used.

It would be nice to allow customizing this naming.

for instance, when installing "XML" and "Language Support for Apache Camel", the "Language Support of Apache Camel" naming is used and it is truncated:
image

for information i tried to ask if it is already possible but got no answer so I guess it is not https://stackoverflow.com/questions/52816836/specify-oultine-title-when-several-language-servers-are-present

@jrieken jrieken added feature-request Request for new features or functionality outline Source outline view issues help wanted Issues identified as good community contribution opportunities labels Nov 9, 2018
@YisraelV
Copy link
Contributor

YisraelV commented Nov 9, 2018

I would like to work on this please.

@YisraelV
Copy link
Contributor

YisraelV commented Nov 9, 2018

@apupier can you give another example of a language that has two outline providers?

@apupier
Copy link
Contributor Author

apupier commented Nov 9, 2018

@YisraelV sorry, I don't know any others

@jrieken
Copy link
Member

jrieken commented Nov 9, 2018

@YisraelV get this extension https://marketplace.visualstudio.com/items?itemName=roblourens.unittest-navigate and open TypeScript test files. That will show this.

@jrieken
Copy link
Member

jrieken commented Nov 9, 2018

Most of the required code is already there but the default label is the extension name. That happens here:

https://github.com/Microsoft/vscode/blob/e839e4560c19ce53c717d6f3078fd01e35c737a2/src/vs/workbench/api/node/extHostLanguageFeatures.ts#L964

We need some new API that allows to provide a name when calling registerDocumentSymbolProvider. We usually do that as extra argument to that call, e.g

export function registerDocumentSymbolProvider(selector: DocumentSelector, provider: DocumentSymbolProvider, metadata?: XXXX): Disposable; similar to registerCodeActionProvider

@YisraelV
Copy link
Contributor

@jrieken thank you very much for the guidance! You've saved me a few hours.

I thought the OP had in mind a way for the user to set the name displayed with no change in the extension code. But what you say - making this part of the api for extensions - makes more sense and is much easier to implement.

jrieken added a commit that referenced this issue Nov 16, 2018
custom name when there are multiple outline providers - feature request #62839
@jrieken jrieken added this to the November 2018 milestone Nov 16, 2018
@jrieken
Copy link
Member

jrieken commented Nov 16, 2018

👏 @YisraelV

@YisraelV
Copy link
Contributor

@jrieken thank you very much for the tips and for taking the time to review and merge it.

@apupier
Copy link
Contributor Author

apupier commented Nov 27, 2018

Can you explain how to use this new configuration?

With my Language Server Extension I'm not calling explicitly the registerDocumentOutline https://github.com/Microsoft/vscode/pull/63150/files#diff-6ed04bc0a0e32b52bb98d493792f857eR976 How should specify the specific name?

@jrieken
Copy link
Member

jrieken commented Nov 27, 2018

this needs LSP support first, cc @dbaeumer

@dbaeumer
Copy link
Member

Created microsoft/language-server-protocol#617. A PR to add this to LSP and the node libraries is highly appreciated.

@YisraelV
Copy link
Contributor

@jrieken @dbaeumer I would like to help but could you please explain to me:

  1. what has it got to do with the language server protocol? the display name is something the extension (the language client) is supposed to decide and it's not part of the protocol.

  2. just to be sure the node clients you are talking about are actually wrappers around the api found in vscode.d.ts (the vscode namespace) right?

@dbaeumer
Copy link
Member

@YisraelV you are correct. This doesn't need any changes in the LSP protocol but only in the vscode-languageclient library which is maintained here: https://github.com/Microsoft/vscode-languageserver-node. The file too look at is: https://github.com/Microsoft/vscode-languageserver-node/blob/master/client/src/client.ts which wires the LSP to the VS Code API. We would need to add a way that the client can control this to decide whether the LSP is directly wired to the outline provider. Currently this is done by VS Code itself by reusing the document symbol request.

@jrieken jrieken added the verification-needed Verification of issue is requested label Dec 3, 2018
@jrieken
Copy link
Member

jrieken commented Dec 3, 2018

verify by opening the outline and/or breadcrumbs for launch.json, one provider should be called 'Launch Targets'

@alexr00 alexr00 added the verified Verification succeeded label Dec 5, 2018
@jrieken jrieken added the release-notes Release notes issues label Dec 7, 2018
@YisraelV
Copy link
Contributor

YisraelV commented Dec 7, 2018

@jrieken because this issue is closed I assume the work was finished by someone else? I did not quite understand what happened.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities outline Source outline view issues release-notes Release notes issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants