Skip to content

Commit f6d3b18

Browse files
committed
Add partial semantic test
1 parent 248ed37 commit f6d3b18

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/testRunner/unittests/tsserver/partialSemanticServer.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
namespace ts.projectSystem {
2-
describe("unittests:: tsserver:: Semantic operations on PartialSemantic server", () => {
2+
describe("unittests:: tsserver:: Semantic operations on partialSemanticServer", () => {
33
function setup() {
44
const file1: File = {
55
path: `${tscWatch.projectRoot}/a.ts`,
@@ -203,5 +203,20 @@ function fooB() { }`
203203
assert.isUndefined(project.getPackageJsonAutoImportProvider());
204204
assert.deepEqual(project.getPackageJsonsForAutoImport(), emptyArray);
205205
});
206+
207+
it("should support go-to-definition on module specifiers", () => {
208+
const { session, file1, file2 } = setup();
209+
openFilesForSession([file1], session);
210+
const response = session.executeCommandSeq<protocol.DefinitionAndBoundSpanRequest>({
211+
command: protocol.CommandTypes.DefinitionAndBoundSpan,
212+
arguments: protocolFileLocationFromSubstring(file1, `"./b"`)
213+
}).response as protocol.DefinitionInfoAndBoundSpan;
214+
assert.isDefined(response);
215+
assert.deepEqual(response.definitions, [{
216+
file: file2.path,
217+
start: { line: 1, offset: 1 },
218+
end: { line: 1, offset: 1 }
219+
}]);
220+
});
206221
});
207222
}

0 commit comments

Comments
 (0)