Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crates/oxc_language_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ impl Options {
impl LanguageServer for Backend {
#[expect(deprecated)] // TODO: FIXME
async fn initialize(&self, params: InitializeParams) -> Result<InitializeResult> {
let server_version = env!("CARGO_PKG_VERSION");
let options = params.initialization_options.and_then(|mut value| {
let settings = value.get_mut("settings")?.take();
serde_json::from_value::<Options>(settings).ok()
Expand All @@ -97,7 +98,7 @@ impl LanguageServer for Backend {

if let Some(value) = options {
info!("initialize: {value:?}");
info!("language server version: {:?}", env!("CARGO_PKG_VERSION"));
info!("language server version: {server_version}");
}

let capabilities = Capabilities::from(params.capabilities);
Expand All @@ -113,7 +114,10 @@ impl LanguageServer for Backend {
})?;

Ok(InitializeResult {
server_info: Some(ServerInfo { name: "oxc".into(), version: None }),
server_info: Some(ServerInfo {
name: "oxc".into(),
version: Some(server_version.to_string()),
}),
offset_encoding: None,
capabilities: capabilities.into(),
})
Expand Down
Loading