microsoft / microsoft/language-server-protocol

Proposal: to better structure symbol details add LSPArray languageSpecificDetails property to callHierarchy and documentSymbol etc.

Open
#2,118 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Why

Useful attributes for a C++ symbol displayed in call hierarchy or just searched for would probably include (but not limited to) signature, scope, return value, access specifier.
Similar set of useful attributes for other languages will likely differ but at least for C, C++ and Java this set already has more than two entries. Currently implementations are probably trying to fit all of these data items into single detail field of CallHierarchyItem, DocumentSymbol etc. using funny encoding which needs to be parsed by hand.

How

To improve this, let's add another property languageSpecificDetails of type LSPArray to CallHierarchyItem, DocumentSymbol etc.
This new property would be used by language server to communicate useful language-specific attributes as key/value pairs, easing life of client and allowing for more attributes to be passed.

Further steps

Some useful attributes like method signature appear to be common to many different languages and servers may choose to unify corresponding key names across supported languages, allowing for better unified structured UI implementations. Well-known keys shoud probably be not a fixed set but just a list of strings (with descriptions?) allowing for any extension.

Originally discussed in https://github.com/clangd/clangd/discussions/1940 regarding extra details for callHierarchy.

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 protocol definitions for CallHierarchyItem and DocumentSymbol, including the existing detail fields and LSPArray type. Determine which additional symbol-bearing structures should receive languageSpecificDetails and how key names should be specified. Done means the proposal has an agreed property shape, scope, and conventions for language-specific key/value attributes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.