Unified IDE support
ChristianMurphy opened this issue ยท 9 comments
Motivation
I'm working to create editor plugins for Selective Lint.
https://github.com/unifiedjs/unified-engine-atom provides a good starting point for Atom.
I'd also like to create plugins for VSCode, WebStorm, Vim, among others.
In each of these editors I want to do basically the same thing: show inline feedback on code issues as a user types, and offer the potential to autofix where possible.
Problem
Each editor has its own plugin API, which need to be separately developed and maintained.
In addition WebStorm and Vim run on non-javascript languages so there would need to be some extra care taken to handle binding to the JavaScript API/CLI.
All of this to communicate the same information, to different IDE APIs.
Potential Solution
One promising potential solution is the language server protocol.
Which extracts language analysis out of the editor process into a separate process, and communicates through a standard JSON RPC interface.
Meaning most of the processing logic lives in a shared server, and each editor implements a thin client to communicate with the server.
source: https://microsoft.github.io/language-server-protocol/howItWorks
At the time of writing Atom, VSCode, Sublime Text, Intellij, and Vim already have language server clients and more IDEs have support in progress.
There are also SDK's to assist with creating a language server
The protocol appears to support many of the features implemented by unified editor integrations already: reporting issues inline in the IDE and autofixing code.
References
Two examples of linters as language servers
https://github.com/shinnn/vscode-stylelint
https://github.com/Microsoft/vscode-eslint
I think we need something like unified-engine-lsp
or something to make this work, right? Are you interested in working on that?
Yes and yes.
I'm wrapping up some docs updates for unified message control, then will start on vscode/language server support.
@ChristianMurphy Still into this?
Still into this.
Other project work is drawing my time and energy, it may be a while til I'll have time to circle back to this.
I've started an initial draft at https://github.com/ChristianMurphy/unified-engine-vscode
Anything I can help with?
Sure,
The initial focus is getting the project to remark lint results back to the IDE.
Then generalizing to unified-lint-rule
and unified
.
Then adding formatting/write support.
I've been using https://github.com/shinnn/vscode-stylelint and https://github.com/shinnn/stylelint-vscode as a baseline design.
Right now the project mostly has linting and test boilerplate.
You're welcome to add functionality and features in.