diff --git a/packages/typescript-plugin/lib/server.ts b/packages/typescript-plugin/lib/server.ts index 0234ca0af9..d8fc0983b1 100644 --- a/packages/typescript-plugin/lib/server.ts +++ b/packages/typescript-plugin/lib/server.ts @@ -44,7 +44,7 @@ export function startNamedPipeServer( const text = data.toString(); const request: Request = JSON.parse(text); const fileName = request.args[0]; - const project = getProject(fileName); + const project = getProject(ts.server.toNormalizedPath(fileName)); if (request.type === 'projectInfoForFile') { connection.write( JSON.stringify( @@ -154,9 +154,9 @@ export const projects = new Map(); -function getProject(fileName: string) { +function getProject(filename: ts.server.NormalizedPath) { for (const [project, data] of projects) { - if (project.containsFile(fileName as ts.server.NormalizedPath)) { + if (project.containsFile(filename)) { return data; } }