vscode-stylelint
vscode-stylelint copied to clipboard
Publish server part as a separate stylelint-language-server
What is the problem you're trying to solve?
LSP servers by definition should be easy to reuse in various editors, without being locked-in to any specific one. A stylelint server was created for this extension but it's locked-in to the vscode extension only.
What solution would you like to see?
Extract the server part into a separate repo and publish as a npm package (for example stylelint-language-server). That would make it easy for both this extension to depend on it and for other editors to start using it.
(I've adapted this server to work with Sublime Text editor (see related PR at https://github.com/sublimelsp/LSP-vscode-stylelint/pull/1) but it requires some extra work that shouldn't be necessary.)
It sounds good to me. But I don't know what work is needed. Can you help? If you want to publish a new package, I think we need help from @jeddy3.
The first step would be separating the server into a separate repo. Or use monorepo. Whatever is a personal preference.
Then:
- optionally add
binproperty topackage.json - add
filesproperty to exclude some unnecessary files (if there are any) - publish to npm
- update extension to depend on the new package
I think it's difficult to separate the repo, because I think it's probably difficult to separate test codes. So I think it's better to use monorepo.
Personally I think working with monorepos is a pain.
I think another option is to just put server code in a separate directory (like server) that would have its own package.json and could be released to npm from that directory. One example of such setup is https://github.com/microsoft/vscode-eslint which is also a VS extension and language server in one repo
If you want to publish a new package, I think we need help from @jeddy3.
I've added you to the stylelint npm org so that you can publish packages under the @stylelint scope. If you publish an unscoped package, invite jeddy3, ntwb and hudochenkov to it. (Preference would be for a scoped package.)
I think another option is to just put server code in a separate directory (like server) that would have its own package.json and could be released to npm from that directory.
That approach must have merit if the Microsoft team do for their ESLint extension.
I've kick-started the progress with https://github.com/stylelint/vscode-stylelint/pull/141
#265 refactors the project from the ground up into a new modular architecture that makes it way easier to split off the server into its own package. I'd like to get some traction on this issue once the v1 release has had time for the dust to settle and we've spent whatever time we may need to spend squashing bugs.
I'm considering splitting the language server into a proper package in v1.2 since the refactored codebase in v1.2 makes it much easier to do this. However, I'm not certain yet, as I already have a lot of work cut out for me. If it makes it into v1.2, this issue will be added to the v1.2 project.
Thank you for the update.