vscode-objectscript icon indicating copy to clipboard operation
vscode-objectscript copied to clipboard

Document VS Code's default not to offer completions automatically when user types into snippet fields

Open gjsjohnmurray opened this issue 3 years ago • 3 comments

See https://github.com/intersystems/language-server/issues/65#issuecomment-722532927 and the pointer within it.

gjsjohnmurray avatar Nov 05 '20 18:11 gjsjohnmurray

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};

isc-solon avatar Nov 06 '20 01:11 isc-solon

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.

jstetson10 avatar Jul 08 '21 22:07 jstetson10

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

isc-solon avatar Jul 09 '21 16:07 isc-solon