From d02c30ae747a7d317e1263e588f83d9ffec9f98e Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Sun, 15 Dec 2024 11:35:42 +0100 Subject: [PATCH] feat: prevent editing built-in stubs (#1282) ### Summary of Changes Prevent accidental edits to built-in stubs by marking them as read-only by default. Unfortunately, if users specify their own value for the `files.readonlyInclude` setting, our default gets overwritten completely and stubs can be edited again. But it is the best we can do currently. Scoping the setting to a Safe-DS language variant did not work. Stubs were still editable again afterward. --- packages/safe-ds-vscode/package.json | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/packages/safe-ds-vscode/package.json b/packages/safe-ds-vscode/package.json index a3fd0a2bc..cef4c3973 100644 --- a/packages/safe-ds-vscode/package.json +++ b/packages/safe-ds-vscode/package.json @@ -217,26 +217,15 @@ } }, "configurationDefaults": { - "[safe-ds]": { + "[safe-ds][safe-ds-stub][safe-ds-dev]": { "editor.semanticHighlighting.enabled": true, "editor.suggest.snippetsPreventQuickSuggestions": true, "editor.wordBasedSuggestions": "off", "editor.wordSeparators": "`~!@#%^&*()-=+[]{}\\|;:'\",.<>/?»«", "files.trimTrailingWhitespace": true }, - "[safe-ds-stub]": { - "editor.semanticHighlighting.enabled": true, - "editor.suggest.snippetsPreventQuickSuggestions": true, - "editor.wordBasedSuggestions": "off", - "editor.wordSeparators": "`~!@#%^&*()-=+[]{}\\|;:'\",.<>/?»«", - "files.trimTrailingWhitespace": true - }, - "[safe-ds-dev]": { - "editor.semanticHighlighting.enabled": true, - "editor.suggest.snippetsPreventQuickSuggestions": true, - "editor.wordBasedSuggestions": "off", - "editor.wordSeparators": "`~!@#%^&*()-=+[]{}\\|;:'\",.<>/?»«", - "files.trimTrailingWhitespace": true + "files.readonlyInclude": { + "**/dist/resources/builtins/**/*.sdsstub": true } }, "commands": [