-
Notifications
You must be signed in to change notification settings - Fork 14
Contribute TypeScript repositories via an extension point #138
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
Contribute TypeScript repositories via an extension point #138
Conversation
@lorenzodallavecchia have you seen that you can choose your TypeScript version with project preferences? |
Yes I know about that possibility. In this case, however, I need to affect the available Embedded TypeScript options, not just change the default. As you may have guessed, I am integrating typescript.java into a larger Eclipse-based product along with other plugins. Since I am already bundling TypeScript for my own needs, I did not like to have to include it twice (one inside ts.repository and one inside my own plugin), nor I wanted to access ts.repository directory from the bundle registry. |
@@ -222,4 +218,50 @@ public static void fixEmbeddedPreference(IEclipsePreferences preferences) { | |||
} | |||
} | |||
} | |||
|
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 think it should b ebetter to create a new class IDETypeScriptRepositoryManager which extends TypeScriptRepositoryManager which consume your extension point, no?
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.
Please add EPL license like https://github.com/angelozerr/typescript.java/blob/master/core/ts.core/src/ts/TypeScriptKind.java and add your name.
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 have a doubt. There is already a TypeScriptRepositoryManager, but it currently has a "passive" role (the preference initializer populates it from the outside). Would you keep it that way and create a new different manager, or evolve it to auto-populate with TS repositories?
Personally I would go with the second option (evolving it), also making it similar to NodejsInstallManager.
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.
Sorry for my too quick comments. Please re-read my propistion with IDETypeScriptRepositoryManager. TypeScriptRepositoryManager must not be linked to Eclipse (core folder could be consumed with other IDE)
The default repository is chosen to be the one with the highest version. All others are treated as archives.
26605d0
to
eaf29c7
Compare
Thanks so much @lorenzodallavecchia ! |
@lorenzodallavecchia I'm inegrating tslint by developping a TypeScript 2.3 plugin (not available for the moment), but I have found an hack to enable it (like angular2 language service). The cool thing is that with my TypeScript 2.3 plugin, tslint is really well integrated with tsserver (the ts file is not parsed twice (once for completion, once for tslint), error appears when compile is done, (eclipse marker) and quick fixes starts working. But I need to:
If you are interested with those features, I think we should discuss together about that (how to contribute to repository with new modules like tslint language service, etc) in order to you benefit with my tslint. If you are interested with tslint, I will create a new issue to discuss about "how to contribute to repository with new module". |
Hi @angelozerr thanks for querying me on this. I hope the extension point change does not cause too much trouble in evolving typescript.java! As long as the solution is based on extension points it should be OK for me. For the moment I am not using tslint, but I plan to integrate it in our workflow in the future. So yes, I am interested in collaborating on this feature. :) |
I have found an elegant solution. Please wait that I finish to commit https://github.com/angelozerr/tsserver-plugins
Ok, here a demo with Angular2 & tslint integration: Hope you will like it: |
Amazing! |
It's not my work but google& µsoft work. Indeed it's amazing! The tslint integration is my work. It uses microsoft/TypeScript#11976 which will be available in th efuture version of TypeScript but I have found a mean to consume those plugins with any version of TypeScript with https://github.com/angelozerr/tsserver-plugins |
The embedded TypeScript and TSLint installations are retrieved directly from the
ts.repository
bundle (from root andarchives
subdir), making the mechanism completely hard-coded.This makes it difficult or impossible to
This change introduces an extension point, similar to the one for Node.js installations. An extension can contribute one or more repositories, each containing TypeScript and TSLint. The default repository is choosen to be the one with the highest TypeScript version.