-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat: Improve completion with snippet support (#786) #1006
Conversation
fe87ae7
to
14f63ed
Compare
...n/java/com/redhat/devtools/intellij/lsp4ij/operations/completion/SnippetTemplateFactory.java
Show resolved
Hide resolved
|
||
private final List<String> existingVariables; | ||
|
||
public SnippetTemplateLoader(Template template, Function<String, String> variableResolvers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variableResolver
...in/java/com/redhat/devtools/intellij/lsp4ij/operations/completion/SnippetTemplateLoader.java
Show resolved
Hide resolved
src/main/java/com/redhat/devtools/intellij/lsp4ij/operations/completion/snippet/Location.java
Show resolved
Hide resolved
...ava/com/redhat/devtools/intellij/lsp4ij/operations/completion/snippet/LspSnippetHandler.java
Show resolved
Hide resolved
...om/redhat/devtools/intellij/lsp4ij/operations/completion/snippet/handler/LspSnippetNode.java
Show resolved
Hide resolved
...m/redhat/devtools/intellij/lsp4ij/operations/completion/snippet/handler/PlaceholderNode.java
Show resolved
Hide resolved
...a/com/redhat/devtools/intellij/lsp4ij/operations/completion/snippet/handler/TabstopNode.java
Show resolved
Hide resolved
...java/com/redhat/devtools/intellij/lsp4ij/operations/completion/snippet/handler/TextNode.java
Show resolved
Hide resolved
.../com/redhat/devtools/intellij/lsp4ij/operations/completion/snippet/handler/VariableNode.java
Show resolved
Hide resolved
aff975d
to
d1ac9fb
Compare
* @param variableResolvers the LSP variable resolvers (ex to resolve ${TM_SELECTED_TEXT}). | ||
* @return an Intellij Template instanced loaded from the given LSP snippet content. | ||
*/ | ||
public static @NotNull Template createTemplate(@NotNull String snippetContent, @NotNull Project project, @NotNull Function<String, String> variableResolvers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variableResolver
* | ||
* @param snippetContent the LSP snippet content | ||
* @param project the project. | ||
* @param variableResolvers the LSP variable resolvers (ex to resolve ${TM_SELECTED_TEXT}). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variableResolver
*/ | ||
public SnippetTemplateLoader(Template template, Function<String, String> variableResolver) { | ||
this.template = template; | ||
this.variableResolvers = variableResolver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variableResolver
Fixes redhat-developer#786 Signed-off-by: azerr <[email protected]>
d1ac9fb
to
58d3ff3
Compare
Thanks @angelozerr! |
Kudos, SonarCloud Quality Gate passed! |
feat: Improve completion with snippet support (#786)
Fixes #786
Fixes #975