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

Add support to VS Code style snippets in code completion #6339

Merged
merged 7 commits into from
Oct 5, 2017

Conversation

tsmaeder
Copy link
Contributor

@tsmaeder tsmaeder commented Sep 19, 2017

What does this PR do?

Adds support for VS Code-style snippets in code completion.
See https://github.com/Microsoft/vscode/blob/0ebd01213a65231f0af8187acaf264243629e4dc/src/vs/editor/contrib/snippet/browser/snippet.md

What issues does this PR fix or reference?

#5365

Changelog

Add support for snippets in code completion.

Release Notes

This version introduces new capabilities in the support of Language Server Protocol in Eclipse Che, we are now supporting the VS Code-style snippets in code completion.
Code snippets are small templates of reusable code that can make easier and faster to insert code in a file. Templates are particularly efficient for loop blocks, if-else blocks but not only depending the language you are using. When using the autocompletion ctrl+space you'll have the list of snippets suggested.

The snippets syntax support:

  • Tabstops: to move the editor's cursor inside a snippet.
  • Variables: to insert value of a variable.
  • Placeholders: to easily insert placeholder text which will be selected to be changed (placeholders are tabstops with values).
  • Choices: to replace a placeholder by a value from a given enumeration.

[Insert Animated gif for "choices"]

You can refer to the following documentation to learn more. We are currently supporting the VS-Code style syntax description.

Docs PR

eclipse-che/che-docs#292

Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
@codenvy-ci
Copy link

Can one of the admins verify this patch?

1 similar comment
@codenvy-ci
Copy link

Can one of the admins verify this patch?

@evidolob
Copy link
Contributor

ci-build

@codenvy-ci
Copy link

@slemeur slemeur added the kind/enhancement A feature request - must adhere to the feature request template. label Sep 25, 2017
@slemeur
Copy link
Contributor

slemeur commented Oct 1, 2017

@tsmaeder : I've edited the RN. Would it be possible to attach an animated gif showing the code snippet with a "choice". I think it would nicely illustrate the new capability.

Also, are we currently already integrated LS which are using snippets?

@benoitf benoitf added the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Oct 2, 2017
@slemeur slemeur changed the title 5365 codeassist snippets Add support to VS Code style snippets in code completion Oct 4, 2017
@tsmaeder
Copy link
Contributor Author

tsmaeder commented Oct 5, 2017

Here's the demo: Demo
The only one I'm aware of is the json LS,

@tsmaeder tsmaeder merged commit af0376d into eclipse-che:master Oct 5, 2017
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Oct 5, 2017
@benoitf benoitf added this to the 5.19.0 milestone Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants