mirror of
https://github.com/microsoft/language-server-protocol.git
synced 2025-12-23 08:48:16 +00:00
Documented support for related information
This commit is contained in:
parent
13347dca69
commit
69028bf06f
1 changed files with 27 additions and 0 deletions
|
|
@ -293,6 +293,8 @@ interface Location {
|
|||
|
||||
Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.
|
||||
|
||||
> New: `relatedInformation` property.
|
||||
|
||||
```typescript
|
||||
interface Diagnostic {
|
||||
/**
|
||||
|
|
@ -321,6 +323,12 @@ interface Diagnostic {
|
|||
* The diagnostic's message.
|
||||
*/
|
||||
message: string;
|
||||
|
||||
/**
|
||||
* An array of related diagnostic information, e.g. when symbol-names within
|
||||
* a scope collide all definitions can be marked via this property.
|
||||
*/
|
||||
relatedInformation?: DiagnosticRelatedInformation[];
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -347,6 +355,25 @@ namespace DiagnosticSeverity {
|
|||
}
|
||||
```
|
||||
|
||||
```typescript
|
||||
/**
|
||||
* Represents a related message and source code location for a diagnostic. This should be
|
||||
* used to point to code locations that cause or related to a diagnostics, e.g when duplicating
|
||||
* a symbol in a scope.
|
||||
*/
|
||||
export interface DiagnosticRelatedInformation {
|
||||
/**
|
||||
* The location of this related diagnostic information.
|
||||
*/
|
||||
location: Location;
|
||||
|
||||
/**
|
||||
* The message of this related diagnostic information.
|
||||
*/
|
||||
message: string;
|
||||
}
|
||||
```
|
||||
|
||||
#### Command
|
||||
|
||||
Represents a reference to a command. Provides a title which will be used to represent a command in the UI. Commands are identified by a string identifier. The protocol currently doesn't specify a set of well-known commands. So executing a command requires some tool extension code.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue