From 99bc4ac03d8aa3fc63378afd63a2e92201a2ca41 Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com> Date: Mon, 24 Feb 2025 12:20:26 +0800 Subject: [PATCH] feat: make `tinymist.configureDefaultWordSeparator` opt in (#1389) * feat: make `tinymist.configureDefaultWordSeparator` opt in * docs: add some comment --- editors/vscode/package.json | 4 +--- editors/vscode/src/lsp.ts | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/editors/vscode/package.json b/editors/vscode/package.json index 799f96b74..c0702cd8f 100644 --- a/editors/vscode/package.json +++ b/editors/vscode/package.json @@ -340,7 +340,7 @@ "title": "Configure default word separators", "description": "Whether to configure default word separators on startup", "type": "string", - "default": "enable", + "default": "disable", "enum": [ "enable", "disable" @@ -688,14 +688,12 @@ "configurationDefaults": { "[typst]": { "editor.wordWrap": "on", - "editor.wordSeparators": "`~!@#$%^&*()=+[{]}\\|;:'\",.<>/?", "editor.semanticHighlighting.enabled": true, "editor.tabSize": 2, "editor.inlayHints.enabled": "off" }, "[typst-code]": { "editor.wordWrap": "on", - "editor.wordSeparators": "`~!@#$%^&*()=+[{]}\\|;:'\",.<>/?", "editor.semanticHighlighting.enabled": true, "editor.tabSize": 2, "editor.inlayHints.enabled": "off" diff --git a/editors/vscode/src/lsp.ts b/editors/vscode/src/lsp.ts index 356668f6e..cadbf7f0f 100644 --- a/editors/vscode/src/lsp.ts +++ b/editors/vscode/src/lsp.ts @@ -542,6 +542,10 @@ export class LanguageState { ]; } + // This is different from `wordSeparators`. We need to document difference here. + // todo: document difference here. + // + // https://code.visualstudio.com/api/language-extensions/language-configuration-guide#word-pattern const wordPattern = /(-?\d*.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.<\>\/\?\s]+)/;