helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
32.51k stars 2.4k forks source link

roots for `[language-server.mylsp-name]` #8119

Open maximyurevich opened 1 year ago

maximyurevich commented 1 year ago

Hello, I want use [language-server.mylsp-name] directive with roots = [] like in [[language]] directive.

What exists at the moment does not satisfy DRY principle

For example:

[language-server.tailwindcss]
command = "tailwindcss-language-server"
args = ["--stdio"]
roots = ['tailwindcss.config.js']
[language-server.unocss]
command = "unocss-language-server"
args = ["--stdio"]
roots = ['unocss.config.js']
[[language]]
name = "html"
scope = "text.html.basic"
injection-regex = "html"
file-types = ["html"]
roots = []
language-servers = ["tailwindcss", "unocss", "vscode-html-language-server"]
auto-format = true
indent = { tab-width = 2, unit = "  " }
pascalkuthe commented 1 year ago

Provide an issue description. This is not actionable

maximyurevich commented 1 year ago

Provide an issue description. This is not actionable

[redacted]

pascalkuthe commented 1 year ago

DRY is questionable for coding but it doesn't make any sense for a config file. Specifying roots folders per language seems perfectly fine to me.

However, I do agree that adding a roots folder to the language server config makes sense for a different reason: Multiple different language servers may actually expect different roots for the same language.

These roots should be merged with the per-language roots.

KenCox94 commented 1 year ago

am currently working this.

would each language-server config have several roots or a single root.

for example:

[language-server.unocss]
command = "unocss-language-server"
args = ["--stdio"]
roots = ["unocss.config.js"]

or

[language-server.unocss]
command = "unocss-language-server"
args = ["--stdio"]
root = "unocss.config.js"
maximyurevich commented 1 year ago

am currently working this.

would each language-server config have several roots or a single root.

for example:

[language-server.unocss]
command = "unocss-language-server"
args = ["--stdio"]
roots = ["unocss.config.js"]

or

[language-server.unocss]
command = "unocss-language-server"
args = ["--stdio"]
root = "unocss.config.js"

several roots

JulianGCalderon commented 2 weeks ago

Hello! Is this feature currently being worked on? If not, I would be happy to work on it.