Documented support for related information

This commit is contained in:
Dirk Baeumer 2018-04-05 15:57:53 +02:00
parent 13347dca69
commit 69028bf06f

View file

@ -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.