Skip to content

Commit 55588f0

Browse files
committed
refactor(typescript-plugin): optimize Vue command handler registration
1 parent 96b621a commit 55588f0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/typescript-plugin/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,10 @@ export = createLanguageServicePlugin(
7676
projectService.logger.info('Vue: there is no addProtocolHandler method.');
7777
return;
7878
}
79-
if ((session as any).vueCommandsAdded) {
79+
if ((session as any).handlers.has('_vue:projectInfo')) {
8080
return;
8181
}
8282

83-
(session as any).vueCommandsAdded = true;
84-
8583
session.addProtocolHandler('_vue:projectInfo', ({ arguments: args }) => {
8684
return (session as any).handlers.get('projectInfo')?.({ arguments: args });
8785
});

0 commit comments

Comments
 (0)