vscode-objectscript
vscode-objectscript copied to clipboard
Document VS Code's default not to offer completions automatically when user types into snippet fields
See https://github.com/intersystems/language-server/issues/65#issuecomment-722532927 and the pointer within it.
The ${2:%String} syntax in a snippet obviously provides a default for the placeholder $2. In this case, the default of %String makes it seem like completions should be offered (which is not possible). My question is: should snippets avoid providing defaults that could mislead developers in this way? For example, change the "property" snippet from this:
Property $1 As ${2:%String};
to this (the default is the name of what goes there, and the developer knows to delete it, backspace, and type space to get suggestions):
Property $1 As ${2:datatype};
As far as I know, there is currently no documentation on snippets at all. So the issue here is a bit bigger than the title suggests.
I don't think that snippets need much doc. They should be self-explanatory. If people agree with my comment above, we could:
- change any current snippet that makes it look like completion is possible (so change %String to datatype when it's a placeholder
- add a README to the snippets folder that provides a description of do's/don'ts when writing snippets