Skip to content

Commit

Permalink
feat: prevent editing built-in stubs (#1282)
Browse files Browse the repository at this point in the history
### 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.
  • Loading branch information
lars-reimann authored Dec 15, 2024
1 parent fce761c commit d02c30a
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions packages/safe-ds-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit d02c30a

Please sign in to comment.