Allow extensions to provide data for language_ids (#10053)

This PR makes it so extensions can provide values for the `language_ids`
method on the `LspAdapter` trait.

These are provided as data in the `language_servers` section of the
`extension.toml`, like so:

```toml
[language_servers.intelephense]
name = "Intelephense"
language = "PHP"
language_ids = { PHP = "php"}
```

Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
This commit is contained in:
Marshall Bowers 2024-04-01 17:01:11 -04:00 committed by GitHub
parent 65f0712713
commit 39cc3c0778
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 5 deletions

View file

@ -1,5 +1,5 @@
use anyhow::{anyhow, Context, Result};
use collections::BTreeMap;
use collections::{BTreeMap, HashMap};
use fs::Fs;
use language::LanguageServerName;
use semantic_version::SemanticVersion;
@ -99,6 +99,8 @@ pub struct GrammarManifestEntry {
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
pub struct LanguageServerManifestEntry {
pub language: Arc<str>,
#[serde(default)]
pub language_ids: HashMap<String, String>,
}
impl ExtensionManifest {