Skip to content

Commit

Permalink
chore(typescript-plugin): avoid unneeded logs for containsFile request
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Mar 21, 2024
1 parent 3ee5c55 commit ef908e2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/typescript-plugin/lib/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export function startNamedPipeServer(
const request: Request = JSON.parse(text);
const fileName = request.args[0];
const project = getProject(fileName);
if (project) {
if (request.type === 'containsFile') {
connection.write(JSON.stringify(!!project));
}
else if (project) {
const requestContext = {
typescript: ts,
languageService: project.info.languageService,
Expand All @@ -52,11 +55,7 @@ export function startNamedPipeServer(
isTsPlugin: true,
getFileId: (fileName: string) => fileName,
};
if (request.type === 'containsFile') {
const result = !!getProject(fileName);
connection.write(JSON.stringify(result ?? null));
}
else if (request.type === 'collectExtractProps') {
if (request.type === 'collectExtractProps') {
const result = collectExtractProps.apply(requestContext, request.args as any);
connection.write(JSON.stringify(result ?? null));
}
Expand Down

0 comments on commit ef908e2

Please sign in to comment.