microsoft / microsoft/vscode

Support DocumentSymbolProvider in CustomTextEditor

Open
#327,247 13 comments 33 reactions 1 assignee Assigned to @dbaeumer View on GitHub
api feature-request
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

I think it would be a great idea if CustomTextEditor supported DocumentSymbolProvider since CustomTextEditor use TextDocument as a model.

For example, I am writing an extension with the new CustomTextEditor APIs for special xml files that can be rendered in a special way. I have written a DocumentSymbolProvider for xml files with this schema and I expected the Outline view to be populated by the symbols.

Other examples for how useful it would be to support DocumentSymbolProvider are:

Getting the outline for markdown documents while displaying the preview mode
Could be ground work to make the Outline view work with jupyter notebooks (see the sections tree view on Google Colab to get an idea of the end result)
Many UI frameworks use xml to describe a layout, with custovem editors and DocumentSymbolProvider you could potentially have GUI based editor and the view hierarchy in the outline
Ideally the CustomTextEditor should be able to intercept "goto symbol" events to focus the symbol in the custom editor (i.e. going to a particular section or highlighting an element in the layout editor).

(copied over from issue #97095, cause now a pull request exists)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.