added quarkus.http.root-path property to CodeLensURL#174
added quarkus.http.root-path property to CodeLensURL#174rgrunber merged 1 commit intoeclipse-lsp4mp:masterfrom
Conversation
|
At first LSP4MP should be not linked to quarkus, it means that it should not use For instance Quarkus provides After that LSP4MP get the serverPort to build the proper local base URL at https://github.com/eclipse/lsp4mp/blob/cbcc381d2b7240778b7f1422b6f8b67b97759d5a/microprofile.jdt/org.eclipse.lsp4mp.jdt.core/src/main/java/org/eclipse/lsp4mp/commons/MicroProfileJavaCodeLensParams.java#L103 You should try to mimic this strategy. At first I will remove getLocalBaseUrl and getServerPort from MicroProfileJavaCodeLensParams https://github.com/eclipse/lsp4mp/blob/cbcc381d2b7240778b7f1422b6f8b67b97759d5a/microprofile.jdt/org.eclipse.lsp4mp.jdt.core/src/main/java/org/eclipse/lsp4mp/commons/MicroProfileJavaCodeLensParams.java#L101 because it's parameters (we should not update it) and move those methods in JaxRsContext, the idea is to work with JaxRsContext and not with MicroProfileJavaCodeLensParams to build the URL: private static void collectURLCodeLenses(IJavaElement[] elements, String rootPath, Collection<CodeLens> lenses,
JaxRsContext context, IJDTUtils utils, IProgressMonitor monitor)I will add in JaxRsContext a new field with getter/setter The JaxRsContext will use this info to build the URL: public String getLocalBaseURL() {
StringBuilder localBaseURL = new StringBuilder("http://localhost:");
localBaseURL .append(getLocalServerPort()).toString();
if (rootPath != null) {
localBaseURL .append(getRootPath());
}
return localBaseURL.toString();
} |
61bb71c to
c3ed418
Compare
c3ed418 to
a650b72
Compare
baf966e to
30574e3
Compare
30574e3 to
26d02f3
Compare
|
@AlexXuChen this PR doesn't fix all issues from redhat-developer/quarkus-ls/issues/368. I re-read it and it seems According to @clochardpagan comments:
To fix this problem an idea is to provide a setting to declare a base URL for that. Or perhaps we could declare an array of baseURL to generate several Codelens URL for serveral server. @fbricon @rgrunber what do you think about that? @AlexXuChen those issues could be done in an another PRs, but please change your commit which closes the issue 368, because this PR doesn't covers all issues. |
There was a problem hiding this comment.
Could localBaseURL that's used in MicroProfileJavaCodeLensParams be removed ? I don't think it's used anywhere now that JaxRsContext took over the same functionality.
There's also extraneous whitespace throughout the files. Just need to remove them.
26d02f3 to
2cb61f4
Compare
Originally However, I do believe the original intention was to remove |
|
Yeah, there seems to be a bit of overlap between the MicroProfile params and the JaxRsContext. Maybe there's some parameters that need to reside in params for a little while before they get transfered over to the JaxRsContent but the localBaseURL stood out as the single getter in MicroProfile params wans't being called anywhere after you switched over and looked pretty much the same as the new one in JaxRsContext. |
Signed-off-by: Alexander Chen <alchen@redhat.com>
2cb61f4 to
5351d25
Compare
rgrunber
left a comment
There was a problem hiding this comment.
I've tried this out (with some modifications on quarkus-ls) and it seems to be working as expected.
Added quarkus.http.root-path property from application.properties to CodeLens URL.
Closes redhat-developer/quarkus-ls/issues/368
Signed-off-by: Alexander Chen alchen@redhat.com
*THE CHANGE:
