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

DocumentSymbolProvider #104

Open
niciki-niciki opened this issue Aug 21, 2024 · 7 comments
Open

DocumentSymbolProvider #104

niciki-niciki opened this issue Aug 21, 2024 · 7 comments

Comments

@niciki-niciki
Copy link

Hi,

Could it be possible to add the DocumentSymbolProvider to be used in e.g. Breadcrumbs - just the same list as CodeMap view?

Thanks,
Daniel

@oleg-shilo
Copy link
Owner

Hi Daniel,

It's a tricky one.
DocumentSymbolProvider is an interface used to provide symbols within a document, such as functions, variables, classes, etc. These symbols can then be displayed in the Outline view or used for features like Go to Symbol in a document (Ctrl+Shift+O).

This interface is tightly coupled with the concept of code DOM entities of programming languages (Operator, Method, Field etc.).
Whereas CodeMap is based on the concept of a generic document structure that is not limited to the programming language paradigm. IE, if a markdown document has 4 levels of nested headings it's not clear how they can be mapped to SymbolKind value that is in the heart of DocumentSymbolProvider.

Thus DocumentSymbolProvider is not compatible with CodeMap but with syntax providers only.

Saying that CodeMap directly implements some of the user experiences implemented via DocumentSymbolProvider. Thus "Go to Symbol" :

Meaning that the most significant benefits of DocumentSymbolProvider are implemented by CodeMap directly:

  • "Outline view" - CodeMap implements it directly with its own view
  • "Go to Symbol" - CodeMap implements it directly too.

image

@niciki-niciki
Copy link
Author

Can the user implement this in Custom Mapper?

@oleg-shilo
Copy link
Owner

Technically, most likely yes. But you will be hacking CodeMap extension to build....another extension. :)

I still do not understand what you are trying to achieve.

@niciki-niciki
Copy link
Author

I am thinking about Breadcrumbs - to have just the same CodeMap list also there.
AFAIK Breadcrumbs are using this DocumentSymbolProvider to work.

@oleg-shilo
Copy link
Owner

But breadcrumps panel is supported:
image

Am I missing something?

@niciki-niciki
Copy link
Author

Wow!

Than I am definitely missing something :)

@oleg-shilo
Copy link
Owner

Not sure.
I am not sure the breadcrumbs are rendered because of CodeMap. It might be because VSCode has an extension for the document syntax and it implemented DocumentSymbolProvider. This works even for markdown files

It's rather confusing but I do know that CodeMap does not implement DocumentSymbolProvider. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants