feat: make tinymist.configureDefaultWordSeparator opt in (#1389)

* feat: make `tinymist.configureDefaultWordSeparator` opt in

* docs: add some comment
This commit is contained in:
Myriad-Dreamin 2025-02-24 12:20:26 +08:00 committed by GitHub
parent 3590774383
commit 99bc4ac03d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -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"

View file

@ -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]+)/;