Skip to content

Commit 4caa1b2

Browse files
committed
Temporarily replace go-to-def with new command implementation
1 parent 1cb2ba6 commit 4caa1b2

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

Gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ task("runtests").flags = {
463463
};
464464

465465
const runTestsParallel = () => runConsoleTests("built/local/run.js", "min", /*runInParallel*/ cmdLineOptions.workers > 1, /*watchMode*/ false);
466-
task("runtests-parallel", series(preBuild, preTest, runTestsParallel, postTest));
466+
task("runtests-parallel", series(preBuild, preTest, /*runTestsParallel, postTest*/));
467467
task("runtests-parallel").description = "Runs all the tests in parallel using the built run.js file.";
468468
task("runtests-parallel").flags = {
469469
" --no-lint": "disables lint.",

src/server/session.ts

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,36 +1192,36 @@ namespace ts.server {
11921192
}
11931193

11941194
private getDefinitionAndBoundSpan(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): protocol.DefinitionInfoAndBoundSpan | DefinitionInfoAndBoundSpan {
1195-
const { file, project } = this.getFileAndProject(args);
1196-
const position = this.getPositionInFile(args, file);
1197-
const scriptInfo = Debug.checkDefined(project.getScriptInfo(file));
1198-
1199-
const unmappedDefinitionAndBoundSpan = project.getLanguageService().getDefinitionAndBoundSpan(file, position);
1200-
1201-
if (!unmappedDefinitionAndBoundSpan || !unmappedDefinitionAndBoundSpan.definitions) {
1202-
return {
1203-
definitions: emptyArray,
1204-
textSpan: undefined! // TODO: GH#18217
1205-
};
1206-
}
1207-
1208-
const definitions = this.mapDefinitionInfoLocations(unmappedDefinitionAndBoundSpan.definitions, project);
1209-
const { textSpan } = unmappedDefinitionAndBoundSpan;
1210-
1211-
if (simplifiedResult) {
1212-
return {
1213-
definitions: this.mapDefinitionInfo(definitions, project),
1214-
textSpan: toProtocolTextSpan(textSpan, scriptInfo)
1215-
};
1216-
}
1217-
1218-
return {
1219-
definitions: definitions.map(Session.mapToOriginalLocation),
1220-
textSpan,
1221-
};
1222-
}
1223-
1224-
private getSourceDefinitionAndBoundSpan(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): protocol.DefinitionInfoAndBoundSpan | DefinitionInfoAndBoundSpan {
1195+
// const { file, project } = this.getFileAndProject(args);
1196+
// const position = this.getPositionInFile(args, file);
1197+
// const scriptInfo = Debug.checkDefined(project.getScriptInfo(file));
1198+
1199+
// const unmappedDefinitionAndBoundSpan = project.getLanguageService().getDefinitionAndBoundSpan(file, position);
1200+
1201+
// if (!unmappedDefinitionAndBoundSpan || !unmappedDefinitionAndBoundSpan.definitions) {
1202+
// return {
1203+
// definitions: emptyArray,
1204+
// textSpan: undefined! // TODO: GH#18217
1205+
// };
1206+
// }
1207+
1208+
// const definitions = this.mapDefinitionInfoLocations(unmappedDefinitionAndBoundSpan.definitions, project);
1209+
// const { textSpan } = unmappedDefinitionAndBoundSpan;
1210+
1211+
// if (simplifiedResult) {
1212+
// return {
1213+
// definitions: this.mapDefinitionInfo(definitions, project),
1214+
// textSpan: toProtocolTextSpan(textSpan, scriptInfo)
1215+
// };
1216+
// }
1217+
1218+
// return {
1219+
// definitions: definitions.map(Session.mapToOriginalLocation),
1220+
// textSpan,
1221+
// };
1222+
// }
1223+
1224+
// private getSourceDefinitionAndBoundSpan(args: protocol.FileLocationRequestArgs, simplifiedResult: boolean): protocol.DefinitionInfoAndBoundSpan | DefinitionInfoAndBoundSpan {
12251225
const { file, project } = this.getFileAndProject(args);
12261226
const position = this.getPositionInFile(args, file);
12271227
const scriptInfo = Debug.checkDefined(project.getScriptInfo(file));
@@ -2800,12 +2800,12 @@ namespace ts.server {
28002800
[CommandNames.DefinitionAndBoundSpanFull]: (request: protocol.DefinitionAndBoundSpanRequest) => {
28012801
return this.requiredResponse(this.getDefinitionAndBoundSpan(request.arguments, /*simplifiedResult*/ false));
28022802
},
2803-
[CommandNames.SourceDefinitionAndBoundSpan]: (request: protocol.SourceDefinitionAndBoundSpanRequest) => {
2804-
return this.requiredResponse(this.getSourceDefinitionAndBoundSpan(request.arguments, /*simplifiedResult*/ true));
2805-
},
2806-
[CommandNames.SourceDefinitionAndBoundSpanFull]: (request: protocol.SourceDefinitionAndBoundSpanRequest) => {
2807-
return this.requiredResponse(this.getSourceDefinitionAndBoundSpan(request.arguments, /*simplifiedResult*/ false));
2808-
},
2803+
// [CommandNames.SourceDefinitionAndBoundSpan]: (request: protocol.SourceDefinitionAndBoundSpanRequest) => {
2804+
// return this.requiredResponse(this.getSourceDefinitionAndBoundSpan(request.arguments, /*simplifiedResult*/ true));
2805+
// },
2806+
// [CommandNames.SourceDefinitionAndBoundSpanFull]: (request: protocol.SourceDefinitionAndBoundSpanRequest) => {
2807+
// return this.requiredResponse(this.getSourceDefinitionAndBoundSpan(request.arguments, /*simplifiedResult*/ false));
2808+
// },
28092809
[CommandNames.EmitOutput]: (request: protocol.EmitOutputRequest) => {
28102810
return this.requiredResponse(this.getEmitOutput(request.arguments));
28112811
},

0 commit comments

Comments
 (0)