forked from eclipse/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 jakarta imports in snippets when possible
If the jakarta versions of the javax classes referenced in the current snippets are on the classpath, hide the old snippet and display a new snippet that imports the jakarta classes instead. Closes eclipse#229, closes eclipse#320 Signed-off-by: David Thompson <[email protected]>
- Loading branch information
Showing
8 changed files
with
261 additions
and
53 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
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
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
82 changes: 82 additions & 0 deletions
82
...profile.ls/org.eclipse.lsp4mp.ls/src/main/resources/org/eclipse/lsp4mp/snippets/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,82 @@ | ||
{ | ||
"JAX-RS - new resource class": { | ||
"prefix": "jaxrc", | ||
"body": [ | ||
"package ${1:packagename};", | ||
"", | ||
"import javax.ws.rs.GET;", | ||
"import javax.ws.rs.Path;", | ||
"import javax.ws.rs.Produces;", | ||
"import javax.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": "JAX-RS REST resource class", | ||
"context": { | ||
"type": "javax.ws.rs.GET", | ||
"exclusionType": "jakarta.ws.rs.GET" | ||
} | ||
}, | ||
"Jakarta REST - new 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": "Jakarta REST resource class", | ||
"context": { | ||
"type": "jakarta.ws.rs.GET" | ||
} | ||
}, | ||
"JAX-RS - new GET resource method": { | ||
"prefix": "jaxrm", | ||
"body": [ | ||
"@GET", | ||
"@Produces(MediaType.TEXT_PLAIN)", | ||
"public String ${1:methodname}() {", | ||
"\treturn \"hello\";", | ||
"}" | ||
], | ||
"description": "JAX-RS REST resource method", | ||
"context": { | ||
"type": "javax.ws.rs.GET", | ||
"exclusionType": "jakarta.ws.rs.GET" | ||
} | ||
}, | ||
"Jakarta REST - new GET resource method": { | ||
"prefix": "rest_get", | ||
"body": [ | ||
"@GET", | ||
"@Produces(MediaType.TEXT_PLAIN)", | ||
"public String ${1:methodname}() {", | ||
"\treturn \"hello\";", | ||
"}" | ||
], | ||
"description": "Jakarta REST GET resource method", | ||
"context": { | ||
"type": "jakarta.ws.rs.GET" | ||
} | ||
} | ||
} |
Oops, something went wrong.