Skip to content

Commit 5697844

Browse files
authored
feat(vue-options-api): Add a setting to remove local component definitions (#117)
1 parent 14e8b38 commit 5697844

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/configurationType.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,12 @@ export type Configuration = {
321321
* @default true
322322
*/
323323
miscDefinitionImprovement: boolean
324+
/**
325+
* Removes definiion suggestion from vue `components` options.
326+
* Might be useful with [Vetur-extended goToDefinition](https://github.com/zardoy/vetur-extended/blob/main/src/gotoDefinition.ts) for components as a replacement for (https://github.com/vuejs/language-tools/issues/1245)
327+
* @default false
328+
*/
329+
removeVueComponentsOptionDefinition: boolean
324330
/**
325331
* Experimental, feedback welcome
326332
* If default, namespace import or import path click resolves to .d.ts file, try to resolve .js file instead with the same name

typescript/src/definitions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ export default (proxy: ts.LanguageService, languageService: ts.LanguageService,
141141
return true
142142
})
143143
}
144+
if (c('removeVueComponentsOptionDefinition') && prior.definitions) {
145+
prior.definitions = prior.definitions.filter(definition => definition.containerName !== '__VLS_componentsOption')
146+
}
144147

145148
if (c('removeModuleFileDefinitions')) {
146149
prior.definitions = prior.definitions?.filter(def => {

0 commit comments

Comments
 (0)