GH-715: Implemented the semantic highlighting support. - #746
Conversation
|
@kittaakos thanks for the PR that looks promising! I'll review as soon as I can |
|
I will shrink the size of this PR once eclipse-lsp4j/lsp4j#223 will be accepted and merged. |
|
test this please |
@kittaakos eclipse-lsp4j/lsp4j#223 has been merged. |
@kittaakos Do I need to use any particular versions of VS Code? |
Currently, VS Code does not expose a theming API. See here. You can try it out in Eclipse Theia; it already uses the forked JDT language server. |
|
Can we rename the org.eclipse.jdt.ls.core.internal.semantichighlight package to org.eclipse.jdt.ls.core.internal.highlighting? semantichighlight burns my eyes :-) |
Sure. I do the updates here, once there is a new release of lsp4j. So that I can get rid of a bunch of classes, custom target platform files and so on. The release will happen either this or next week. |
364f971 to
c8ce2b8
Compare
|
I did the followings:
|
|
@kittaakos could you extract the launcher/debugger stuff in a separate PR please, it's orthogonal to the issue and will be faster to get in |
Sure. |
720550d to
fae85af
Compare
@fbricon, I got rid of the non-highlighting related changes. |
|
Are there any updates, feedback on this PR? |
|
Would be really nice to get this merged. It works nicely with Theia now. |
fbricon
left a comment
There was a problem hiding this comment.
Except for the copyright headers to fix, I only have a few minor remarks. But that's a pretty good patch overall.
Anyways, we'll have to open a CQ for that, which may take a few days to get approved.
| <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit"> | ||
| <unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.4.0.v20180425-1137"/> | ||
| <repository location="http://download.eclipse.org/lsp4j/updates/releases/"/> | ||
| <unit id="org.eclipse.lsp4j.sdk.feature.group" version="0.5.0.v20180822-0752"/> |
There was a problem hiding this comment.
TP is pointing to 0.5.0.M1 in master
| @@ -0,0 +1,245 @@ | |||
| /******************************************************************************* | |||
| * Copyright (c) 2018 Red Hat Inc. and others. | |||
| IDocument document = JsonRpcHelpers.toDocument(unit.getBuffer()); | ||
| edit.apply(document, TextEdit.NONE); | ||
|
|
||
| // Avoid any computation iff the `SemanticHighlightingService#isEnabled` is `false`. |
There was a problem hiding this comment.
Just for completeness with the source:
"[...]In logic and related fields such as mathematics and philosophy, if and only if (shortened iff) is a biconditional logical connective between statements.[...]"
Since it was not obvious whether it is a typo or not, I apply the recommended change. Thanks for the feedback.
| @@ -27,6 +27,7 @@ | |||
| import java.util.concurrent.Executors; | |||
There was a problem hiding this comment.
lsp4j 0.5.0 compat changes already available in master
There was a problem hiding this comment.
I do not understand this. Wha do you mean by this comment?
There was a problem hiding this comment.
Just that those changes aren't necessary anymore, as they ve already been taken care of. Just needs to rebase against master
| @@ -0,0 +1,72 @@ | |||
| /******************************************************************************* | |||
| * Copyright (c) 2018 TypeFox and others. | |||
There was a problem hiding this comment.
if file was copied from jdt, then it should retain the original copyright from IBM.
Add Contributors section:
*
* Contributors:
* IBM Corporation - initial API and implementation
* TypeFox - port to jdt.ls| infos.put(line, new SemanticHighlightingTokens.Token(character, length, scope)); | ||
| } | ||
| //@formatter:off | ||
| return FluentIterable.from(infos.asMap().entrySet()) |
| import org.eclipse.lsp4j.VersionedTextDocumentIdentifier; | ||
| import org.eclipse.lsp4j.util.SemanticHighlightingTokens; | ||
|
|
||
| import com.google.common.base.Preconditions; |
| @@ -0,0 +1,117 @@ | |||
| /******************************************************************************* | |||
| * Copyright (c) 2018 TypeFox and others. | |||
There was a problem hiding this comment.
if file was copied from jdt, then it should retain the original copyright from IBM.
Add Contributors section:
*
* Contributors:
* IBM Corporation - initial API and implementation
* TypeFox - port to jdt.ls|
|
||
| public boolean isSemanticHighlightingSupported() { | ||
| TextDocumentClientCapabilities textDocument = capabilities.getTextDocument(); | ||
| if (textDocument == null) { |
|
Thank you for the review, @fbricon. I have updated this PR based on your feedback. |
|
@jjohnstn is everything available in jdt.core now so that we can drop the copied files? |
Closes eclipse-jdtls#715. Signed-off-by: Akos Kitta <kittaakos@typefox.io>
|
test this please |
Still in review. https://git.eclipse.org/r/#/c/129807/ |
This PR contains the following change:
0.4.0to0.5.0.Static:

Member vs. Parameter:

Deprecated:

Auto (un)boxing:

Closes #715.
Signed-off-by: Akos Kitta kittaakos@typefox.io