forked from eclipse-lsp4mp/lsp4mp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use template to determine jakarta namespace in snippets
- Use `${jakarta}` to point to either `javax` or `jakarta`, depending on which is available, and prefering `jakarta` - Rename `jaxrc` to `rest_class` and `jaxrm` to `rest_get` Closes eclipse-lsp4mp#320, closes eclipse-lsp4mp#229 Signed-off-by: David Thompson <[email protected]>
- Loading branch information
Showing
7 changed files
with
98 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
...ls/org.eclipse.lsp4mp.ls/src/main/resources/org/eclipse/lsp4mp/snippets/jakarta-rest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"New REST resource class": { | ||
"prefix": "rest_class", | ||
"body": [ | ||
"package ${1:packagename};", | ||
"", | ||
"import ${jakarta}.ws.rs.GET;", | ||
"import ${jakarta}.ws.rs.Path;", | ||
"import ${jakarta}.ws.rs.Produces;", | ||
"import ${jakarta}.ws.rs.core.MediaType;", | ||
"", | ||
"@Path(\"${2:/path}\")", | ||
"public class ${TM_FILENAME_BASE} {", | ||
"", | ||
"\t@GET", | ||
"\t@Produces(MediaType.TEXT_PLAIN)", | ||
"\tpublic String ${3:methodname}() {", | ||
"\t\treturn \"hello\";", | ||
"\t}", | ||
"}" | ||
], | ||
"description": "REST resource class", | ||
"context": { | ||
"type": [ | ||
"javax.ws.rs.GET", | ||
"jakarta.ws.rs.GET" | ||
] | ||
} | ||
}, | ||
"New REST resource GET method": { | ||
"prefix": "rest_get", | ||
"body": [ | ||
"@GET", | ||
"@Produces(MediaType.TEXT_PLAIN)", | ||
"public String ${1:methodname}() {", | ||
"\treturn \"hello\";", | ||
"}" | ||
], | ||
"description": "REST resource GET method", | ||
"context": { | ||
"type": [ | ||
"javax.ws.rs.GET", | ||
"jakarta.ws.rs.GET" | ||
] | ||
} | ||
} | ||
} |
41 changes: 0 additions & 41 deletions
41
...ofile.ls/org.eclipse.lsp4mp.ls/src/main/resources/org/eclipse/lsp4mp/snippets/jax-rs.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters