Skip to content

Interactive Diagnostics  #64566

Open
Open
@mjbvz

Description

@mjbvz

Problem

JS and TS diagnostic messages can get quite large, especially when dealing with frameworks like Vue or react. The TS team has worked to significantly improve and shorten diagnostic messages, including replacing complex type information with ..., however there are still cases where you need to see the full type information. Right now, we have to staticly choose to expand the additional information or not. They would like the user to be able to interactively expand types within a diagnostic

In addition, the overall diagnostic experience could be improved. Two areas identified talking with the TS team:

  • Syntax coloring of inline code in diagnostics
  • Go to definition in diagnostics

Refs

#11847

Desired User Experience

Consider a diagnostic message T<...>. We would like the ... to be something like a link. Clicking it would expand the diagnostic message to T<Array<...>>, which itself contains another expandable link

Requirements

The main focus is on being able dynamically to expand sections of a diagnostic. We need new VS Code API support for this and then will need languages to adopt this API. However, I think the other two features should be considered while designing the new diagnostics API as they are likely something we would like to support and will influence overall api design

For expansion, we want to be able to:

  • Mark arbitrary spans within a diagnostics as expandable
  • Lazily compute these expansions, i.e. don't resolve the expansions ahead of time
  • Allow expansions to contain other expansions
  • Show a progress indicator of some kind while an expansion is being resolved

Many of these features also make sense for quick info hovers

Metadata

Metadata

Assignees

Labels

apifeature-requestRequest for new features or functionalitylanguages-diagnosticsSource problems reportingunder-discussionIssue is under discussion for relevance, priority, approach

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions