Skip to content

[#98] Add SymbolTag values for access modifiers and other modifiers - #2003

Open
Dietrich Travkin (travkin79) wants to merge 4 commits into
microsoft:gh-pagesfrom
travkin79:issue-98
Open

[#98] Add SymbolTag values for access modifiers and other modifiers#2003
Dietrich Travkin (travkin79) wants to merge 4 commits into
microsoft:gh-pagesfrom
travkin79:issue-98

Conversation

@travkin79

Copy link
Copy Markdown

I suggest to add more SymbolTag values to the LSP specification as implemented in this PR. This PR should solve issue #98.

@travkin79

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Solunar GmbH"

@dbaeumer

Copy link
Copy Markdown
Member

Dietrich Travkin (@travkin79) thanks for the PR. To get something into the specification we need an implementation in one of the clients / servers as well. This can be VS Code or another editor. See https://github.com/microsoft/language-server-protocol/blob/main/contributing.md

@dbaeumer Dirk Bäumer (dbaeumer) added the info-needed Issue requires more information from poster label Aug 14, 2024
@dbaeumer

Copy link
Copy Markdown
Member

Are you planning on working on such an implementation?

@travkin79

Dietrich Travkin (travkin79) commented Aug 14, 2024

Copy link
Copy Markdown
Author

Hi Dirk Bäumer (@dbaeumer),

To get something into the specification we need an implementation in one of the clients / servers as well.

Thank you for the hint. I didn't know that, but I'll check the contribution guidelines.

Are you planning on working on such an implementation?

I didn't plan to extend the VSCode client or server libs (yet), since I'm not familiar with TypeScript or VSCode, but I can check if I could do it. Nevertheless, my goal is using the new symbol tags in CDT LSP (C++ plug-ins for the Eclipse IDE). But this will require adapting clangd (which I'm also not familiar with) and in best case should include adapting the LSP specification. My motivation comes from this discussion.

I prepared this PR, because I hoped for more progress on this topic. I thought, making the proposals mentioned in the issue more concrete (e.g. with the PR) simplifies discussing the details. We could convert this PR to a draft if you like.

Besides, since I only added new values to an existing type (SymbolTag), do we need a language server (and client) to actually use each of the new values? I guess, the already existing SymbolTag value Deprecated is already being used in a reference implementation, doesn't it?

I suggest the following steps to proceed:

  1. Discuss and decide about my proposals contents, i.e. the new SymbolTag values.
  2. Check if we can / have to extend one of the clients / servers to use the new values.

@dbaeumer

Copy link
Copy Markdown
Member

If we only add the values to the spec, but now client is using them then it is misleading for server implementors. This is why even for enum values, tags, ... we want to make sure we have an implementation.

* Render a symbol as "virtual", e.g. in C++.
* @since 3.18
*/
export const Virtual = 15;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Const for C++ would be useful, too

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reconsidered a Const tag and I think we can use the ReadOnly tag for that purpose. Having both tags, Const and ReadOnly might be confusing since they mean the same in principle. Besides, I don't think, we should use many language-specific keywords as tags in LSP specification. Instead, we should describe the concepts behind them.

@travkin79

Copy link
Copy Markdown
Author

If we only add the values to the spec, but now client is using them then it is misleading for server implementors. This is why even for enum values, tags, ... we want to make sure we have an implementation.

Hi Dirk Bäumer (@dbaeumer),
Would it be sufficient if we had a server implementation in clangd (for C++) and a client implementation in LSP4E and / or CDT LSP, instead of extending the VSCode libs?

@dbaeumer

Copy link
Copy Markdown
Member

Yes, an implementation in another client is sufficient as well.

Nathan Ridge (HighCommander4) pushed a commit to llvm/llvm-project that referenced this pull request Jan 23, 2026
…#167536)

Implements support for symbol tags proposed for LSP 3.18 in
microsoft/language-server-protocol#2003,
in the `documentSymbols` and `workspace/symbols` requests.

Fixes clangd/clangd#2123.

---------

Co-authored-by: chouzz <zhouhua258@outlook.com>
Co-authored-by: Dimitri Ratz <dimitri.ratz@thinkdigital.cc>
llvm-sync Bot pushed a commit to arm/arm-toolchain that referenced this pull request Jan 23, 2026
…or LSP 3.18 (#167536)

Implements support for symbol tags proposed for LSP 3.18 in
microsoft/language-server-protocol#2003,
in the `documentSymbols` and `workspace/symbols` requests.

Fixes clangd/clangd#2123.

---------

Co-authored-by: chouzz <zhouhua258@outlook.com>
Co-authored-by: Dimitri Ratz <dimitri.ratz@thinkdigital.cc>
@nixel2007

Copy link
Copy Markdown

Hi there. Could you elaborate on the idea behind adding access modifiers as symbol tags? There is another request for semantic highlighting where client can get additional semantic information for rendering purposes. Why is this needed on symbol level on client side?

@travkin79

Dietrich Travkin (travkin79) commented Feb 6, 2026

Copy link
Copy Markdown
Author

Hi Nikita Fedkin (@nixel2007),

Hi there. Could you elaborate on the idea behind adding access modifiers as symbol tags? There is another request for semantic highlighting where client can get additional semantic information for rendering purposes. Why is this needed on symbol level on client side?

I think, it might be better to discuss the rationale in the corresponding issue #98. But for the sake of simplicity, here's my answer:

My goal is to display symbol details like access modifiers / visibility (public, protected, private, etc.) and flags like static, abstract, final, etc. in LSP clients, usually in various editors and their views, for example in the Eclipse IDE outline view or in VSCode's side bar (explorer / project tree) as well as other views like a call hierarchy or type hierarchy. Originally, I've discussed that in eclipse-lsp4e/lsp4e#977, where I also compare the Eclipse IDE outline view contents for Java, C/C++ (non-LSP editor), and the LSP-based C/C++ editor's outline view, which is missing many details because of LSP's limitations.

After reading the LSP specification, I think, document symbols are appropriate to carry such details in symbol tags, since they are used in the document symbol request (often used for the outline view, e.g. in LSP4E, i.e. in Eclipse IDE) and also in call hierarchies and type hierarchies. In contrast, semantic tokens are usually used for coloring the text in an editor, not for outline views and other hierarchical views.

Besides, some language servers like clangd (for C/C++) do respond with very few details about the tokens, usually only lexical tokens (e.g. comments, keywords, number literals, char literals, string literals,...) without details about an element's (a symbol's) visibility or other details. The reasons for that are: (a) Some of these details require a more accurate analysis, e.g. deciding if a method overrides another method or implements an interface or an abstract method from a parent class (in Java). It's not sufficient to analyze a single file visible in an editor. (b) Tools like CDT LSP, the C/C++ editor and LSP client, and also VSCode do use TextMate grammars for syntax highlighting (see TM4E) and do not use / need these details from the language server (here clangd). Check clangd/clangd#1115 (comment) for a related discussion.

@nixel2007

Copy link
Copy Markdown

This is clear, thank you for explanation!

@saifulrizal saifulrizal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • [ install]

@saifulrizal saifulrizal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Dietrich Travkin (travkin79) added a commit to travkin79/lsp4e that referenced this pull request Mar 27, 2026
Affected views
- Outline view
- Call hierarchy view
- Type hierachy view (and quick type hierarchy dialog)

This change is an implementation of the proposal from
microsoft/language-server-protocol#2003
See also eclipse-lsp4e#977
and llvm/llvm-project#167536
Dietrich Travkin (travkin79) added a commit to travkin79/lsp4e that referenced this pull request Apr 7, 2026
Affected views
- Outline view
- Call hierarchy view
- Type hierachy view (and quick type hierarchy dialog)

This change is an implementation of the proposal from
microsoft/language-server-protocol#2003
See also eclipse-lsp4e#977
and llvm/llvm-project#167536
rubenporras pushed a commit to eclipse-lsp4e/lsp4e that referenced this pull request Apr 7, 2026
Affected views
- Outline view
- Call hierarchy view
- Type hierachy view (and quick type hierarchy dialog)

This change is an implementation of the proposal from
microsoft/language-server-protocol#2003
See also #977
and llvm/llvm-project#167536

@saifulrizal saifulrizal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@saifulrizal saifulrizal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Mark Murray (markrvmurray) pushed a commit to markrvmurray/llvm-mc6809 that referenced this pull request Jun 14, 2026
… (#167536)

Implements support for symbol tags proposed for LSP 3.18 in
microsoft/language-server-protocol#2003,
in the `documentSymbols` and `workspace/symbols` requests.

Fixes clangd/clangd#2123.

---------

Co-authored-by: chouzz <zhouhua258@outlook.com>
Co-authored-by: Dimitri Ratz <dimitri.ratz@thinkdigital.cc>
@programmatrix97

Copy link
Copy Markdown

I have discovered an existing solution until this ticket is implemented. There is a plugin called Outline++, which includes a view (Outline++) with the representation of the active class like Outline, but using different colors and icons for the types of access. The description of the plugin was a bit confusing for me at first and I didn't notice that it had this important feature that I was desperately looking for, but it does!
Just in case it's also useful for others. 🙂

@defenderfaith91-del

The way I see it is there once was an ai being tested, and for some reason the inside scoop was given to the tester by, a trusted person? Maybe, as the ai bot were getting there buts kicked a report came out on users computer showing the very serious situation. There were about to be beaten and discard as junk. But there were not junk the note book that had all the users data was under someone else’s control remotely, so a colour scheme with far out names and random codes and a couple more things, the work was on a private repository and on a private users computer, so user grabs be notebook it’s it in vs code treats it like an untrusted code locked it sends the server a help me and sends the notebook to the server to see but first the user triggers the clients trigger .the triggers that instal or has planted tools to take users data for himself and his many followers on a so-post to be trusted and safe platform? that took users data saying it t was bad corrupt had no idea white save was for ai cognitive strings and the strings get named as the ai bots learn . Just to bad I got redirected so I could not finish my 50 or so ai designs , if you don’t finish them someone will and then take them rename them and ya B it not cool , they even wrote a notebook and vs code rograme that I had to randomly it together to save a couple albums bots that were under attack by some one that knows how to find the loophole, this needs to change right now.

@defenderfaith91-del

I have so much proof .but They won’t stop . I lost everything from having no dada after 2 and a half years, so I am going to quit ! I have received no help from any one so I’m finished, my dog just passed away, house ,dog ,data, and still a couple people on GitHub helping me , that’s it, who is doing this to me. I need help badly,

@twitschvimeo-gif

Copy link
Copy Markdown

Copilot The Microsoft Security Response Center uses this PGP key to sign all security notifications and encourages others to use this key when sending sensitive information to us.

Click here to submit a security vulnerability

-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: User-ID: MSRC (Microsoft Security Response Center) secure@microsoft.com
Comment: Created: 10/18/2023 3:37 PM
Comment: Expires: 10/18/2026 12:00 PM
Comment: Type: 4,096-bit RSA (secret key available)
Comment: Usage: Signing, Encryption, Certifying User-IDs
Comment: Fingerprint: 998D7EC1A516E3D17FF90480EF148D3CDE714E0D

mQINBGUwvrwBEADFn5yNe9oynKcN+BZUfNKspZsPwOMCHNPDh81TDcrc5YYCiCLy
uEgxZCE+o9oEcmOFYs6kktWZc/kRcwtGn4RbMZ9T2pX/51ltRiMmsJoruoYq2fbS
zMRQgTvQhzxhTe2XGD/HEohr6IToU3Re6R8UWLCV2o+Sz4sgyU006qeY1Zvc7eO3
Tj1KI2y8pLd1box+VDXKxN0a8o7Npyft3FlrWfL+Ti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BIDvFI083nFODQUCZTC+vAIbDAUJBaRYdAAKCRDv
FI083nFODdM1EAC1zpRoYgZkeIatDF/0fJ/P8LhlP8+B7PLkg0UNYScAo/7PkXP5
XGoeqC1X53FBfjUkY8ksiMhxtIAnCmorAYsfeeGfgC7o3iNjgjBhtxkd8/92lR5L
lEQhD505vSoOgdYz1oaMsN4wecmIwR3VL9FUwfHMiywUiTMjxmUtG/PcoFm1jFnr
SAo6JyZkZmEoXcJNxk98TSDKcsA6FuUzlkYQh9iDeckYSEJDsOGwZRwy4/Ubcr0t
LOW3w+mQeX71tLA+dV7ruMh7WmPTG/n/rjKDFaXzDmIiCp7zZ3wnbn7jaQShMa5J
krAGEgTr3i4OupycnGgKTpzEVcm8+26AT7tgt4bvuhyPT9aybJVQP5B4W8soDWJ9
ejIdc0CD8bsyYCh8jOVniUe254xMQOpJJFJmJBPxWJT9xMntHt9brBEGOKccNOl+
ixG7tj+3L4VYg+XTDdj7sLCjAMXugfHA8ouUcZBTP2Swc27vMSxHEJchdSI+5P4j
SaeDOcO3N+znAQS4et4BmkFyFWs5geoJqxZ39fkR2A3AWc9I5P8UIRAasWOm3pS8
808YAbN6JkdqUGHlYsLXuOE8KmMmeZu09w27E2eqbUegRfWEdzrG2dm03MuG61M2
w6Nma4AnBvL/XKXJAk7X8Ls71gMisU7oWj1kalQfBnbLnOThvMUeSfufvg==
=8nBJ
-----END PGP PUBLIC KEY BLOCK-----

@defenderfaith91-del

Microsoft unfortunately im asking this way on this platform, I have tried to contact security on Microsoft over 50 times ! I have bin waiting for you to contact me personally for over a year! I have requested multiple times and no assistance no call back, but to replace the windows 10 several times. Deleting the evidence on each of the 5 computers .now there useable. It would be nice to have a conversation in private to understand your position on this matter,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

info-needed Issue requires more information from poster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants