Skip to content

Collect new SymbolKinds #344

Open
Open

Description

Collects new symbol kinds.

Activity

  1. vladdu commented on Nov 27, 2017

    @vladdu
    Contributor

    I assume it's best to propose one item per comment, so that people can vote for it.

  2. vladdu commented on Nov 27, 2017

    @vladdu
    Contributor
    • pragma / directive
  3. vladdu commented on Nov 27, 2017

    @vladdu
    Contributor
    • macro
  4. rictic commented on Nov 27, 2017

    @rictic
    Contributor

    Slot, in the sense of a named, declared hole in a template that a user of the element can use to insert content.

    e.g. <slot> in Shadow Dom v1, <content> in Shadow Dom v0, transclusion points in AngularJS, <ng-content> in Angular.

  5. laughedelic commented on Nov 29, 2017

    @laughedelic
    Contributor

    Value: There is CompletionItemKind.Value, but no SymbolKind.Value

  6. tsmaeder commented on Dec 18, 2017

    @tsmaeder

    Annotation

  7. raja-s commented on Jan 8, 2019

    @raja-s

    Some languages make a fundamental distinction between a function that has a return type and a "function" that doesn't return anything, unlike in C for example where it's simply determined by whether or not the return type is void, so it would be useful to have a separate symbol kind that could be called for example Procedure.

  8. raja-s commented on Jan 8, 2019

    @raja-s

    Type for type declarations.

  9. raja-s commented on Jan 10, 2019

    @raja-s

    Parameter/Argument to be able to distinguish function/constructor/... parameters from actual variables.

  10. kenkangxgwe commented on Jan 25, 2019

    @kenkangxgwe
    Contributor

    Section for typesetting languages

  11. dbaeumer commented on Jan 25, 2019

    @dbaeumer
    MemberAuthor

    康小广 (@kenkangxgwe) can you provide me with an example.

  12. kenkangxgwe commented on Jan 25, 2019

    @kenkangxgwe
    Contributor

    Dirk Bäumer (@dbaeumer)
    In LaTeX,

    \section{Introduction}
    %...

    In Wolfram Language

    (* ::Section:: *)
    (*Introduction*)

    In MATLAB

    %%Introduction
    // ...

    In C#

    #region section
    // ...
    #endregion  
  13. KamasamaK commented on Jan 25, 2019

    @KamasamaK
    Contributor

    Markdown also has sections. The VS Code built-in extension is currently using SymbolKind.String for them.

  14. 13 remaining items

  15. matklad commented on Nov 17, 2020

    @matklad
    Contributor

    This list (attribute/annotation, union, typeAlias) is what's been implemented in rust-analyzer for a while, and which feels general-purpose enough to uplift to the protocol proper.

  16. dbaeumer commented on Nov 17, 2020

    @dbaeumer
    MemberAuthor

    Alex Kladov (@matklad) this is about SymbolKind and not about semantic tokens.

  17. matklad commented on Nov 17, 2020

    @matklad
    Contributor

    Oh, my bad, I confused both SemanticTokenType with SymbolKind, and server with client, sorry about that 🤦

    But yeah, rust-analyzer will be ready to use macro, typeAlias and union for SymbolKind as soon as they are available! I don't think we can do this before the protocol is stabilized though: SymbolKinds, unlike SemanticTokenTypes, are not extensible.

  18. sam-mccall commented on Dec 8, 2020

    @sam-mccall
    Contributor

    Otherwise only having them in the spec with no implementation is not very helpful

    They're valuable once implemented in both server and client, so there's a first-mover disadvantage.
    We have several language servers saying they're willing to go first, but are unwilling to break the spec in order to do so. So having them in the spec solves the coordination problem (and practically, avoids having servers and other clients blocked on VSCode prioritizing this).

    (FWIW I'd be eager to add both server and client support for StaticField and StaticMethod or so for both client and servers - the server is open-source but the client is not)

  19. dbaeumer commented on Dec 9, 2020

    @dbaeumer
    MemberAuthor

    IMO StaticField and StaticMethod shouldn't be new symbol kinds. If we want to express this we should adopt the way how this is handled in semantic tokens. So I would rather have a SymbolModifier which says static, async, ..

  20. KamasamaK commented on Dec 9, 2020

    @KamasamaK
    Contributor

    Dirk Bäumer (@dbaeumer)

    So I would rather have a SymbolModifier which says static, async, ..

    Did you mean SymbolTag?

  21. dbaeumer commented on Dec 9, 2020

    @dbaeumer
    MemberAuthor

    KamasamaK yes sorry. Was confused with semantic tokens.

  22. sam-mccall commented on Feb 25, 2021

    @sam-mccall
    Contributor

    Since this enum can't be extended by clients/servers, it would be useful to have unknown or other or something.

    For C++ we'd like to be able to include macro expansions (not definitions) in the hierarchy in certain cases. (Basically, when a macro dumps a bunch of implementation-detail symbols with into a namespace, the outline is pretty confusing if we can't group those somehow). This is a weird thing to do and I'm not sure it makes sense to add a macroExpansion kind to LSP (especially if VSCode folks don't want more kinds). On the other hand, having to pretend these symbols are nulls or namespaces or something is pretty bad!

    (I do agree with your point about StaticField and StaticMethod... the semantic tokens data model is nice!)

  23. DavidGoldman commented on May 5, 2021

    @DavidGoldman

    Just to confirm, if we wanted to implement this, we'd need to include support for a client as well, likely VS Code, right? How would we go about making contributions to VS Code - what needs to be done to support it in VS Code exactly? New icons + support for the new symbol kinds?

  24. dbaeumer commented on May 10, 2021

    @dbaeumer
    MemberAuthor

    If you want new kinds to light up in VS Code then yes, we need support for VS Code as well. We can still extend the list in LSP and guard the new symbol kinds using a capability.

  25. gerdleon commented on Sep 27, 2022

    @gerdleon

    Some languages make a fundamental distinction between a function that has a return type and a "function" that doesn't return anything, unlike in C for example where it's simply determined by whether or not the return type is void, so it would be useful to have a separate symbol kind that could be called for example Procedure.

    I would very much appreciate this.

  26. gerdleon commented on Sep 27, 2022

    @gerdleon

    To support languages that describe database structures table would be useful.

  27. kraigher commented on Feb 19, 2023

    @kraigher
    Contributor

    I wrote a proposal here #1186 (comment) that avoids the need to collect a long list symbol kinds globally.

  28. yyny commented on Apr 21, 2024

    @yyny

    Label, for C/C++/Zig/JavaScript/Lua/Assembly/LLVM/etc. labels.

  29. travkin79 commented on Apr 16, 2026

    @travkin79

    Destructor

    Languages like C/C++ need a distinction between constructor and destructor, so adding Destructor to SymbolKind would improve the UI (see also CDT LSP issue eclipse-cdt/cdt-lsp#608).

    Another option would be to use SymbolTags to annotate methods as destructors or constructors, similar to PR #2003 using symbol tags to annotate document symbols with details like public, static, final, and other flags / keywords. In this case I would deprecate SymbolKind.Constructor in favour of a new Constructor symbol tag (and of course also a Destructor symbol tag).

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions