From 7eafbb2157bbb296475e99aefa8c78b317dc7126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E5=90=B9=E8=89=B2=E5=BE=A1=E5=AE=88?= <85992002+KazariEX@users.noreply.github.com> Date: Wed, 1 Jan 2025 00:23:22 +0800 Subject: [PATCH] fix(language-service): set code action kinds to avoid warning (#5096) --- packages/language-service/lib/plugins/vue-extract-file.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/language-service/lib/plugins/vue-extract-file.ts b/packages/language-service/lib/plugins/vue-extract-file.ts index c580096e58..fbd0c2fd62 100644 --- a/packages/language-service/lib/plugins/vue-extract-file.ts +++ b/packages/language-service/lib/plugins/vue-extract-file.ts @@ -21,13 +21,18 @@ export function create( name: 'vue-extract-file', capabilities: { codeActionProvider: { + codeActionKinds: ['refactor'], resolveProvider: true, }, }, create(context) { const tsPluginClient = getTsPluginClient?.(context); return { - provideCodeActions(document, range, _context) { + provideCodeActions(document, range, ctx) { + + if (ctx.only && !ctx.only.includes('refactor')) { + return; + } const startOffset = document.offsetAt(range.start); const endOffset = document.offsetAt(range.end);