Skip to content

Commit 047416c

Browse files
committed
fix(typescript-plugin): replace Map with FileMap for handling file name casing
1 parent d17eda8 commit 047416c

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

packages/typescript-plugin/lib/server.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Language } from '@vue/language-core';
1+
import { FileMap, Language } from '@vue/language-core';
22
import * as fs from 'node:fs';
33
import * as net from 'node:net';
44
import type * as ts from 'typescript';
@@ -68,20 +68,14 @@ export async function startNamedPipeServer(
6868
getFileId: (fileName: string) => fileName,
6969
};
7070
const dataChunks: Buffer[] = [];
71-
const currentData = new Map<
72-
string,
73-
[
74-
componentNames: string[],
75-
Record<
76-
string,
77-
{
78-
name: string;
79-
required?: true;
80-
commentMarkdown?: string;
81-
}[]
82-
>,
83-
]
84-
>();
71+
const currentData = new FileMap<[
72+
componentNames: string[],
73+
Record<string, {
74+
name: string;
75+
required?: true;
76+
commentMarkdown?: string;
77+
}[]>,
78+
]>(false);
8579
const allConnections = new Set<net.Socket>();
8680
const pendingRequests = new Set<number>();
8781
const server = net.createServer(connection => {

packages/typescript-plugin/lib/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { FileMap } from '@vue/language-core';
12
import { camelize, capitalize } from '@vue/shared';
23
import * as fs from 'node:fs';
34
import * as net from 'node:net';
@@ -30,14 +31,13 @@ class NamedPipeServer {
3031
connecting = false;
3132
projectInfo?: ProjectInfo;
3233
containsFileCache = new Map<string, Promise<boolean | undefined | null>>();
33-
componentNamesAndProps = new Map<
34-
string,
34+
componentNamesAndProps = new FileMap<
3535
Record<string, null | {
3636
name: string;
3737
required?: true;
3838
commentMarkdown?: string;
3939
}[]>
40-
>();
40+
>(false);
4141

4242
constructor(kind: ts.server.ProjectKind, id: number) {
4343
this.path = getServerPath(kind, id);

0 commit comments

Comments
 (0)