-
Notifications
You must be signed in to change notification settings - Fork 411
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
evaluate generic server-side snippets in resolve stage #1857
Conversation
It's implemented based on LSP specs above. After "completion", Below is a sample response for public class App
{
public static void main( String[] args )
{
foreach^
}
}
|
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.
Works for me. I can confirm the resolution is now done in resolveCompletionItem
. Just some minor changes to make.
...dt.ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/SnippetCompletionProposal.java
Show resolved
Hide resolved
...dt.ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/SnippetCompletionProposal.java
Show resolved
Hide resolved
...dt.ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/SnippetCompletionProposal.java
Outdated
Show resolved
Hide resolved
...dt.ls.core/src/org/eclipse/jdt/ls/core/internal/contentassist/SnippetCompletionProposal.java
Show resolved
Hide resolved
Signed-off-by: Yan Zhang <[email protected]>
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.
Change looks good to me.
See #1838 , perf issue about evaluating generic snippets.
There are two groups of Snippets:
Currently at
completion
stage, we evaluate template patterns in given context to provideinsertText
anddocumentation
. Atresolve
stage we do nothing.Evaluation is relatively expensive. This PR does below things:
TextEdit
anddocumentation
at resolve stage. IninsertText
, placeholders are directly from template patterns.data
field as they are not processed in at resolve stage.