-
Notifications
You must be signed in to change notification settings - Fork 28
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
added quarkus.http.root-path property to CodeLensURL #174
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 Line 103 in cbcc381
You should try to mimic this strategy. At first I will remove getLocalBaseUrl and getServerPort from MicroProfileJavaCodeLensParams Line 101 in cbcc381
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
...rg.eclipse.lsp4mp.jdt.core/src/main/java/org/eclipse/lsp4mp/jdt/core/jaxrs/JaxRsContext.java
Show resolved
Hide resolved
...rg.eclipse.lsp4mp.jdt.core/src/main/java/org/eclipse/lsp4mp/jdt/core/jaxrs/JaxRsContext.java
Show resolved
Hide resolved
c3ed418
to
a650b72
Compare
....core/src/main/java/org/eclipse/lsp4mp/jdt/internal/jaxrs/java/JaxRsCodeLensParticipant.java
Outdated
Show resolved
Hide resolved
....core/src/main/java/org/eclipse/lsp4mp/jdt/internal/jaxrs/java/JaxRsCodeLensParticipant.java
Outdated
Show resolved
Hide resolved
....core/src/main/java/org/eclipse/lsp4mp/jdt/internal/jaxrs/java/JaxRsCodeLensParticipant.java
Outdated
Show resolved
Hide resolved
....core/src/main/java/org/eclipse/lsp4mp/jdt/internal/jaxrs/java/JaxRsCodeLensParticipant.java
Outdated
Show resolved
Hide resolved
....core/src/main/java/org/eclipse/lsp4mp/jdt/internal/jaxrs/java/JaxRsCodeLensParticipant.java
Outdated
Show resolved
Hide resolved
.../org.eclipse.lsp4mp.jdt.core/src/main/java/org/eclipse/lsp4mp/jdt/core/jaxrs/JaxRsUtils.java
Outdated
Show resolved
Hide resolved
baf966e
to
30574e3
Compare
....core/src/main/java/org/eclipse/lsp4mp/jdt/internal/jaxrs/java/JaxRsCodeLensParticipant.java
Outdated
Show resolved
Hide resolved
30574e3
to
26d02f3
Compare
...rg.eclipse.lsp4mp.jdt.core/src/main/java/org/eclipse/lsp4mp/jdt/core/jaxrs/JaxRsContext.java
Outdated
Show resolved
Hide resolved
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.
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: