-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
GH-1845: Extended the LSP with the semantic highlighting capabilities. #2332
Conversation
protected readonly disposables: Disposable[] = []; | ||
protected readonly onDisposeEmitter = new Emitter<void>(); | ||
|
||
constructor(toDispose?: Disposable | Disposable[]) { |
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.
Nice idea! How about using varargs?
constructor(...disposables: Disposable[]) {
this.pushAll(disposables);
}
} | ||
|
||
@injectable() | ||
export class NoopSemanticHighlightingService implements SemanticHighlightingService { |
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.
How about turning SemanticHighlightingService
into a class and use it as no-op implementation to get rid of additional symbol, inteface and bindings? Similary to QuickOpenService
.
e1a1818
to
71009b7
Compare
package.json
Outdated
@@ -23,6 +23,7 @@ | |||
"chai-string": "^1.4.0", | |||
"concurrently": "^3.5.0", | |||
"electron-mocha": "~3.5.0", | |||
"esm": "^3.0.72", |
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.
TODO: remove this.
import { LanguageGrammarDefinitionContribution, TextmateRegistry } from '@theia/monaco/lib/browser/textmate'; | ||
|
||
@injectable() | ||
export class JavaTextmateContribution implements LanguageGrammarDefinitionContribution { | ||
|
||
// TODO: restore this! |
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.
TODO!!!
* - `from` can be greater than `to`. If so, the arguments will be swapped internally and you still get back `[to, to + 1, ..., from -1, from]` | ||
* - If `from` and `to` are the same, returns with a single element range: `[from]`. | ||
*/ | ||
protected rangeOf(from: number, to: number): number[] { |
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.
TODO: remove this.
|
||
} | ||
|
||
// /** |
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.
TODO: clean this up.
18450e9
to
ceb74d2
Compare
const downloadURI = packageJson['ls.download.base'] || 'https://www.eclipse.org/downloads/download.php?file='; | ||
const archiveUri = downloadURI + serverPath + '&r=1'; | ||
// TODO revert this! | ||
const serverPath = 'https://github.com/kittaakos/eclipse.jdt.ls-gh-715/raw/master/jdt-language-server-latest.tar.gz';//packageJson['ls.download.path'] || '/che/che-ls-jdt/snapshots/che-jdt-language-server-latest.tar.gz'; |
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.
TODO: It is a hack. Revert this.
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.
import { Disposable } from '@theia/core/lib/common/disposable'; | ||
|
||
@injectable() | ||
export class SemanticHighlightingService implements Disposable { |
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.
We should add some comment, explaining why this impl is entirely empty. It's ok to have a pointer to the monaco implementation in it.
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 can move the entire implementation from @theia/monaco
to @theia/editor
if I can expose the id
property for the editor decoration.
The API for the EditorDecoration
lacks this information.
} | ||
|
||
/** | ||
* We do not get delta notification from the LS if lines were deleted and new semantic highlighting positions were introduced. |
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 remember we talked about it, but I forget why that is. I think it should be the responsibility of the LS to send updates in that case, too.
* @param id The decoration id. | ||
* @return The decoration range or `undefined` if the decoration was not found. | ||
*/ | ||
getDecorationRange(id: string): Range | undefined; |
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 couldn't find any clients for this.
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.
Cool! Looks very good to me :)
I noticed that neither in Java neither static members were italic (didn't notice a difference) nor were deprecated underlined (they are turned red and italic)
Static method declarations are not, static method invocations are italic. Just like in Eclipse with JDT. |
bb86112
to
c1f5c6d
Compare
5bd6956
to
0fb4300
Compare
@tsmaeder, what is the difference between the https://www.eclipse.org/downloads/download.php?file=/che/che-ls-jdt/snapshots/che-jdt-language-server-latest.tar.gz and |
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.
LGTM
I would like to check the Windows failure before merging this. |
Bumping the test timeout fixed the issue. I do one more squash and build, then I merge this. |
Closes #1845 Signed-off-by: Akos Kitta <kittaakos@typefox.io>
|
||
import { injectable } from 'inversify'; | ||
import { Argv, Arguments } from 'yargs'; | ||
import { CliContribution } from '@theia/core/src/node/cli'; |
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.
src
-> lib
Closes #1845
Signed-off-by: Akos Kitta kittaakos@typefox.io