Skip to content

Commit 81f60fc

Browse files
committed
chore(typescript-plugin): normalize path when search project
1 parent 0bbdb66 commit 81f60fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/typescript-plugin/lib/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function startNamedPipeServer(
4444
const text = data.toString();
4545
const request: Request = JSON.parse(text);
4646
const fileName = request.args[0];
47-
const project = getProject(fileName);
47+
const project = getProject(ts.server.toNormalizedPath(fileName));
4848
if (request.type === 'projectInfoForFile') {
4949
connection.write(
5050
JSON.stringify(
@@ -154,9 +154,9 @@ export const projects = new Map<ts.server.Project, {
154154
vueOptions: VueCompilerOptions;
155155
}>();
156156

157-
function getProject(fileName: string) {
157+
function getProject(filename: ts.server.NormalizedPath) {
158158
for (const [project, data] of projects) {
159-
if (project.containsFile(fileName as ts.server.NormalizedPath)) {
159+
if (project.containsFile(filename)) {
160160
return data;
161161
}
162162
}

0 commit comments

Comments
 (0)