mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Comments/naming
This commit is contained in:
@@ -700,6 +700,13 @@ namespace ts.server {
|
||||
return definitions.map(def => this.toFileSpan(def.fileName, def.textSpan, project));
|
||||
}
|
||||
|
||||
/*
|
||||
* When we map a .d.ts location to .ts, Visual Studio gets confused because there's no associated Roslyn Document in
|
||||
* the same project which corresponds to the file. VS Code has no problem with this, and luckily we have two protocols.
|
||||
* This retains the existing behavior for the "simplified" (VS Code) protocol but stores the .d.ts location in a
|
||||
* set of additional fields, and does the reverse for VS (store the .d.ts location where
|
||||
* it used to be and stores the .ts location in the additional fields).
|
||||
*/
|
||||
private static mapToOriginalLocation<T extends DocumentSpan>(def: T): T {
|
||||
if (def.originalFileName) {
|
||||
Debug.assert(def.originalTextSpan !== undefined, "originalTextSpan should be present if originalFileName is");
|
||||
|
||||
Reference in New Issue
Block a user