Go to definition: pass unverified through server (#43483)

* Pass `unverified` through server

* Update protocol baseline

* Fix unit tests

* Fix other tests
This commit is contained in:
Andrew Branch
2021-04-05 13:42:25 -07:00
committed by GitHub
parent 4b556e37db
commit ffe925ddd5
12 changed files with 39 additions and 26 deletions

View File

@@ -1013,7 +1013,7 @@ namespace ts.server.protocol {
* Definition response message. Gives text range for definition.
*/
export interface DefinitionResponse extends Response {
body?: FileSpanWithContext[];
body?: DefinitionInfo[];
}
export interface DefinitionInfoAndBoundSpanResponse extends Response {

View File

@@ -1224,6 +1224,7 @@ namespace ts.server {
containerName: info.containerName,
kind: info.kind,
name: info.name,
...info.unverified && { unverified: info.unverified },
};
});
}
@@ -1300,8 +1301,8 @@ namespace ts.server {
}));
}
private mapDefinitionInfo(definitions: readonly DefinitionInfo[], project: Project): readonly protocol.FileSpanWithContext[] {
return definitions.map(def => this.toFileSpanWithContext(def.fileName, def.textSpan, def.contextSpan, project));
private mapDefinitionInfo(definitions: readonly DefinitionInfo[], project: Project): readonly protocol.DefinitionInfo[] {
return definitions.map(def => ({ ...this.toFileSpanWithContext(def.fileName, def.textSpan, def.contextSpan, project), ...def.unverified && { unverified: def.unverified } }));
}
/*