vue: Release 0.0.4 (#13580)
Respect user settings in initialization_options. Release Notes: - Fixed Vue extension not picking up user-provided initialization options.
This commit is contained in:
parent
6cedfa0ce7
commit
e71b642f44
4 changed files with 19 additions and 10 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -13854,7 +13854,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zed_vue"
|
name = "zed_vue"
|
||||||
version = "0.0.3"
|
version = "0.0.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"zed_extension_api 0.0.6",
|
"zed_extension_api 0.0.6",
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "zed_vue"
|
name = "zed_vue"
|
||||||
version = "0.0.3"
|
version = "0.0.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
publish = false
|
publish = false
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
id = "vue"
|
id = "vue"
|
||||||
name = "Vue"
|
name = "Vue"
|
||||||
description = "Vue support."
|
description = "Vue support."
|
||||||
version = "0.0.3"
|
version = "0.0.4"
|
||||||
schema_version = 1
|
schema_version = 1
|
||||||
authors = ["Piotr Osiewicz <piotr@zed.dev>"]
|
authors = ["Piotr Osiewicz <piotr@zed.dev>"]
|
||||||
repository = "https://github.com/zed-industries/zed"
|
repository = "https://github.com/zed-industries/zed"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use std::{env, fs};
|
use std::{env, fs};
|
||||||
use zed::lsp::{Completion, CompletionKind};
|
use zed::lsp::{Completion, CompletionKind};
|
||||||
use zed::CodeLabelSpan;
|
use zed::CodeLabelSpan;
|
||||||
|
use zed_extension_api::settings::LspSettings;
|
||||||
use zed_extension_api::{self as zed, serde_json, Result};
|
use zed_extension_api::{self as zed, serde_json, Result};
|
||||||
|
|
||||||
struct VueExtension {
|
struct VueExtension {
|
||||||
|
@ -86,14 +87,22 @@ impl zed::Extension for VueExtension {
|
||||||
|
|
||||||
fn language_server_initialization_options(
|
fn language_server_initialization_options(
|
||||||
&mut self,
|
&mut self,
|
||||||
_: &zed::LanguageServerId,
|
language_server_id: &zed::LanguageServerId,
|
||||||
_: &zed::Worktree,
|
worktree: &zed::Worktree,
|
||||||
) -> Result<Option<serde_json::Value>> {
|
) -> Result<Option<serde_json::Value>> {
|
||||||
Ok(Some(serde_json::json!({
|
let initialization_options =
|
||||||
"typescript": {
|
LspSettings::for_worktree(language_server_id.as_ref(), worktree)
|
||||||
"tsdk": "node_modules/typescript/lib"
|
.ok()
|
||||||
}
|
.and_then(|lsp_settings| lsp_settings.initialization_options.clone())
|
||||||
})))
|
.unwrap_or_else(|| {
|
||||||
|
serde_json::json!({
|
||||||
|
"typescript": {
|
||||||
|
"tsdk": "node_modules/typescript/lib"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
Ok(Some(serde_json::json!(initialization_options)))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn label_for_completion(
|
fn label_for_completion(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue