-
Notifications
You must be signed in to change notification settings - Fork 14
Semantic coloring in attributes (clear blue) and locals (brown) is missing. #18
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
Comments
To support that :
|
I'm curious about why have you based TypeScript editor in JSDT editor. What are the benefits of this dependency? I'm afraid that issues like https://bugs.eclipse.org/bugs/show_bug.cgi?id=486961 limit TypeScript editor features |
@micaelgalluego my goal was not to develop from scratch an editor. It's a big work. But I tell me more and more if I must start from scratch the editor. If I can manage my idea with TextMate, I think I will develop my own editor. |
+1 to have a custom editor to be fully configurable. But I can't help with it as my limited experience developing Eclipse plugings |
@micaelgallego developping an editor from scratch is a big work. More JSDT guys are improving a lot to be more extensible. But it will take time. I think I will be very motivated to develop custom editor if I can support JSX coloration with TextMate like VSCode does. After that I could contribute to JSDT with TextMate. I have started to port https://github.com/Microsoft/vscode-textmate (written in TypeScript) to Java code, but it's a really big work -( More vscode-textmate is based on oniguruma and we must the same lib in Java (it seems that it's joni). If you think you could help me to develop this port of textmate in Java, and if we can support it inside Eclipse, it will be fantastic (and it will not only for TypeScript but for other languages). This port of texmate is not depepdendent from Eclipse, it could be used for Swing or other GUI. If you think you could help me, I can create a github project. Tell me... |
I'm very sorry but I don't have enough time for now to collaborate in such a big project. I cannot commit myself to help you. In the meantime, until vscode-textmate is ported to Java, what do you think in execute it using https://github.com/eclipsesource/J2V8 or Nashorn? I now it is a bit hacky, but it may be worthwhile for a prototype. |
I would liek to avoid doing that. Syntax coloration must be very fast and this solution required Java8 or installation of J2V8. |
@micaelgallego I have ported vscode textmate for eclipse https://github.com/angelozerr/textmate.java but it'.s little slow (freeze the editor) when ts file is big VSCode is too slow but it doesn't feeze the UI editor. see https://github.com/Microsoft/vscode/blob/master/src/vs/editor/common/model/textModelWithTokens.ts Syntax coloration is done on bakground. I don't know how to do that with eclipse. |
It is amazing that you have implemented textmate for Java. Good job! Sorry I can't help you with eclipse editor coloring in background. Can't you create a Thread to do the job in background and when result is ready apply it to current editor? |
@micaelgallego I have improved a lot https://github.com/angelozerr/textmate.java and I have the intention to integrate to typescript.java. The coloration is based on TypeScript TextMate from VSCode, so we should have the same colorization. It's a little slower than the current colorization but as it is done on background, it should (I hope) have not freeze. My idea is to add a preferences like TypeScript > Editor -> Syntax Color and have a checkbox with "Use Textmate" or "Advanced colorization". This preferences will be disabled by default (and in the future we could set this preferences by default if textmate.java works well according users feedback). @nimo23 @jcompagner if you know Eclipse plugins you can start to play with https://github.com/angelozerr/textmate.java and give me some feedback. Thanks! |
i will look at it (i know how eclipse plugins work our tool has loads of them) |
Thanks!
Yes sure! But with TextMate you will have advanced syntax colorization (like highlight parameter variable of function different color from private variable) and more I should be able to highlight HTML syntax for angular @template (I must study that).
TextMate feature should not break this feature (I hope). The idea is just to replace the IPresentationReconcilier (used for syntax color) of the TypeScriptEditor by the TextMate presentation reconcilier |
i have now 2 typescript editors right? |
also as an example what i mean with what are "words" in the new editor if i double click on: $rootScope then only "rootScope" is selected instead of "$rootScope" the "old" editor works correctly in this scenario. |
For the moment yes, but the TypeScript editor from textmate.java is just a sample. My idea is just to use the TMPresentationReconcilier inside typescript.java
As I said you it's just a sample TypeScript editor which manage coloration. So matching of bracket will continue to work once I will merge the 2 editors.
Yes the coloration is done on background. If start textmate.jav ain debug mode it's very slow. Please test with run as. |
i did test it but i think that line for line syncing to the event thread is what makes it perceived as slow. The sample plugin.xml does give me an error because i am not on 4.7 (Unknown extension point: 'org.eclipse.ui.genericeditor.presentationReconcilers') |
Have you a big ts file? I have done like this like VSCode does it.
Yes it's just sample with GeneridEditor coming from Oxygen and the cool LanguageServer project |
Done with #114 (comment) |
Semantic coloring in attributes (clear blue) and locals (brown) is missing.
The text was updated successfully, but these errors were encountered: