Skip to content

Commit b6eafc0

Browse files
committed
Add test
1 parent 0a07132 commit b6eafc0

File tree

2 files changed

+443
-0
lines changed

2 files changed

+443
-0
lines changed

src/testRunner/unittests/tsserver/dynamicFiles.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,27 @@ describe("unittests:: tsserver:: dynamicFiles:: ", () => {
270270
verifyPathRecognizedAsDynamic("walkThroughSnippet", "walkThroughSnippet:/usr/share/code/resources/app/out/vs/workbench/contrib/welcome/walkThrough/browser/editor/^vs_code_editor_walkthrough.md#1.ts");
271271
verifyPathRecognizedAsDynamic("untitled", "untitled:/Users/matb/projects/san/^newFile.ts");
272272
});
273+
274+
it("chat block with imports", () => {
275+
const host = TestServerHost.createServerHost({
276+
"/user/username/projects/myproject/a.ts": "",
277+
"/user/username/projects/myproject/tsconfig.json": "{}"
278+
})
279+
const session = new TestSession({ host, useInferredProjectPerProjectRoot: true })
280+
openFilesForSession([{ file: "/user/username/projects/myproject/a.ts", projectRootPath: "/user/username/projects/myproject" }], session)
281+
// Without projectRoot
282+
openFilesForSession([{
283+
file: "^/chat-editing-snapshot-text-model/ts-nul-authority/c/temp/codeRepo/src/services/user.service.ts",
284+
content: "",
285+
scriptKindName: "TS",
286+
}], session)
287+
// with "/" as project root
288+
openFilesForSession([{
289+
file: "^/vscode-chat-code-block/dnnjb2rllwnoyxqtc2vzc2lvbjovl2xvy2fsl1peag1oelv6tkdvde9uvtvnuzawtxpbnuxxstrare10tvrobfpuvtbpvgmytudwaq/response_6b1244f1-9aca-4b8b-8f65-0ff7ed4e6b4e/2#{\"references\":[]}",
290+
content: `import { UserService from './src/services/user.service';}`,
291+
projectRootPath: "/",
292+
scriptKindName: "TS"
293+
}], session)
294+
baselineTsserverLogs("dynamicFiles", "chat block with imports", session);
295+
})
273296
});

0 commit comments

Comments
 (0)