This fixes the problem described in #15023 by allowing extensions to designate language servers as secondary language servers. Secondary language servers can be used for formatting/linting/diagnostics, but they won't be used for go-to-definition and find-references. The problem before this change was that extension authors and users didn't have any influence on which language server is used as the primary or secondary language server. Since they were all designated as "primary", Zed would pick the first one in the list of running language servers. And the order of entries in that' list is dependent on the order in which the language servers were started. We could somehow steer this behaviour through the order and, when trying to find a primary language server, traverse the list in the order of the language servers as they are defined in the settings, but that seems brittle. We'd have to ensure that users have their language server entries ordered correctly and "teach" them about primary vs. secondary language servers. Instead, we can leave it up to the extension authors to decide which server can act as a primary language server and which as a secondary. In the case of rubocop, too, I think it's pretty clear-cut that it's a secondary language server, like tailwind or ESLint.
29 lines
725 B
TOML
29 lines
725 B
TOML
id = "ruby"
|
|
name = "Ruby"
|
|
description = "Ruby support."
|
|
version = "0.0.8"
|
|
schema_version = 1
|
|
authors = ["Vitaly Slobodin <vitaliy.slobodin@gmail.com>"]
|
|
repository = "https://github.com/zed-industries/zed"
|
|
|
|
[language_servers.solargraph]
|
|
name = "Solargraph"
|
|
languages = ["Ruby"]
|
|
|
|
[language_servers.ruby-lsp]
|
|
name = "Ruby LSP"
|
|
languages = ["Ruby", "ERB"]
|
|
|
|
[language_servers.rubocop]
|
|
name = "Rubocop"
|
|
languages = ["Ruby"]
|
|
secondary = true
|
|
|
|
[grammars.ruby]
|
|
repository = "https://github.com/tree-sitter/tree-sitter-ruby"
|
|
commit = "dc2d7d6b50f9975bc3c35bbec0ba11b2617b736b"
|
|
|
|
[grammars.embedded_template]
|
|
repository = "https://github.com/tree-sitter/tree-sitter-embedded-template"
|
|
commit = "91fc5ae1140d5c9d922312431f7d251a48d7b8ce"
|