aurelia / tools

Tools and utility functions used to build and develop Aurelia's libraries.
MIT License
37 stars 32 forks source link

Common platform for all IDE plugins #32

Open atsu85 opened 8 years ago

atsu85 commented 8 years ago

Having IDE plugins for most popular IDEs to autocomplete templates and validate application would be very nice.

This issue depends on other issue, that would provide among other things a common tooling library for IDEs to analyse the application statically. If that library is build with keeping in mind this issue (IDE plugins), then building IDE plugins would become way less complicated.

If I'd have to build a common platform for IDE plugins, I'd probably create a background process with REST API, that can be started by IDE plugin. Then all IDE plugins could be implemented relatively easily on top of the REST API to execute different commands (autocomplete, validation, ...).

As i understand, the library should build and provide some kind of application model, that IDE could use to query for example view and custom element models that contain information about template that is used by it and methods/fields, bind. When this information is available, plugins could easily implement

I'd personally like to have a plugin for Atom and Eclipse IDEs. When Aurelia provides the common tooling library for IDEs, i think i could come up with very primitive Eclipse plugin myself.

MeirionHughes commented 8 years ago

I think aurelia-templaing-lint could be improved to facilitate providing error-feedback and intellisense (in the HTML part), for you while you edit the template.

EisenbergEffect commented 8 years ago

Absolutely. We'd love to have something like that ;)

atsu85 commented 8 years ago

Update: @denofevil has created Aurelia plugin "AureliaStorm" for IntelliJ platform (IDEA/Webstorm) (installed through IntelliJ plugin manager).

atsu85 commented 8 years ago

@EisenbergEffect, what are the plans related to this issue? I don't know what features Microsoft IDEs provide, but it seems that AureliaStorm could use some help related to this issue from Aurelia. It would be so much easier to develop Aurelia IDE plugins if there was common platform for all IDE plugins that would be provided by Aurelia.

Alexander-Taran commented 6 years ago

Stale since 2016

EisenbergEffect commented 6 years ago

@eriklieben How portable is the work that's being done for VSCode? Is it based on the cross-tool TS language services?

eriklieben commented 6 years ago

We currently have a visual studio code language server & client that communicate over RPC. As far as my understanding of it goes you are able to reuse this server together with https://www.npmjs.com/package/vscode-languageserver-types to implement a different client on top of it to use, for example, with SublimeText.

The cross-tool TS language service is as far as I've seen only for extending TypeScript itself (.ts files), not for providing support for HTML completions, etc. The thread that started the whole TS language server extension plugin is talking a lot about Angular (https://github.com/Microsoft/TypeScript/issues/6508) and they seem to have implemented this. In the Angular documentation about the plugin (https://angular.io/guide/language-service#installing-in-your-project), they state the same:

"Note that this only provides diagnostics and completions in .ts files. You need a custom sublime plugin (or modifications to the current plugin) for completions in HTML files."

There isn't a lot of documentation around on this and each time I look into an extension I see back the code to provide HTML functionality within a custom library or inside of the server part of the extension.

All the code we currently have is for HTML files, I didn't start on the typescript side yet. As soon as that work starts we could probably use a TypeScript language server plugin.

I think it would be a good step to first further develop the vs code extension and once that is major enough, refactor all the logic out of it to a separate library which can be reused. Or we must find people that want to actively build extensions for other editors today using this library.

I did find an experimental Vue typescript plugin (https://github.com/sandersn/vue-ts-plugin) that seems to do this for .vue files, but didn't have the time yet to check this out and I am wondering if it's a good practice to activate this for all .html files (as our requirement is).