From 1cf8d8878e39952da3f131ee25194740c0bd5672 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Thu, 7 Nov 2024 09:09:52 -0500 Subject: [PATCH] fix(vscode): let `linkedEditing` work when tag name contains `.` --- packages/language-server/src/plugins/html/HTMLPlugin.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/language-server/src/plugins/html/HTMLPlugin.ts b/packages/language-server/src/plugins/html/HTMLPlugin.ts index 4e6cf47ec..ffba79d62 100644 --- a/packages/language-server/src/plugins/html/HTMLPlugin.ts +++ b/packages/language-server/src/plugins/html/HTMLPlugin.ts @@ -333,7 +333,12 @@ export class HTMLPlugin return null; } - return { ranges }; + // Note that `.` is excluded from the word pattern. This is intentional to support property access in Svelte component tags. + return { + ranges, + wordPattern: + '(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\\'\\"\\,\\<\\>\\/\\s]+)' + }; } getFoldingRanges(document: Document): FoldingRange[] {