microsoft / microsoft/language-server-protocol

`DocumentSymbol.detail?`: syntax highlighting

Open
#1,130 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

document symbols feature-request
Dominant language
TypeScript
Stars
13k
Forks
1k
Avg merge
6d 1h
Merged PRs (30d)
10

Description

The DocumentSymbol interface exposes a detail? field often contains signatures of functions. This is very useful when implementing outline views, as additional information can be provided to the user (the symbol's signature instead of only its name).

However, because DocumentSymbol.detail? is just a string, the client cannot properly colorize the output the same way as is possible for textDocument/signatureHelp. I propose that the textDocument/documentSymbol request be extended with a paramter that makes the DocumentSymbol.detail? of its results MarkupContent, and perhaps even allows to control whether that field should be present at all. A client capability for this is probably the wrong approach, as there are many uses for textDocument/documentSymbol, and not all of them require the more heavy markdown.

Also, perhaps textDocument/documentSymbol should allow lazily requesting the children, similar to the "variables" request of the Debugger Adapter Protocol?

Thoughts and opinions welcome.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing textDocument/documentSymbol request, the DocumentSymbol.detail field, and the textDocument/signatureHelp response. Compare the proposed MarkupContent and lazy-child options, then determine the protocol design and scope with the discussion before making any specification change.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.