Skip to content

Support DocumentSymbolProvider in CustomTextEditor #97095

Description

@chq-matteo

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 custom 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).

Activity

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

Metadata

Metadata

Labels

*out-of-scopePosted issue is not in scope of VS Codecustom-editorsCustom editor API (webview based editors)feature-requestRequest for new features or functionalityoutlineSource outline view issues

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions