You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SnippetString doesn't have builder-method for Choice #43643
In the snippet docs there's syntax for adding choices for placeholders:
Choice
Placeholders can have choices as values. The syntax is a comma separated enumeration of values, enclosed with the pipe-character, for example ${1|one,two,three|}. When the snippet is inserted and the placeholder selected, choices will prompt the user to pick one of the values.
Currently the SnippetString class has methods for appendPlaceholder, appendVariable, etc. but there isn't an option for choices. We can build these manually, but it'd be better if we could stick to a nice API.
Hello,is this issue solved ? I am new on this repo and looking for good first issues to solve, this issue looks good for my purpose. Can anyone please guide me about solving this please? Johannes Rieken (@jrieken)Danny Tuppeny (@DanTup)
Activity
DanTup commentedon Feb 14, 2018
Also seems like the escape method is private, making it more difficult to do this manually without duplicating the implementation.
DanTup commentedon Feb 14, 2018
Actually,
appendTextis escaped so it seems like we can't do this at all without building the whole string ourselves..jrieken commentedon Feb 26, 2018
Well, you can do
new SnippetString().appendXYZ().value += '${1|my,choice|}'[-]SnippetString doesn't support choices[/-][+]SnippetString doesn't have builder-method for Choice[/+]DanTup commentedon Feb 26, 2018
Johannes Rieken (@jrieken) That seems to have worked, thanks! I did have to copy your escape function and add
,to it though!sksaifuddin commentedon Oct 30, 2019
Hello,is this issue solved ? I am new on this repo and looking for good first issues to solve, this issue looks good for my purpose. Can anyone please guide me about solving this please? Johannes Rieken (@jrieken) Danny Tuppeny (@DanTup)
jrieken commentedon Oct 30, 2019
This issue would be closed if it's solved. So, "yes" it up for a grab. This is the code pointer entry point:
vscode/src/vs/workbench/api/common/extHostTypes.ts
Line 687 in e5a97bd