Skip to content

Commit 34c6cfd

Browse files
committed
Temporarily replace go-to-def with new command implementation
1 parent 43c01e2 commit 34c6cfd

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

Diff for: Gulpfile.js

+1-1
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.",

Diff for: src/server/session.ts

+36-36
Original file line numberDiff line numberDiff line change
@@ -1191,36 +1191,36 @@ namespace ts.server {
11911191
}
11921192

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

0 commit comments

Comments
 (0)