Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main'
  • Loading branch information
JoshuaKGoldberg committed Oct 18, 2023
commit f30827c0abe0068274de3e639da807fea60d1f82
34 changes: 30 additions & 4 deletions src/testRunner/unittests/tsserver/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ describe("unittests:: tsserver:: completions", () => {
};

const host = createServerHost([aTs, bTs, tsconfig]);
const session = createSession(host, { logger: createLoggerWithInMemoryLogs(host) });
const session = createSession(host, {
logger: createLoggerWithInMemoryLogs(host),
});
openFilesForSession([aTs, bTs], session);

const requestLocation: ts.server.protocol.FileLocationRequestArgs = {
Expand All @@ -51,7 +53,17 @@ describe("unittests:: tsserver:: completions", () => {
command: ts.server.protocol.CommandTypes.CompletionDetails,
arguments: {
...requestLocation,
entryNames: [{ name: "foo", source: "/a", data: { exportName: "foo", fileName: "/a.ts", exportMapKey } }],
entryNames: [
{
name: "foo",
source: "/a",
data: {
exportName: "foo",
fileName: "/a.ts",
exportMapKey,
},
},
],
},
});

Expand All @@ -63,7 +75,17 @@ describe("unittests:: tsserver:: completions", () => {
command: ts.server.protocol.CommandTypes.CompletionDetailsFull,
arguments: {
...requestLocation,
entryNames: [{ name: "foo", source: "/a", data: { exportName: "foo", fileName: "/a.ts", exportMapKey } }],
entryNames: [
{
name: "foo",
source: "/a",
data: {
exportName: "foo",
fileName: "/a.ts",
exportMapKey,
},
},
],
},
});
baselineTsserverLogs("completions", "works", session);
Expand Down Expand Up @@ -198,6 +220,10 @@ export interface BrowserRouterProps {
includeInsertTextCompletions: true,
},
});
baselineTsserverLogs("completions", "works when files are included from two different drives of windows", session);
baselineTsserverLogs(
"completions",
"works when files are included from two different drives of windows",
session,
);
});
});
1 change: 1 addition & 0 deletions tests/baselines/reference/jsFileImportNoTypes.baseline
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// === Completions ===
=== /a.js ===
// import { } from './declarations.ts'
// ^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ Info seq [hh:mm:ss:mss] response:
"source": "e:/myproject/node_modules/@types/react/index",
"data": {
"exportName": "Component",
"exportMapKey": "Component|*|",
"exportMapKey": "9 * Component ",
"fileName": "e:/myproject/node_modules/@types/react/index.d.ts"
}
},
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.