Skip to content

Commit

Permalink
feat: enabled references codeLens for slots when use script setup
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Jun 5, 2022
1 parent 29a9d56 commit ea304fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vue-code-gen/src/generators/template.ts
Expand Up @@ -61,6 +61,7 @@ export function generate(
vueVersion: number,
experimentalRuntimeMode: 'runtime-dom' | 'runtime-uni-app' | undefined,
allowTypeNarrowingInEventExpressions: boolean,
hasScriptSetup: boolean,
cssScopedClasses: string[] = [],
htmlToTemplate: (htmlStart: number, htmlEnd: number) => { start: number, end: number; } | undefined,
searchTexts: {
Expand Down Expand Up @@ -275,7 +276,10 @@ export function generate(
SourceMaps.Mode.Expand,
{
vueTag: 'template',
capabilities: capabilitiesSet.slotNameExport,
capabilities: {
...capabilitiesSet.slotNameExport,
referencesCodeLens: hasScriptSetup,
},
},
);
tsCodeGen.addText(`: typeof ${slot.varName},\n`);
Expand Down
1 change: 1 addition & 0 deletions packages/vue-typescript/src/use/useSfcTemplateScript.ts
Expand Up @@ -92,6 +92,7 @@ export function useSfcTemplateScript(
compilerOptions.experimentalCompatMode ?? 3,
compilerOptions.experimentalRuntimeMode,
!!compilerOptions.experimentalAllowTypeNarrowingInInlineHandlers,
!!scriptSetup.value,
Object.values(cssScopedClasses.value).map(map => Object.keys(map)).flat(),
templateData.value.htmlToTemplate,
{
Expand Down

0 comments on commit ea304fe

Please sign in to comment.