Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Mar 19, 2024
1 parent 8108adf commit 1a4a313
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions packages/language-service/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,47 +58,47 @@ export function createVueServicePlugins(
return created;
},
};
getTsPluginClient = context => {
if (!context.language.typescript) {
return;
}
const requestContext = {
typescript: ts,
files: context.language.files,
languageService: context.inject<(import('volar-service-typescript').Provide), 'typescript/languageService'>('typescript/languageService'),
vueOptions: getVueOptions(context.env),
isTsPlugin: false,
};
return {
async collectExtractProps(...args) {
return await collectExtractProps.apply(requestContext, args);
},
async getPropertiesAtLocation(...args) {
return await getPropertiesAtLocation.apply(requestContext, args);
},
async getComponentEvents(...args) {
return await getComponentEvents.apply(requestContext, args);
},
async getComponentNames(...args) {
return await getComponentNames.apply(requestContext, args);
},
async getComponentProps(...args) {
return await getComponentProps.apply(requestContext, args);
},
async getElementAttrs(...args) {
return await getElementAttrs.apply(requestContext, args);
},
async getTemplateContextProps(...args) {
return await getTemplateContextProps.apply(requestContext, args);
},
async getQuickInfoAtPosition(...args) {
return await getQuickInfoAtPosition.apply(requestContext, args);
},
};
};
break;
}
}
getTsPluginClient = context => {
if (!context.language.typescript) {
return;
}
const requestContext = {
typescript: ts,
files: context.language.files,
languageService: context.inject<(import('volar-service-typescript').Provide), 'typescript/languageService'>('typescript/languageService'),
vueOptions: getVueOptions(context.env),
isTsPlugin: false,
};
return {
async collectExtractProps(...args) {
return await collectExtractProps.apply(requestContext, args);
},
async getPropertiesAtLocation(...args) {
return await getPropertiesAtLocation.apply(requestContext, args);
},
async getComponentEvents(...args) {
return await getComponentEvents.apply(requestContext, args);
},
async getComponentNames(...args) {
return await getComponentNames.apply(requestContext, args);
},
async getComponentProps(...args) {
return await getComponentProps.apply(requestContext, args);
},
async getElementAttrs(...args) {
return await getElementAttrs.apply(requestContext, args);
},
async getTemplateContextProps(...args) {
return await getTemplateContextProps.apply(requestContext, args);
},
async getQuickInfoAtPosition(...args) {
return await getQuickInfoAtPosition.apply(requestContext, args);
},
};
};
}
else {
plugins.push(createTypeScriptSyntacticServicePlugin(ts));
Expand Down

0 comments on commit 1a4a313

Please sign in to comment.