SpyglassMC / Spyglass

Development tools for vanilla Minecraft: Java Edition data pack developers.
https://spyglassmc.com
MIT License
295 stars 31 forks source link

Completing NBT values inserts a duplicate end quote #1280

Closed misode closed 2 months ago

misode commented 2 months ago

Example:

execute if predicate {condition:""}

When autocompleting inside the quotes, it results in this:

execute if predicate {condition:"all_of""}
misode commented 2 months ago

Disabling the insertReplaceSupport capability fixes this (but at what cost?)

Also strange that this works fine in JSON files, which leads me to believe that vscode decides to not use insert mode for JSON strings.

SPGoding commented 2 months ago

vscode decides to not use insert mode for JSON strings

This is indeed the case, as the built-in JSON extension contributes a default configuration to use replace mode instead of insert mode

https://github.com/microsoft/vscode/blob/35ac2d01a6b7ae2e0141377a6a924f050aa65237/extensions/json-language-features/package.json#L135

I think we can similarly add a default configuration in packages/vscode-extension/package.json to use replace mode for mcfunction as well? I can't tell why anyone would prefer the insert mode tbh.