|
1 | 1 | namespace ts.projectSystem {
|
2 |
| - describe("unittests:: tsserver:: Semantic operations on PartialSemantic server", () => { |
| 2 | + describe("unittests:: tsserver:: Semantic operations on partialSemanticServer", () => { |
3 | 3 | function setup() {
|
4 | 4 | const file1: File = {
|
5 | 5 | path: `${tscWatch.projectRoot}/a.ts`,
|
@@ -203,5 +203,20 @@ function fooB() { }`
|
203 | 203 | assert.isUndefined(project.getPackageJsonAutoImportProvider());
|
204 | 204 | assert.deepEqual(project.getPackageJsonsForAutoImport(), emptyArray);
|
205 | 205 | });
|
| 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 | + }); |
206 | 221 | });
|
207 | 222 | }
|
0 commit comments