Discussion: Syntax highlighting for CompletionEntryDetails displayParts #19052
Labels
Needs Investigation
This issue needs a team member to investigate its status.
Milestone
Problem
With microsoft/vscode#34188, we are looking to add syntax highlighting to the
detail
section of VS Code's documentation. Currently we use thedisplayParts
field on theCompletionEntryDetails
response for this. However the returned display parts are not always valid TS/JS code blocks, resulting in incorrect colorization in some cases:In this example,
const
should be blue. The unclosedinterface
causes it to be colored incorrectly.TypeScript currently returns basic token info using the
SymbolDisplayPart
type, however we cannot use this in a VS Code extension for colorizationProposal
In the
Date
example, there are really two blocks of code:and
The first block is the primary label for the item while the other block provides additional info. Other completion items may have more than two sections.
I propose adding a new
additionalDetails
field toCompletionEntryDetails
as follows:displayParts
would contain the primary label for the item, such asinterface Date
. I imagine this should always match what we return for quick info on the symboladditionalDisplayParts
would be an optional set of additional code blocks to display, such asconst Date: DateConstructor
. Each code block would be syntax highlighted on its ownThis change would be mostly backwards compatible, however older clients that do not support
additionalDisplayParts
could lose some display informationAny other thoughts on how we could implement this?
The text was updated successfully, but these errors were encountered: