How to add elements to Outline panel in custom extension?

允我心安 提交于 2019-12-06 06:17:41

The outline view is populated by a DocumentSymbolProvider (see also: registerDocumentSymbolProvider()). In the language server protocol, this corresponds to the textDocument/documentSymbol request.

All in all, it currently provides the data for all of these:

  • Outline view
  • Breadcrumbs
  • Go to Symbol in File

You can find an example implementation of one here, though you'll want it to return DocumentSymbol rather than SymbolInformation instances. Only the former supports the hierarchy needed for the outline view via it's children property.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!