Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt SnippetString API #25

Closed
jrieken opened this issue Nov 22, 2016 · 7 comments
Closed

Adopt SnippetString API #25

jrieken opened this issue Nov 22, 2016 · 7 comments
Assignees

Comments

@jrieken
Copy link

jrieken commented Nov 22, 2016

With the December release VS Code will have real API to define a CompletionItem that is inserted as snippet, for details see microsoft/vscode#3210.

In short, we now support a subset of the more common TextMate syntax: $1, $2 etc define tabstops, ${1:value} and ${2:this is${3:nested}} placeholders, and $0 is for the final tabstop.

The API for this is contained in a new type SnippetString. It can be used as the insertText of a CompletionItem.

During a transition phase we will still support the internal, unspecified snippet syntax your extension is using but eventually remove it (roughly 2 or 3 milestones from now).

The language server protocol supports the SnippetString in its next-branch - see microsoft/vscode#15577 (comment)

@EisenbergEffect
Copy link
Contributor

@jrieken Thanks for the heads up. We really appreciate you reaching out to us! Also, whenever you are at Microsoft's Redmond campus in the future, ping me. I'd love to meet and talk with you about your work on VS Code.

@EisenbergEffect
Copy link
Contributor

@eriklieben We should definitely move on this when we can to stay ahead of these changes.

@eriklieben
Copy link
Contributor

Yes! The above is incredible! Thanks @jrieken!

When the old autocompleted stopped working in 1.6.0, I tried to push TextMate snippet string into the insertText param :-) And discovered it didn't work that way, then I started looking at the custom implementation of the HTML language server. Was looking at how I could refactor that code to be easier to extend and basically, accept TextMate snippet strings. So I am very very happy with this :-)

Will try to get this into the extension during the weekend, my evenings are a bit booked this week. If nothing changes in my schedule, then we will have this ready to release at 1 Dec together with the 1.8.0 release of vscode.

@eriklieben
Copy link
Contributor

@jrieken do you maybe know how to get around this issue/ did you also experience this? / how did you solve it :-)

Repository:\vscode-extension [snippetString ≡]> npm install vscode-languageserver-types@next -D
[email protected] Repository:\vscode-extension
`-- [email protected] invalid

On trying to install the vnext package of the types I get invalid on each of the 3.0.1 packages, while I am using Typescript 2.0.3.

@jrieken
Copy link
Author

jrieken commented Dec 2, 2016

@aeschli or @dbaeumer will know

@dbaeumer
Copy link

@eriklieben just test this and it works for me and installs [email protected]. Are you still seeing the issue.

@eriklieben
Copy link
Contributor

@dbaeumer created a new branch and installation works now :-) Thanks!

@jrieken new version of aurelia extension is on it's way with SnippetString, sorry for the long delay.

Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants