-
Notifications
You must be signed in to change notification settings - Fork 15
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
Filter for Java (server) snippet #265
Comments
@rzgry here the idea that I have in my mind to manage filter for snippet. Takes a sample with Metrics snippet: The idea is to write a context like this: "context": {
"scope": ["method", "field", "parameter", "annotation_type"],
"dependency": "microprofile-metrics-api"
} in other words: "@Metric": {
"prefix": [
"@Metric"
],
"body": [
"@Metric(",
"\tname = \"${1:name}\",",
"\tdescription = \"${2:description}\"",
")"
],
"description": "An annotation that contains the metadata information when requesting a metric to be injected or produced. This annotation can be used on fields of type Meter, Timer, Counter, and Histogram. For Gauge, the @Metric annotation can only be used on producer methods/fields.",
"context": {
"scope": ["method", "field", "parameter", "annotation_type"],
"dependency": "microprofile-metrics-api"
}
} The context means
@rzgry do you like this idea? Please give me feedback. If you like it, could you create a PR with the context for mp-* snippets please. Thanks! |
Looks good to me. I can make a PR to add context to the existing MicroProfile snippets. |
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Part of redhat-developer#265 Signed-off-by: Ryan Zegray <ryan.zegray@gmail.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Part of redhat-developer#265 Signed-off-by: Ryan Zegray <ryan.zegray@gmail.com>
Part of #265 Signed-off-by: Ryan Zegray <ryan.zegray@gmail.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes redhat-developer#265 Signed-off-by: azerr <azerr@redhat.com>
Fixes #265 Signed-off-by: azerr <azerr@redhat.com>
Once #251 will be merged, we need to improve Java snippets completion:
filter Java snippets
according to some conditions like:project has some dependency
(ex : Open API @operation snippet should be shown only if the project have the openapi dependency)where completion has been triggered
(ex : Open API @operation snippet should be shown only if completion is triggered before a class, etc)To do that, we must delegate those 2 features on JDT LS side. We could have a
microprofile/java/completion/resolveCompletionContext
JDT LS command which:The idea is when completion is opened and snippets requires condition and compute of context , it should call one time the resolveCompletionContext which should resolve condition and compute of context.
The text was updated successfully, but these errors were encountered: