diff --git a/crates/ide-extension/src/capability.rs b/crates/ide-extension/src/capability.rs index 042bd82def..e6e40e2e0a 100644 --- a/crates/ide-extension/src/capability.rs +++ b/crates/ide-extension/src/capability.rs @@ -75,6 +75,8 @@ pub enum Capability { JavaAgent, /// Fork a recorded native agent session into a new task in the open project (API 1.18). Agents, + /// Query running IDE language servers for symbol types, definitions, references and outlines (API 1.21). + CodeSemantics, } /// How a grant is presented (plan 4.2). @@ -92,9 +94,13 @@ pub enum Risk { impl Capability { pub fn risk(&self) -> Risk { match self { - Self::ProjectRead | Self::EditorRead | Self::Storage | Self::Events | Self::VcsRead | Self::BuildRead => { - Risk::Low - } + Self::ProjectRead + | Self::EditorRead + | Self::Storage + | Self::Events + | Self::VcsRead + | Self::BuildRead + | Self::CodeSemantics => Risk::Low, Self::EditorWrite | Self::DatabaseSources | Self::DatabaseSchema @@ -175,6 +181,9 @@ impl Capability { Self::FsWrite(path) => format!("Change files under {path}, outside the project"), Self::JavaAgent => "Run code inside the Java applications you start".into(), Self::Agents => "Fork a recorded agent session into a new task in the open project".into(), + Self::CodeSemantics => { + "Query language server symbol definitions, types, references and outlines in trusted projects".into() + } } } @@ -320,6 +329,7 @@ impl fmt::Display for Capability { Self::FsWrite(p) => write!(f, "fs.write:{p}"), Self::JavaAgent => f.write_str("java.agent"), Self::Agents => f.write_str("agents"), + Self::CodeSemantics => f.write_str("code.semantics"), } } } @@ -406,6 +416,7 @@ impl FromStr for Capability { "clipboard.read" => Self::ClipboardRead, "java.agent" => Self::JavaAgent, "agents" => Self::Agents, + "code.semantics" => Self::CodeSemantics, _ => return Err(format!("unknown capability {s:?}")), }) } diff --git a/crates/ide-extension/src/manifest.rs b/crates/ide-extension/src/manifest.rs index ceb35231f4..ed1aef34a3 100644 --- a/crates/ide-extension/src/manifest.rs +++ b/crates/ide-extension/src/manifest.rs @@ -436,6 +436,9 @@ impl Manifest { if matches!(cap, Capability::Agents) { self.needs_api(&format!("capability `{cap}`"), 18)?; } + if matches!(cap, Capability::CodeSemantics) { + self.needs_api(&format!("capability `{cap}`"), 21)?; + } if matches!(cap, Capability::NetSetting { .. }) { self.needs_api(&format!("capability `{cap}`"), 18)?; } diff --git a/crates/ide-host/src/plugins/api.rs b/crates/ide-host/src/plugins/api.rs index 69d4cc49a5..8364820cb2 100644 --- a/crates/ide-host/src/plugins/api.rs +++ b/crates/ide-host/src/plugins/api.rs @@ -3018,6 +3018,111 @@ impl HostApi for PluginApi { Ok(result.to_string()) } + fn lsp_definition( + &self, + root: &Path, + path: &str, + at: ide_core::Pos, + cancel: &CancellationToken, + timeout: Duration, + ) -> Result, HostError> { + self.lsp_semantic_goto(root, path, at, ide_lsp::types::GotoKind::Definition, cancel, timeout) + } + + fn lsp_type_definition( + &self, + root: &Path, + path: &str, + at: ide_core::Pos, + cancel: &CancellationToken, + timeout: Duration, + ) -> Result, HostError> { + self.lsp_semantic_goto(root, path, at, ide_lsp::types::GotoKind::TypeDefinition, cancel, timeout) + } + + fn lsp_implementations( + &self, + root: &Path, + path: &str, + at: ide_core::Pos, + cancel: &CancellationToken, + timeout: Duration, + ) -> Result, HostError> { + self.lsp_semantic_goto(root, path, at, ide_lsp::types::GotoKind::Implementation, cancel, timeout) + } + + fn lsp_references( + &self, + root: &Path, + path: &str, + at: ide_core::Pos, + limit: usize, + cancel: &CancellationToken, + timeout: Duration, + ) -> Result, HostError> { + let (host, project, doc) = self.open_semantic_doc(root, path, true)?; + let res = host.runtime.block_on(async { + let fut = project.lsp.references_streaming(doc.1, at, true, true, false, cancel.clone(), None); + tokio::select! { + _ = cancel.cancelled() => Err(ide_core::IdeError::cancelled()), + out = tokio::time::timeout(timeout, fut) => out.map_err(|_| ide_core::IdeError::cancelled())?, + } + }); + drop(doc); + let refs = res.map_err(map_lsp_err)?; + Ok(refs + .locations + .into_iter() + .filter(|l| location_allowed_for_semantics(root, &project, l)) + .take(limit) + .map(|l| ide_plugin::Location { path: l.path.0, range: l.range }) + .collect()) + } + + fn lsp_hover_info( + &self, + root: &Path, + path: &str, + at: ide_core::Pos, + cancel: &CancellationToken, + timeout: Duration, + ) -> Result, HostError> { + let (host, project, doc) = self.open_semantic_doc(root, path, true)?; + let res = host.runtime.block_on(async { + let fut = project.lsp.hover(doc.1, at, cancel.clone()); + tokio::select! { + _ = cancel.cancelled() => Err(ide_core::IdeError::cancelled()), + out = tokio::time::timeout(timeout, fut) => out.map_err(|_| ide_core::IdeError::cancelled())?, + } + }); + drop(doc); + let hover = res.map_err(map_lsp_err)?; + Ok(hover.map(|h| h.contents.value)) + } + + fn lsp_document_symbols( + &self, + root: &Path, + path: &str, + cancel: &CancellationToken, + timeout: Duration, + ) -> Result, HostError> { + let (host, project, doc) = self.open_semantic_doc(root, path, true)?; + let resolved_path = doc.2.clone(); + let res = host.runtime.block_on(async { + let fut = project.lsp.document_symbols(doc.1); + tokio::select! { + _ = cancel.cancelled() => Err(ide_core::IdeError::cancelled()), + out = tokio::time::timeout(timeout, fut) => out.map_err(|_| ide_core::IdeError::cancelled())?, + } + }); + drop(doc); + let items = res.map_err(map_lsp_err)?.unwrap_or_default(); + let mut out = Vec::new(); + flatten_outline_symbols(&resolved_path, None, &items, &mut out); + Ok(out) + } + fn build_dependencies( &self, root: &Path, @@ -5656,6 +5761,114 @@ impl Shared { } } +struct SemanticDocGuard(Arc, ide_core::DocId, PathBuf); +impl Drop for SemanticDocGuard { + fn drop(&mut self) { + self.0.documents.close(self.1); + } +} + +impl PluginApi { + fn open_semantic_doc( + &self, + root: &Path, + path: &str, + allow_virtual_jdt: bool, + ) -> Result<(Arc, Arc, SemanticDocGuard), HostError> { + self.require_api("language server semantic queries", 21)?; + let workspace = self.shared.workspace().ok_or_else(|| HostError::NotFound("no project is open".into()))?; + if !workspace.trusted(root) { + return Err(HostError::Denied("project is not trusted".into())); + } + let host = workspace + .database_host() + .ok_or_else(|| HostError::Failed("semantic queries unavailable on this host".into()))?; + let project = HostWorkspace::project_covering(&HostWorkspace(Arc::downgrade(&host)), root) + .ok_or_else(|| HostError::NotFound("the project is no longer open".into()))?; + if allow_virtual_jdt && path.starts_with("jdt://") { + let vd = host.runtime.block_on(project.lsp.virtual_document(path)).map_err(map_lsp_err)?; + let doc = project + .documents + .open_virtual(&vd.uri, vd.language_id, &vd.text, &vd.encoding, vd.has_bom, vd.can_reload_encoding) + .map_err(failed)?; + return Ok((host, project.clone(), SemanticDocGuard(project, doc.id, PathBuf::from(&vd.uri)))); + } + let mut roots = vec![root.to_path_buf()]; + roots.extend(workspace.member_roots(root)); + let resolved = ide_plugin::resolve_in_roots(&roots, path).map_err(HostError::Invalid)?; + let doc = project.documents.open(&resolved).map_err(failed)?; + Ok((host, project.clone(), SemanticDocGuard(project, doc.id, resolved))) + } + + fn lsp_semantic_goto( + &self, + root: &Path, + path: &str, + at: ide_core::Pos, + kind: ide_lsp::types::GotoKind, + cancel: &CancellationToken, + timeout: Duration, + ) -> Result, HostError> { + let (host, project, doc) = self.open_semantic_doc(root, path, true)?; + let res = host.runtime.block_on(async { + let fut = project.lsp.goto(doc.1, at, kind); + tokio::select! { + _ = cancel.cancelled() => Err(ide_core::IdeError::cancelled()), + out = tokio::time::timeout(timeout, fut) => out.map_err(|_| ide_core::IdeError::cancelled())?, + } + }); + drop(doc); + let locs = res.map_err(map_lsp_err)?; + Ok(locs + .into_iter() + .filter(|l| location_allowed_for_semantics(root, &project, l)) + .map(|l| ide_plugin::Location { path: l.path.0, range: l.range }) + .collect()) + } +} + +fn location_allowed_for_semantics(root: &Path, project: &crate::project::Project, loc: &ide_core::Location) -> bool { + if loc.uri.as_deref().is_some_and(|u| u.starts_with("jdt://")) || loc.path.0.to_string_lossy().starts_with("jdt://") + { + return true; + } + let mut roots = vec![root.to_path_buf()]; + roots.extend(crate::project::workspace_member_roots(&project.root)); + ide_plugin::inside_roots(&roots, &loc.path.0.to_string_lossy()).unwrap_or(false) +} + +fn flatten_outline_symbols( + path: &Path, + container: Option<&str>, + items: &[ide_core::OutlineItem], + out: &mut Vec, +) { + for item in items { + let kind = serde_json::to_value(item.kind) + .ok() + .and_then(|v| v.as_str().map(str::to_owned)) + .unwrap_or_else(|| "unknown".into()); + out.push(ide_plugin::SymbolInfo { + name: item.name.clone(), + kind, + container: container.map(str::to_owned), + location: ide_plugin::Location { path: path.to_path_buf(), range: item.range }, + }); + flatten_outline_symbols(path, Some(&item.name), &item.children, out); + } +} + +fn map_lsp_err(e: ide_core::IdeError) -> HostError { + use ide_core::error::ErrorKind; + match e.kind { + ErrorKind::NotFound | ErrorKind::Unavailable => HostError::NotFound(e.message), + ErrorKind::InvalidInput => HostError::Invalid(e.message), + ErrorKind::Cancelled => HostError::Cancelled, + ErrorKind::PermissionDenied => HostError::Denied(e.message), + _ => HostError::Failed(e.message), + } +} + #[cfg(test)] mod workbench_tests { use super::*; diff --git a/crates/ide-host/tests/plugin_code_semantics.rs b/crates/ide-host/tests/plugin_code_semantics.rs new file mode 100644 index 0000000000..f76a10c1de --- /dev/null +++ b/crates/ide-host/tests/plugin_code_semantics.rs @@ -0,0 +1,163 @@ +//! API 1.21 `code.semantics`: read-only LSP semantic queries require capability & trust +//! and confine non-virtual target locations to workspace roots. +mod common; + +use ide_core::error::ErrorKind; +use ide_host::plugins::{Consent, HostWorkspace, PluginHost}; +use ide_host::{Host, HostConfig, ops}; +use ide_jsonrpc::{Handler, Peer}; +use ide_plugin::{Invocation, Limits}; +use parking_lot::Mutex; +use serde_json::{Value, json}; +use std::{ + path::{Path, PathBuf}, + sync::Arc, + time::Duration, +}; +use url::Url; + +const ID: &str = "test.code-semantics"; + +fn fixture() -> PathBuf { + Path::new(env!("CARGO_MANIFEST_DIR")).join("../ide-plugin/tests/fixtures/code-semantics") +} + +struct SemanticServer { + target_uri: String, + outside_uri: String, +} + +impl Handler for SemanticServer { + fn on_notification(&self, _: &str, _: Value) {} + fn on_request(&self, method: &str, _: Value) -> Result { + let range = json!({ + "start": {"line": 0, "character": 0}, + "end": {"line": 0, "character": 3} + }); + Ok(match method { + "initialize" => json!({"capabilities": { + "textDocumentSync": {"openClose": true, "change": 1}, + "definitionProvider": true, + "hoverProvider": true, + "documentSymbolProvider": true + }}), + "textDocument/definition" => json!([ + {"uri": self.target_uri, "range": range}, + {"uri": self.outside_uri, "range": range} + ]), + "textDocument/hover" => json!({"contents": {"kind": "markdown", "value": "type: Sym"}}), + "textDocument/documentSymbol" => json!([{ + "name": "Sym", + "kind": 5, + "range": range, + "selectionRange": range + }]), + _ => Value::Null, + }) + } +} + +#[tokio::test(flavor = "multi_thread")] +async fn code_semantics_enforces_capability_trust_and_location_confinement() { + let tmp = tempfile::tempdir().unwrap(); + let base = dunce::canonicalize(tmp.path()).unwrap(); + let root = base.join("project"); + let outside = base.join("outside.txt"); + std::fs::create_dir(&root).unwrap(); + let main_file = root.join("main.txt"); + let target_file = root.join("target.txt"); + std::fs::write(&main_file, "sym\n").unwrap(); + std::fs::write(&target_file, "sym\n").unwrap(); + std::fs::write(&outside, "secret\n").unwrap(); + + let host = + Arc::new(Host::new(HostConfig { local_data_dir: tmp.path().join("local"), ..common::host_config(tmp.path()) })); + host.open_project("main", &root).unwrap(); + + let listener = tokio::net::TcpListener::bind(("127.0.0.1", 0)).await.unwrap(); + let port = listener.local_addr().unwrap().port(); + let server = Arc::new(SemanticServer { + target_uri: Url::from_file_path(&target_file).unwrap().to_string(), + outside_uri: Url::from_file_path(&outside).unwrap().to_string(), + }); + let peers = Arc::new(Mutex::new(Vec::::new())); + let (accepted, state) = (peers.clone(), server.clone()); + tokio::spawn(async move { + while let Ok((stream, _)) = listener.accept().await { + let (r, w) = stream.into_split(); + accepted.lock().push(Peer::connect(r, w, state.clone())); + } + }); + let cfg: ide_language::LanguageServerConfig = + toml::from_str(&format!("name='text-server'\ncommand='no-process-required'\nconnect='127.0.0.1:{port}'")) + .unwrap(); + let project = host.project("main").unwrap(); + project.lsp.set_servers_hook(Box::new(move |_, _| vec![cfg.clone()])); + + let inv = || Invocation { client: Some("main".into()), workspace_root: Some(root.clone()), ..Default::default() }; + + // 1. Denied when capability is not granted (even in trusted workspace). + ops::project::project_trust_set(&host, root.clone(), true, false).await.unwrap(); + let _doc = ops::doc::doc_open(&host, "main", main_file.clone()).await.unwrap(); + let denied_plugins = Arc::new( + PluginHost::new( + tmp.path().join("plugins-denied"), + Arc::new(|_: Option<&str>, _| {}), + Limits { timeout: Duration::from_secs(5), ..Default::default() }, + ) + .unwrap(), + ); + denied_plugins.set_workspace(Some(Arc::new(HostWorkspace(Arc::downgrade(&host))))); + denied_plugins.install_from_dir(&fixture(), &Consent { optional: vec![], signer_change: true }).unwrap(); + let p = denied_plugins.clone(); + let i = inv(); + let err = tokio::task::spawn_blocking(move || p.run_command(ID, "hover", Some("main.txt"), i)) + .await + .unwrap() + .unwrap_err(); + assert_eq!(err.kind, ErrorKind::PermissionDenied); + + // 2. Denied in untrusted project even with Consent::all(). + let granted_plugins = Arc::new( + PluginHost::new( + tmp.path().join("plugins-granted"), + Arc::new(|_: Option<&str>, _| {}), + Limits { timeout: Duration::from_secs(5), ..Default::default() }, + ) + .unwrap(), + ); + granted_plugins.set_workspace(Some(Arc::new(HostWorkspace(Arc::downgrade(&host))))); + granted_plugins.install_from_dir(&fixture(), &Consent::all()).unwrap(); + ops::project::project_trust_set(&host, root.clone(), false, false).await.unwrap(); + let p = granted_plugins.clone(); + let i = inv(); + let untrusted = tokio::task::spawn_blocking(move || p.run_command(ID, "hover", Some("main.txt"), i)) + .await + .unwrap() + .unwrap_err(); + assert_eq!(untrusted.kind, ErrorKind::PermissionDenied); + + // 3. Trusted + granted: returns definition (excluding out-of-root target), hover, and symbols. + ops::project::project_trust_set(&host, root.clone(), true, false).await.unwrap(); + let p = granted_plugins.clone(); + let i = inv(); + let def = tokio::task::spawn_blocking(move || p.run_command(ID, "definition", Some("main.txt"), i)) + .await + .unwrap() + .unwrap() + .unwrap(); + assert!(def.contains("target.txt"), "expected target.txt in {def:?}"); + assert!(!def.contains("outside.txt"), "outside.txt should be confined: {def:?}"); + + let p = granted_plugins.clone(); + let i = inv(); + let hover = + tokio::task::spawn_blocking(move || p.run_command(ID, "hover", Some("main.txt"), i)).await.unwrap().unwrap(); + assert_eq!(hover.as_deref(), Some("type: Sym")); + + let p = granted_plugins.clone(); + let i = inv(); + let symbols = + tokio::task::spawn_blocking(move || p.run_command(ID, "symbols", Some("main.txt"), i)).await.unwrap().unwrap(); + assert_eq!(symbols.as_deref(), Some("class:Sym")); +} diff --git a/crates/ide-plugin/src/runtime.rs b/crates/ide-plugin/src/runtime.rs index c54baa31d5..925603917e 100644 --- a/crates/ide-plugin/src/runtime.rs +++ b/crates/ide-plugin/src/runtime.rs @@ -5,7 +5,7 @@ use crate::types::{ CodeAction, CommitDraft, CommitProblem, CompletionItem, FileOperation, InlineSuggestion, LineMarker, Location, - PluginHover, PluginInlayHint, PrepareRenameResult, ProviderDocument, SemanticToken, + PluginHover, PluginInlayHint, PrepareRenameResult, ProviderDocument, SemanticToken, SymbolInfo, }; use crate::types::{ EventKind, HostError, HttpRequest, HttpResponse, HttpStreamHead, Invocation, Limits, NotificationLevel, @@ -177,6 +177,72 @@ pub trait HostApi: Send + Sync { cancel: &CancellationToken, timeout: Duration, ) -> Result; + /// Read-only semantic definition query via running LSPs (`code.semantics`, API 1.21). + fn lsp_definition( + &self, + _root: &Path, + _path: &str, + _at: ide_core::Pos, + _cancel: &CancellationToken, + _timeout: Duration, + ) -> Result, HostError> { + Err(HostError::Invalid("Language server semantic queries are unavailable on this host".into())) + } + /// Read-only semantic type-definition query via running LSPs (`code.semantics`, API 1.21). + fn lsp_type_definition( + &self, + _root: &Path, + _path: &str, + _at: ide_core::Pos, + _cancel: &CancellationToken, + _timeout: Duration, + ) -> Result, HostError> { + Err(HostError::Invalid("Language server semantic queries are unavailable on this host".into())) + } + /// Read-only semantic implementations query via running LSPs (`code.semantics`, API 1.21). + fn lsp_implementations( + &self, + _root: &Path, + _path: &str, + _at: ide_core::Pos, + _cancel: &CancellationToken, + _timeout: Duration, + ) -> Result, HostError> { + Err(HostError::Invalid("Language server semantic queries are unavailable on this host".into())) + } + /// Read-only bounded references query via running LSPs (`code.semantics`, API 1.21). + fn lsp_references( + &self, + _root: &Path, + _path: &str, + _at: ide_core::Pos, + _limit: usize, + _cancel: &CancellationToken, + _timeout: Duration, + ) -> Result, HostError> { + Err(HostError::Invalid("Language server semantic queries are unavailable on this host".into())) + } + /// Read-only hover/type signature Markdown via running LSPs (`code.semantics`, API 1.21). + fn lsp_hover_info( + &self, + _root: &Path, + _path: &str, + _at: ide_core::Pos, + _cancel: &CancellationToken, + _timeout: Duration, + ) -> Result, HostError> { + Err(HostError::Invalid("Language server semantic queries are unavailable on this host".into())) + } + /// Read-only document outline symbols via running LSPs (`code.semantics`, API 1.21). + fn lsp_document_symbols( + &self, + _root: &Path, + _path: &str, + _cancel: &CancellationToken, + _timeout: Duration, + ) -> Result, HostError> { + Err(HostError::Invalid("Language server semantic queries are unavailable on this host".into())) + } /// The flat dependency graph of the Maven / Gradle builds of the project at `root` /// (of the module `module` only, when given), as the IDE last resolved it; never runs /// a build tool. diff --git a/crates/ide-plugin/src/wit_host.rs b/crates/ide-plugin/src/wit_host.rs index d3d5f7334a..3fc65ecd78 100644 --- a/crates/ide-plugin/src/wit_host.rs +++ b/crates/ide-plugin/src/wit_host.rs @@ -3758,6 +3758,153 @@ impl bindings::openidea::plugin::language_servers::Host for StoreData { ) -> Fallible<()> { Ok(self.lsp_call(project, server, method, params, true)?.map(|_| ())) } + fn definition( + &mut self, + project: Resource, + path: String, + at: wit::Position, + ) -> Fallible> { + if let Err(e) = self.require(Capability::CodeSemantics) { + return Ok(Err(e)); + } + let root = self.table.get(&project)?.root.clone(); + let at = ide_core::Pos { line: at.line, col: at.character }; + let result = self.host.lsp_definition(&root, &path, at, &self.cancel.token(), self.io_timeout()); + if result.is_err() { + self.grant_io_error_grace(); + } + Ok(result + .map(|locs| { + locs.into_iter() + .map(|l| wit::Location { path: to_ipc(&l.path), range: range_to_wit(&l.range) }) + .collect() + }) + .map_err(to_wit)) + } + fn type_definition( + &mut self, + project: Resource, + path: String, + at: wit::Position, + ) -> Fallible> { + if let Err(e) = self.require(Capability::CodeSemantics) { + return Ok(Err(e)); + } + let root = self.table.get(&project)?.root.clone(); + let at = ide_core::Pos { line: at.line, col: at.character }; + let result = self.host.lsp_type_definition(&root, &path, at, &self.cancel.token(), self.io_timeout()); + if result.is_err() { + self.grant_io_error_grace(); + } + Ok(result + .map(|locs| { + locs.into_iter() + .map(|l| wit::Location { path: to_ipc(&l.path), range: range_to_wit(&l.range) }) + .collect() + }) + .map_err(to_wit)) + } + fn implementations( + &mut self, + project: Resource, + path: String, + at: wit::Position, + ) -> Fallible> { + if let Err(e) = self.require(Capability::CodeSemantics) { + return Ok(Err(e)); + } + let root = self.table.get(&project)?.root.clone(); + let at = ide_core::Pos { line: at.line, col: at.character }; + let result = self.host.lsp_implementations(&root, &path, at, &self.cancel.token(), self.io_timeout()); + if result.is_err() { + self.grant_io_error_grace(); + } + Ok(result + .map(|locs| { + locs.into_iter() + .map(|l| wit::Location { path: to_ipc(&l.path), range: range_to_wit(&l.range) }) + .collect() + }) + .map_err(to_wit)) + } + fn references( + &mut self, + project: Resource, + path: String, + at: wit::Position, + limit: u32, + ) -> Fallible> { + if let Err(e) = self.require(Capability::CodeSemantics) { + return Ok(Err(e)); + } + let root = self.table.get(&project)?.root.clone(); + let at = ide_core::Pos { line: at.line, col: at.character }; + let result = self.host.lsp_references( + &root, + &path, + at, + limit.min(500) as usize, + &self.cancel.token(), + self.io_timeout(), + ); + if result.is_err() { + self.grant_io_error_grace(); + } + Ok(result + .map(|locs| { + locs.into_iter() + .map(|l| wit::Location { path: to_ipc(&l.path), range: range_to_wit(&l.range) }) + .collect() + }) + .map_err(to_wit)) + } + fn hover_info( + &mut self, + project: Resource, + path: String, + at: wit::Position, + ) -> Fallible> { + if let Err(e) = self.require(Capability::CodeSemantics) { + return Ok(Err(e)); + } + let root = self.table.get(&project)?.root.clone(); + let at = ide_core::Pos { line: at.line, col: at.character }; + let result = self.host.lsp_hover_info(&root, &path, at, &self.cancel.token(), self.io_timeout()); + if result.is_err() { + self.grant_io_error_grace(); + } + Ok(result.map_err(to_wit)) + } + fn document_symbols( + &mut self, + project: Resource, + path: String, + ) -> Fallible> { + if let Err(e) = self.require(Capability::CodeSemantics) { + return Ok(Err(e)); + } + let root = self.table.get(&project)?.root.clone(); + let result = self.host.lsp_document_symbols(&root, &path, &self.cancel.token(), self.io_timeout()); + if result.is_err() { + self.grant_io_error_grace(); + } + Ok(result + .map(|symbols| { + symbols + .into_iter() + .map(|s| workspace::SymbolInfo { + name: s.name, + kind: s.kind, + container: s.container, + location: wit::Location { + path: to_ipc(&s.location.path), + range: range_to_wit(&s.location.range), + }, + }) + .collect() + }) + .map_err(to_wit)) + } } impl bindings::openidea::plugin::extensions::Host for StoreData { diff --git a/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm index 137514184d..26f50e3e36 100644 Binary files a/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm.sources index b432750d37..02047138b6 100644 --- a/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm.sources @@ -1 +1 @@ -ec2d6d93c13e2483c7771c91ca39b73faae30779d7baa255727c7950d4d3430d +6d8f89941e0e0acc9078ae4b4aaa947055833c7abe4ab7a3584b7aa569dd01e1 diff --git a/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm index 141d6b181f..29138fe403 100644 Binary files a/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm.sources index fc6a7792aa..cde35de7d5 100644 --- a/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm.sources @@ -1 +1 @@ -37ec416570ebbfdfc6d8dce1d64e81d46fbd7ff4bef09cb862f6807a60757db9 +fb67b360c95d24e1a46bfa6206629fb0c3a4fd1ad1646cfef611c267b502eb63 diff --git a/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm index f6e681cca3..99c0e7d7f7 100644 Binary files a/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm.sources index d98a463a37..a8468633d2 100644 --- a/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm.sources @@ -1 +1 @@ -a75573631cf9f0aca3366785ad90aed3c8eebbe61a8edc3a99e81722be70e088 +1e4691d70436bbc746f74ed09acdb60b9b48b3458f49ab21573dfd804e863a8e diff --git a/crates/ide-plugin/tests/fixtures/code-semantics/Cargo.lock b/crates/ide-plugin/tests/fixtures/code-semantics/Cargo.lock new file mode 100644 index 0000000000..4d6752d7ff --- /dev/null +++ b/crates/ide-plugin/tests/fixtures/code-semantics/Cargo.lock @@ -0,0 +1,336 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "anyhow" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cb931c189b85683d69a5cfad41d4d418671e1ac413dd209f3f2fc31e3cfd902" + +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" + +[[package]] +name = "equivalent" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "hashbrown" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "735eaa21a6a5ffb2e84362faaeb90c05ba8e19797ca30428478cb6ea3a4921bc" +dependencies = [ + "foldhash", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "indexmap" +version = "2.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +dependencies = [ + "equivalent", + "hashbrown", + "serde", + "serde_core", +] + +[[package]] +name = "itoa" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4" + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "log" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c" + +[[package]] +name = "macro-string" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e7b3a5bbb2f63aaa223a671ea1bd0e7bc16bd30ce387324cf63995deaddbbd2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "openidea-plugin" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", + "wit-bindgen", +] + +[[package]] +name = "openidea-test-code-semantics" +version = "0.1.0" +dependencies = [ + "openidea-plugin", +] + +[[package]] +name = "prettyplease" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bfe0f4c752e450fc2faf62654f1c134747922825d5b04ca717b8874f41a40c0" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "syn" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + +[[package]] +name = "wasm-encoder" +version = "0.262.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4495a6f85dd94c411c749303efcbc5defade0b0cbdbc0541495241ab917a9b5a" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.262.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c86ff6668190d9fb70372b306b4f9fe8930f0e2f57ce72e4922bf2f117900949" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.262.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "974d643b125b272607e2fff8012ea14a8328acd7621e4bafa7afb32500052b1b" +dependencies = [ + "bitflags", + "hashbrown", + "indexmap", + "semver", +] + +[[package]] +name = "wit-bindgen" +version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85a987ab61d365382d25c7d47e26edd48941b3bf6e3fbf76eff918bc71dab06" +dependencies = [ + "bitflags", + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e122e390603abfacd548027016cd0113a6e2bf2f8ce6bdd3658b013456ea8" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84e26e13b9d972026778d2ffb7985736de116026fdc8d9464f966e12df2eb240" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a008a0d6b4840677326beb4edbeb210a2f1b7d0183fb7cc33f466b90fd7fb6" +dependencies = [ + "anyhow", + "macro-string", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.262.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078def49fdb49cab405c3006e05793b3fdaf7069126ba6b9c97d01ec8c98fe4c" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.262.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f0dc051466ffe46787721fca3d088536f158ae400be044f1b1c386ba9397ad" +dependencies = [ + "anyhow", + "hashbrown", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-ident", + "wasmparser", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/crates/ide-plugin/tests/fixtures/code-semantics/Cargo.toml b/crates/ide-plugin/tests/fixtures/code-semantics/Cargo.toml new file mode 100644 index 0000000000..15d9c8965d --- /dev/null +++ b/crates/ide-plugin/tests/fixtures/code-semantics/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "openidea-test-code-semantics" +version = "0.1.0" +edition = "2024" +publish = false + +[workspace] + +[lib] +crate-type = ["cdylib", "rlib"] + +[dependencies] +openidea-plugin = { path = "../../../../../sdk/rust/openidea-plugin" } + +[profile.release] +opt-level = "s" +lto = true +strip = true +codegen-units = 1 +panic = "abort" diff --git a/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm new file mode 100644 index 0000000000..088cefe718 Binary files /dev/null and b/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm.sources new file mode 100644 index 0000000000..21b367fed0 --- /dev/null +++ b/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm.sources @@ -0,0 +1 @@ +6cc9d187059860197baef1f64b8368bfdd0462b8f7f3bd47370c01d438df8888 diff --git a/crates/ide-plugin/tests/fixtures/code-semantics/plugin.toml b/crates/ide-plugin/tests/fixtures/code-semantics/plugin.toml new file mode 100644 index 0000000000..fd4ae2abfe --- /dev/null +++ b/crates/ide-plugin/tests/fixtures/code-semantics/plugin.toml @@ -0,0 +1,20 @@ +id = "test.code-semantics" +name = "Code semantics query fixture" +version = "0.1.0" +engines.openidea = "^1.21" +wasm = "dist/plugin.wasm" + +[capabilities] +optional = ["code.semantics"] + +[[contributes.commands]] +id = "definition" +title = "Query LSP definition" + +[[contributes.commands]] +id = "hover" +title = "Query LSP hover" + +[[contributes.commands]] +id = "symbols" +title = "Query LSP symbols" diff --git a/crates/ide-plugin/tests/fixtures/code-semantics/src/lib.rs b/crates/ide-plugin/tests/fixtures/code-semantics/src/lib.rs new file mode 100644 index 0000000000..2cc5392ac4 --- /dev/null +++ b/crates/ide-plugin/tests/fixtures/code-semantics/src/lib.rs @@ -0,0 +1,27 @@ +use openidea_plugin::{Error, Invocation, Plugin, Position, register_plugin}; + +#[derive(Default)] +struct CodeSemanticsFixture; + +impl Plugin for CodeSemanticsFixture { + fn run_command(&mut self, id: &str, inv: &Invocation, arg: Option<&str>) -> Result, Error> { + let project = inv.project().ok_or("no project")?; + let path = arg.unwrap_or("main.txt"); + match id { + "definition" => { + let locs = project.lsp_definition(path, Position::new(0, 0))?; + let joined = locs.into_iter().map(|l| l.path).collect::>().join("\n"); + Ok(Some(joined)) + } + "hover" => project.lsp_hover_info(path, Position::new(0, 0)), + "symbols" => { + let syms = project.lsp_document_symbols(path)?; + let joined = syms.into_iter().map(|s| format!("{}:{}", s.kind, s.name)).collect::>().join(","); + Ok(Some(joined)) + } + _ => Err(Error::NotFound(id.into())), + } + } +} + +register_plugin!(CodeSemanticsFixture); diff --git a/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm index 41e2f8c98f..7999c36dd6 100644 Binary files a/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm.sources index a69c3c0c57..a8bad74e8f 100644 --- a/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm.sources @@ -1 +1 @@ -53732d63101502159db8bdb18baaa7b5eac0320f55a89a465a4cf1c3afccd96f +39af04aa3cf47e414669e039c8aa571ba5335b546c389d2224b7e5947690ce9a diff --git a/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm index 4126aa1a8e..9e83ccd37a 100644 Binary files a/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm.sources index 60f66ce95f..0d0f4c222c 100644 --- a/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm.sources @@ -1 +1 @@ -4b836e4e99baca65e73cd1a68bf323da2cc3fdb3eb6172e9e5ae35364faeaca9 +c8875162912cc4d4c91f0effd8069adb64d5585f36d2dc7a5b212e60c075314d diff --git a/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm index 0ce158e719..0ec89062b9 100644 Binary files a/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm.sources index 06e71efc05..f558d355f3 100644 --- a/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm.sources @@ -1 +1 @@ -bf6b3594bf78f7798954fef4cd9acd309212c1b203e3c7e7ce1cf15421b655a6 +58f25da10075ddab4c886900fbc2b0c1cd338f464cc805aae8323dc505cee44d diff --git a/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm index e7d1799cd0..56e30f9b64 100644 Binary files a/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm.sources index 8a9879bdb8..9a3cf2ade0 100644 --- a/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm.sources @@ -1 +1 @@ -ffbf8d5976005f76511e6d471caa6763695700a1b0765c5ef60c01cbbee5d347 +6803ce4e5f293a0a7ced8c72b13257c9729a08526e38e6c4faada736be6f9abd diff --git a/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm index 9b0d219fb5..307de0f780 100644 Binary files a/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm.sources index 8ba0981453..eb59415eb5 100644 --- a/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm.sources @@ -1 +1 @@ -fe0239b2d570894616552522f27df6ac4125879c9688366c8a4d718d37008d75 +f1da9b0b2206a7a19b2ed7fa04476d61e453c4765186fe733ab7594d7594aafc diff --git a/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm index 0174d3a1f3..b24a33b177 100644 Binary files a/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm.sources index 7c18d4d270..b985986965 100644 --- a/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm.sources @@ -1 +1 @@ -365f97a1fa032d24657a465912c0db9f0b3659e506ec2f58ef6ec7c11b900e6b +d4e725c280bfcb9dda0558e6ce9addd65f60a4a1dd9fc857ba6f81888d240851 diff --git a/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm index 34db93c2fb..4ca63fa690 100644 Binary files a/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm.sources index e6e84f2ef1..91653a4167 100644 --- a/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm.sources @@ -1 +1 @@ -bf68db32b4f9484577cdf6ab16d94698fa3e136c2cff34c78f1ffe69f50a428d +66296501aea185582803436aa8ba4a625cc44965fcbf5951a5b961010dfb9262 diff --git a/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm index ce25ddb518..ac496a6706 100644 Binary files a/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm.sources index 9e2b52394c..d3d603ea8d 100644 --- a/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm.sources @@ -1 +1 @@ -823dd4687f52b2571a7241fb8b174ef786311e3fccea8553d70b218a6d1a7dbb +e84ecec0d12c0dbb557262e3e4765145ae7ad0dde9e9d530e863b289ad06634c diff --git a/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm index 788a8bcdcb..d83a01f46b 100644 Binary files a/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm.sources index ab5a1b6365..b0353c354e 100644 --- a/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm.sources @@ -1 +1 @@ -c8eff81ea2bd47cfec18a425d2f1c191d610f4b8c032e0d3cd11f25287078ea6 +b42ebe6310465b56cb253c72ed1b77da135c7939684c154a7988d5d00d66306e diff --git a/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm index 28dac2a353..c4859307f9 100644 Binary files a/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm.sources index b80e97ab6c..3f4b75a6ff 100644 --- a/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm.sources @@ -1 +1 @@ -82224337dcf127fc2737255e7ded92b947a4769f4f479d0150e1247e997d15d7 +874f87ee70c914df7cf498655361a6b52bf607b135c029ef936285827025b359 diff --git a/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm index b30bd08b9c..e63dc565f7 100644 Binary files a/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm.sources index 35c8474570..a5c311e1aa 100644 --- a/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm.sources @@ -1 +1 @@ -96fd2ca6113a96c758bdff5747f29769134a3e210288ef1eaef8cf35795b2c56 +d4dff8c1fa4afe3bc575b54928c8ccdedb38c2bc0f207b6b36a080df28384a46 diff --git a/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm index 39c0ff704c..d19541efc0 100644 Binary files a/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm.sources index a1e77ad0c3..86fa2a0452 100644 --- a/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm.sources @@ -1 +1 @@ -44a640d1c2ec5cb39085c88da530be734bc3544e76fa9c79a25789cc8c5d5e07 +a9929bd830586ec85320878fd5cf112a72c4fcd930f00e0f586421bba29f8e96 diff --git a/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm index f28c52de4c..66f17c9471 100644 Binary files a/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm.sources index 5cbd2d126a..fcc7cb9251 100644 --- a/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm.sources @@ -1 +1 @@ -9cc532dbad566e6218eb3578d2427e531ec70a129117aa2f218b4547b4ce000c +7742a83fc21f256e4ef7ff2205be24d7bbde24037f478364e005704b1a9cc616 diff --git a/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm index 2a21136ea8..d83019ed4c 100644 Binary files a/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm.sources index 52f3e43aa6..65f2443cd0 100644 --- a/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm.sources @@ -1 +1 @@ -f486cbaaba81bf43163a0ff34353fe08fd8773c85a6b285ed6299419d855cb41 +62826712952fd60ab8081dfed0841900a17a318f52f274243c922fda78780517 diff --git a/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm index ba671898e8..ddc428dee3 100644 Binary files a/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm.sources index f71c1b2b81..c6066267c9 100644 --- a/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm.sources @@ -1 +1 @@ -1bf684559d69a9594d8b25326ed09218c3d9e05adbb68632d40116f099569da5 +ff5f5bbd6596080e104c5098578bf1d876b7b7301742147d54ed26904e8ba988 diff --git a/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm index 5e956946c5..96bb2213a3 100644 Binary files a/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm.sources index 300d087af9..c2845cc509 100644 --- a/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm.sources @@ -1 +1 @@ -298aa04571533d304aadefd79ca91ed406d7685efab292316ccb53ce6a3f4e47 +0b07abade1a5098bdf7eeee18c98df3981ec667029172a689b1388051dfa933f diff --git a/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm index 98b1d1b4bb..08f8c40d21 100644 Binary files a/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm.sources index 46a08e21b4..5e1a307539 100644 --- a/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm.sources @@ -1 +1 @@ -8e3cc0e487e4f4a3a39b1296c65cf30b89ade4662a6d5af01d3f40e21b71d5a2 +df0af998d38c09728bb139fdca00cf46660e9fefcec48168e472164a3c67e4be diff --git a/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm index 943e12b77c..b274508fa6 100644 Binary files a/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm.sources index 00ad059ebb..c2fcef59bc 100644 --- a/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm.sources @@ -1 +1 @@ -0234f1e63ee51e288caecabff9d0254d50ef046c1f0733078772296a2b007c06 +9af489050903d0fe8b151813d8c28a268c92601f6d07884af144552ca3f7ec11 diff --git a/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm index 27ba67dfe8..4fa4fc2d73 100644 Binary files a/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm.sources index 5736b8ae23..21501b7b8c 100644 --- a/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm.sources @@ -1 +1 @@ -4fde3d9e6ed3fd7f691ef019413cee591bbfd1364ad086a972365a6e20691657 +dffa79751649825d160b9f1599c17b084dc83082af2fb4716bd380cf2a745018 diff --git a/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm index 9b0ec9288b..25d9611b73 100644 Binary files a/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm.sources index fa0933a428..03737b7d1d 100644 --- a/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm.sources @@ -1 +1 @@ -3963bcfa5253985e0d29b605bd7ab8783d2bb0745d3054f3a8674028ab223c35 +8a6ecc0d2e9b5a31a2bc8302403c11077750ea315810c3e2d4de5731ea576322 diff --git a/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm index f3c78accb1..f28e8fc378 100644 Binary files a/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm.sources index 7307ea276b..c94fa6bfb9 100644 --- a/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm.sources @@ -1 +1 @@ -ee7f86d202d987e19c11267249645b94f2b0a8a2a2958165355631426c9f6f0e +080a96a84b2aaa52298feaefc456c0cff180d6cb7b7fd8dac2ac4140a0fa20e2 diff --git a/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm index 3f3beabf47..ea56cbce8a 100644 Binary files a/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm.sources index 40edf96580..cc8e09d3e3 100644 --- a/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm.sources @@ -1 +1 @@ -332d78159369759885d7d9ec95c61970d64ac316ba809cc62243afdd085f9b24 +f0950ef5b9be1059c6d7315a2fb0485aca5a3c02212007828eedeea13ad18377 diff --git a/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm index f41129ad2b..10be8a8b8a 100644 Binary files a/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm.sources index 40f5e27aa8..29070cec6b 100644 --- a/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm.sources @@ -1 +1 @@ -18722731b1e75c3e9350986179a21eea1fd5b25a748a3421538b6498209155ba +add34d6cd1bb2c8e0e2d9f91df5afd5222e29dd9c1d57980a934574399f709c1 diff --git a/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm index e80b3cd9d0..7478f431c5 100644 Binary files a/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm.sources index 074d9667a7..dbf83fbee1 100644 --- a/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm.sources @@ -1 +1 @@ -adb2c1562146e76c4fad7c97853407429b9640e8bfaf8656ae2205b56c13b789 +3444458b098036925374d789e730c0f557ba1ef88d4e48f531ce0c4092f5a89d diff --git a/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm index 0f886dba29..657fcbafdf 100644 Binary files a/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm.sources index 442b2cf746..bddef45cf2 100644 --- a/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm.sources @@ -1 +1 @@ -3c4d901c3caeca9831a98047da7c3ae811209c4f742312b4593fda6598e1ecb0 +a0e5207f6ddea0bf57765661c9dc372851e32dc71b8ae47d081ea4eb6f5ff4dc diff --git a/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm index 5370c8f005..2d20221ef7 100644 Binary files a/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm.sources index 17d96308d9..ed90781ba7 100644 --- a/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm.sources @@ -1 +1 @@ -cd90d457045fe31c95c53b1d495a72d7251a4af073a36585f8d43d1c82209ebf +619f2fedec1d6973d917112bf7501f18dc1db158185d5e2bba6ff5e53afd4bb6 diff --git a/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm index 8a161226db..21d7737fe7 100644 Binary files a/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm.sources index 5fd60f4958..e3cd3aed21 100644 --- a/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm.sources @@ -1 +1 @@ -7cfc47fe36fa70ddda9b70d38cbff9fe52ba98e09fda51f6b98b80c4180273df +302fedc202adf071ccb4e5bb5a5bc76929c896b1f68094b74d0938d7aced22d1 diff --git a/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm index b9779a9df2..fd72f27ab9 100644 Binary files a/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm.sources index a1d6a6b8b8..9f19df8ca9 100644 --- a/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm.sources @@ -1 +1 @@ -94dc2e2018d832584799c6b692023a1dc8b33b4e24c5f61e1ed91ce829f219e0 +ca8dd0328b19c98e6118b80b1fd5d1ec4edc714f74893c6829b520c961c2ad7f diff --git a/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm index 7490de9cab..6ffa8faa14 100644 Binary files a/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm.sources index 7fc9a945ec..1f542b9ad0 100644 --- a/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm.sources @@ -1 +1 @@ -8ffb0e3ccde37d767d7c99349a414a95dd656a87cd00d4526ff7f56185c401c2 +5489d46adfc3cad99188e2c8dbc126482dacafcccfb431b520fa70f19f28b6e3 diff --git a/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm index 79804b23fd..1099b58cce 100644 Binary files a/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm.sources index 7e1af341b9..dff9ac83dd 100644 --- a/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm.sources @@ -1 +1 @@ -960a18aa2f8913a6b96599cc46518a4c683bb5e9550b1023f46012c7e3cec98f +b9a6e26ae88733d931b66310e788574afef48e716679bb4900befa59fed689d9 diff --git a/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm index 453e96c210..7a76451212 100644 Binary files a/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm.sources index f8c7bb9788..a80098cade 100644 --- a/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm.sources @@ -1 +1 @@ -13b73ae502c74db757120c3f0f769cbbb3a43162ad00449ba6d72454c1bffc96 +c79b0e6540aa5ab4d1f385f56d1bca35bef59eb95a691fb941bf6b50619fe837 diff --git a/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm index 01d42ece92..36d2d8201a 100644 Binary files a/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm.sources index d5f65cc246..d11a8afc62 100644 --- a/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm.sources @@ -1 +1 @@ -70982fdc139e334402d27de03180228da7e36f72f4603a59c9304c4877e055fd +52880aa2c31ebe11f386c1d4cc53b529e18fbced30eed3a28cdd5d83b8cf30b6 diff --git a/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm index 6b9aa785ba..2f4d02a398 100644 Binary files a/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm.sources index ccc622c0e6..2dd286e2dc 100644 --- a/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm.sources @@ -1 +1 @@ -e303bba0abab46d7d680f91b158a25192b1d1da6478698610903dc1f28ac9954 +6a7cca3aeae4a5331a2cdcf3045de550546a7e330cfe2e8a6df409e9966440df diff --git a/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm index dae23ad8f9..0e535766ae 100644 Binary files a/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm.sources index 4bb89222f7..b972adb1dc 100644 --- a/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm.sources @@ -1 +1 @@ -4c17c279f5b803d68b30c57850bc6976739a0678f9bb6b375bf90a5cff578d00 +0546d5739d7a45ccea533c94744584bc4cf30af840afb9e27c7ce98f8154e735 diff --git a/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm index 79f6aa4fa8..3a01b1b341 100644 Binary files a/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm.sources index dd8c711556..cc5eb6d566 100644 --- a/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm.sources @@ -1 +1 @@ -6c487c47bcd2bb2cf886f8c28bbf8e8e26f8a826d3fcc648c7fe167cb64d2a33 +9220a009246c6f2c9d9b45acc4a8adcd6e680d0315334835ab1177f82d28728c diff --git a/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm index 3a29fe31a7..3eaba8bc09 100644 Binary files a/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm.sources index 264addd334..38183d2ea0 100644 --- a/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm.sources @@ -1 +1 @@ -5672153e721f9530eec3db01be7bfe799453799fed993248ae0146c4b3e95875 +2cde99d475ca6ea055310a9387570bcfd08e3d3daef3e1159d9c4c407067ec82 diff --git a/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm index 6847ff5898..725f4419cb 100644 Binary files a/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm.sources index 4d321621be..e69a39c672 100644 --- a/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm.sources @@ -1 +1 @@ -45902621b144087ad8e97a52d406582ddd3083439b7c397bb9da823c7acdc3d7 +ae476f64748cc94c30e71cad57e90f2dea1779444f5d8e16b9c0958d9bbd937c diff --git a/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm index 3df594c3f0..8f54696081 100644 Binary files a/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm.sources index 42ca4838d2..0432f734d8 100644 --- a/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm.sources @@ -1 +1 @@ -4da7d3ebe349655d3c1df34624cd32e9017c1f79197c068a7f50a84c499a85c3 +e54c7d1076d41835b61422cd41443b18385bdadaeb30187c51738c202be7ed09 diff --git a/plugins/README.md b/plugins/README.md index 18611cc31e..a741cd8cc1 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -382,6 +382,7 @@ machine. Users can revoke optional capabilities in Settings › Plugins. | `clipboard` | medium | `host::copy_to_clipboard` and the clipboard API in the plugin's web views | | `clipboard.read` | medium | API 1.11: `host::read_clipboard`, the clipboard's text and image, only in commands and view actions the user ran | | `agents` | medium | API 1.18: `host::fork_agent_session`, fork a recorded native agent session into a new task in the project; trusted projects only | +| `code.semantics` | low | API 1.21: `Project::lsp_definition`, `lsp_type_definition`, `lsp_implementations`, `lsp_references`, `lsp_hover_info`, `lsp_document_symbols`; trusted projects only | `process:` capabilities are also derived from what the contributions start: a language's `language-servers` and `debugger` commands and a run detector's @@ -459,6 +460,11 @@ matching SDK. Plugins for 1.20 and earlier keep working. New in 1.21: `[[contributes.providers]]` and implement `RenameProvider` (`register_plugin!(MyPlugin, rename)`) to participate in `prepare-rename` and cross-file `rename` edits (confined to writable project roots). +- **Read-only code semantics (`code.semantics`).** In trusted projects, + `Project::lsp_definition`, `lsp_type_definition`, `lsp_implementations`, + `lsp_references` (capped by `limit`), `lsp_hover_info` and + `lsp_document_symbols` ask the running language servers, also for read-only + `jdt://` documents. Results outside the project's roots are dropped. ### API 1.19 diff --git a/plugins/official/ai-completion/dist/plugin.wasm b/plugins/official/ai-completion/dist/plugin.wasm index 4ec9bad3fb..6bc1264789 100644 Binary files a/plugins/official/ai-completion/dist/plugin.wasm and b/plugins/official/ai-completion/dist/plugin.wasm differ diff --git a/plugins/official/ai-completion/dist/plugin.wasm.sources b/plugins/official/ai-completion/dist/plugin.wasm.sources index 74de7b5131..7d1eea570a 100644 --- a/plugins/official/ai-completion/dist/plugin.wasm.sources +++ b/plugins/official/ai-completion/dist/plugin.wasm.sources @@ -1 +1 @@ -745bc0cbcd17a2cd9121bd01c4836acfc396a2c216b497ceeb0b57d5ce3b3084 +c68d1160eba8e7ca653fcf65d965eb93cf001ef4327bf9f47b0c8c723e329830 diff --git a/plugins/official/blame-annotations/dist/plugin.wasm b/plugins/official/blame-annotations/dist/plugin.wasm index 37e40d33fa..d4cd0673af 100644 Binary files a/plugins/official/blame-annotations/dist/plugin.wasm and b/plugins/official/blame-annotations/dist/plugin.wasm differ diff --git a/plugins/official/blame-annotations/dist/plugin.wasm.sources b/plugins/official/blame-annotations/dist/plugin.wasm.sources index 9b62581436..6381e3eebf 100644 --- a/plugins/official/blame-annotations/dist/plugin.wasm.sources +++ b/plugins/official/blame-annotations/dist/plugin.wasm.sources @@ -1 +1 @@ -0b47be4f36694bc97c8d1cdd74c97f480741140880379cd3c11bad05bbe2789b +1a4f84f79d3ec75e6475a8ad5e16957880d3a79d2678482dd8999c33a00e04ce diff --git a/plugins/official/checkstyle/dist/plugin.wasm b/plugins/official/checkstyle/dist/plugin.wasm index fde42e596b..721bb2a2e0 100644 Binary files a/plugins/official/checkstyle/dist/plugin.wasm and b/plugins/official/checkstyle/dist/plugin.wasm differ diff --git a/plugins/official/checkstyle/dist/plugin.wasm.sources b/plugins/official/checkstyle/dist/plugin.wasm.sources index 9802afa3c9..e55b346af2 100644 --- a/plugins/official/checkstyle/dist/plugin.wasm.sources +++ b/plugins/official/checkstyle/dist/plugin.wasm.sources @@ -1 +1 @@ -c1208e0fde7b3574321067e0462d425efa8ecef8b4f837496105cf436b3c54ce +b10145d45282794b1b672480826a8dadcb65df714fa2fa652ce7a63fddc87b63 diff --git a/plugins/official/container-runner/dist/plugin.wasm b/plugins/official/container-runner/dist/plugin.wasm index e614bc45c8..a327186dd7 100644 Binary files a/plugins/official/container-runner/dist/plugin.wasm and b/plugins/official/container-runner/dist/plugin.wasm differ diff --git a/plugins/official/container-runner/dist/plugin.wasm.sources b/plugins/official/container-runner/dist/plugin.wasm.sources index 796f433cd8..9361ecb39e 100644 --- a/plugins/official/container-runner/dist/plugin.wasm.sources +++ b/plugins/official/container-runner/dist/plugin.wasm.sources @@ -1 +1 @@ -29148ede6d1b32110d96d494cd8b6d947fe81eb99f1436c5bf2b76886d9ffe55 +b40e387acf9957898f2bc88d723d4ed2e6a199aadb07bd376faf04264bf0e598 diff --git a/plugins/official/csv-editor/dist/plugin.wasm b/plugins/official/csv-editor/dist/plugin.wasm index 1bd1ff9b71..21e1231574 100644 Binary files a/plugins/official/csv-editor/dist/plugin.wasm and b/plugins/official/csv-editor/dist/plugin.wasm differ diff --git a/plugins/official/csv-editor/dist/plugin.wasm.sources b/plugins/official/csv-editor/dist/plugin.wasm.sources index 122b5a3517..61510377d7 100644 --- a/plugins/official/csv-editor/dist/plugin.wasm.sources +++ b/plugins/official/csv-editor/dist/plugin.wasm.sources @@ -1 +1 @@ -d859170efebf6a36d6c183ad449fadd45855f536b9bbd4348cd6e53aef8bf859 +e2f443f83900f9933a2015dadf3a087c63a198581dfc1545f6fcf562232858bd diff --git a/plugins/official/git-toolbox/dist/plugin.wasm b/plugins/official/git-toolbox/dist/plugin.wasm index 601211c7d3..0085b4a1e7 100644 Binary files a/plugins/official/git-toolbox/dist/plugin.wasm and b/plugins/official/git-toolbox/dist/plugin.wasm differ diff --git a/plugins/official/git-toolbox/dist/plugin.wasm.sources b/plugins/official/git-toolbox/dist/plugin.wasm.sources index 873fbef4c2..f0911ab1e7 100644 --- a/plugins/official/git-toolbox/dist/plugin.wasm.sources +++ b/plugins/official/git-toolbox/dist/plugin.wasm.sources @@ -1 +1 @@ -9cb1125bd923e2508caca8c1e05698f2af472c3675aff88115029b8c4be31082 +b82b8e8f950742a7071dfcf6e34172e8ec93615281715f2bf69e3a2aefff97b8 diff --git a/plugins/official/graphviz/dist/plugin.wasm b/plugins/official/graphviz/dist/plugin.wasm index a5771bfda3..b3b7661bf2 100644 Binary files a/plugins/official/graphviz/dist/plugin.wasm and b/plugins/official/graphviz/dist/plugin.wasm differ diff --git a/plugins/official/graphviz/dist/plugin.wasm.sources b/plugins/official/graphviz/dist/plugin.wasm.sources index c621b093e3..4a06efe1a1 100644 --- a/plugins/official/graphviz/dist/plugin.wasm.sources +++ b/plugins/official/graphviz/dist/plugin.wasm.sources @@ -1 +1 @@ -28e26a1e43811d47d9666f79c15023d808770d8e7c9ab02ddc0854c73f463e25 +ddf5ea87993b27ab875fdeb4308bc64442fa53ac5df0071c8acf4eb41fec8ead diff --git a/plugins/official/key-promoter/dist/plugin.wasm b/plugins/official/key-promoter/dist/plugin.wasm index 227b32a6e2..bf16259322 100644 Binary files a/plugins/official/key-promoter/dist/plugin.wasm and b/plugins/official/key-promoter/dist/plugin.wasm differ diff --git a/plugins/official/key-promoter/dist/plugin.wasm.sources b/plugins/official/key-promoter/dist/plugin.wasm.sources index 0de90a87f9..2462c0d550 100644 --- a/plugins/official/key-promoter/dist/plugin.wasm.sources +++ b/plugins/official/key-promoter/dist/plugin.wasm.sources @@ -1 +1 @@ -5247aaf5516a63ecc9e47ed08dab1c35aa68a8836d7ca2fe91bd26905d8514c0 +a2103495c840c9b30dd837b20e1eaa1b468aa6d6ee21b55c3b29d76ecf00a9cf diff --git a/plugins/official/license-header/dist/plugin.wasm b/plugins/official/license-header/dist/plugin.wasm index 155d925046..1b2d9d764c 100644 Binary files a/plugins/official/license-header/dist/plugin.wasm and b/plugins/official/license-header/dist/plugin.wasm differ diff --git a/plugins/official/license-header/dist/plugin.wasm.sources b/plugins/official/license-header/dist/plugin.wasm.sources index ea0ac34b8f..a5122f33cd 100644 --- a/plugins/official/license-header/dist/plugin.wasm.sources +++ b/plugins/official/license-header/dist/plugin.wasm.sources @@ -1 +1 @@ -59f8b49770e7363f6a796e62cd2d8c0a2d96b63927c19ab5c984f789d56f681b +ff36bbea6166ae076cd1103eb8d8921e29bd48f3ef8f62779ac66656664386c6 diff --git a/plugins/official/mybatis/dist/plugin.wasm b/plugins/official/mybatis/dist/plugin.wasm index 3953269258..54500607dd 100644 Binary files a/plugins/official/mybatis/dist/plugin.wasm and b/plugins/official/mybatis/dist/plugin.wasm differ diff --git a/plugins/official/mybatis/dist/plugin.wasm.sources b/plugins/official/mybatis/dist/plugin.wasm.sources index e8e2f77c49..ed87881889 100644 --- a/plugins/official/mybatis/dist/plugin.wasm.sources +++ b/plugins/official/mybatis/dist/plugin.wasm.sources @@ -1 +1 @@ -bbb09bc29440a9d2e0fe525b936ff511b67234d7674bb1d33bb1e2920a89c91e +fdd077f4383e135295065d22406f3388a79eba2248659d6be53d626d1eeaec91 diff --git a/plugins/official/regex-tester/dist/plugin.wasm b/plugins/official/regex-tester/dist/plugin.wasm index f9cf5d7af4..a9c46fd39c 100644 Binary files a/plugins/official/regex-tester/dist/plugin.wasm and b/plugins/official/regex-tester/dist/plugin.wasm differ diff --git a/plugins/official/regex-tester/dist/plugin.wasm.sources b/plugins/official/regex-tester/dist/plugin.wasm.sources index 4bb3e1fb03..ddc736f6af 100644 --- a/plugins/official/regex-tester/dist/plugin.wasm.sources +++ b/plugins/official/regex-tester/dist/plugin.wasm.sources @@ -1 +1 @@ -0806af464b1c4e6a9107149117f4813c3ea57d9652c161eb76d36f66cd9a069d +b0792925bb2663cb12442d382c6d1ec95d96cd6e99672ba17b3f6a507ff68778 diff --git a/plugins/official/solidity/dist/plugin.wasm b/plugins/official/solidity/dist/plugin.wasm index 2923021914..1af65f3c11 100644 Binary files a/plugins/official/solidity/dist/plugin.wasm and b/plugins/official/solidity/dist/plugin.wasm differ diff --git a/plugins/official/solidity/dist/plugin.wasm.sources b/plugins/official/solidity/dist/plugin.wasm.sources index 76d4d75688..8eb0d136a8 100644 --- a/plugins/official/solidity/dist/plugin.wasm.sources +++ b/plugins/official/solidity/dist/plugin.wasm.sources @@ -1 +1 @@ -6d05d004c9c0fe5ff93854b0f1dfb8fd75ac5eeae344f27363ff04d8dbc79988 +f66e7e7ede415f51b76940b6d5d695f168b9250ccbd082b94258ecd389495013 diff --git a/plugins/official/string-tools/dist/plugin.wasm b/plugins/official/string-tools/dist/plugin.wasm index 56ce40cb32..2bb1767e39 100644 Binary files a/plugins/official/string-tools/dist/plugin.wasm and b/plugins/official/string-tools/dist/plugin.wasm differ diff --git a/plugins/official/string-tools/dist/plugin.wasm.sources b/plugins/official/string-tools/dist/plugin.wasm.sources index 7ff87b8a10..c1bb10b117 100644 --- a/plugins/official/string-tools/dist/plugin.wasm.sources +++ b/plugins/official/string-tools/dist/plugin.wasm.sources @@ -1 +1 @@ -5915599ae14fc3a69149afda1e19571aedb59c03ae67de381cff29ef9f2d0a0a +76a99a2a0fbd322433b6fec6cc6c9c07e437a42e575d1d7372aed4083003c049 diff --git a/plugins/official/test-runner/dist/plugin.wasm b/plugins/official/test-runner/dist/plugin.wasm index 4fc4fdd974..96cff42f18 100644 Binary files a/plugins/official/test-runner/dist/plugin.wasm and b/plugins/official/test-runner/dist/plugin.wasm differ diff --git a/plugins/official/test-runner/dist/plugin.wasm.sources b/plugins/official/test-runner/dist/plugin.wasm.sources index 25de603787..5837210049 100644 --- a/plugins/official/test-runner/dist/plugin.wasm.sources +++ b/plugins/official/test-runner/dist/plugin.wasm.sources @@ -1 +1 @@ -04c6d1143af7045e680d81036ded46a17ef10952ff648dcbd28a6036031abcdc +838be2a4d79d2d9b64319f69920893ca485badd17a05b15e768df9ff3e77bc90 diff --git a/plugins/official/todo-finder/dist/plugin.wasm b/plugins/official/todo-finder/dist/plugin.wasm index 0f959bfd9f..c46fb1c9aa 100644 Binary files a/plugins/official/todo-finder/dist/plugin.wasm and b/plugins/official/todo-finder/dist/plugin.wasm differ diff --git a/plugins/official/todo-finder/dist/plugin.wasm.sources b/plugins/official/todo-finder/dist/plugin.wasm.sources index 967c141610..bcd986d447 100644 --- a/plugins/official/todo-finder/dist/plugin.wasm.sources +++ b/plugins/official/todo-finder/dist/plugin.wasm.sources @@ -1 +1 @@ -91b9246f2a589ce5b414240b503e711822b0592ceed4ac2e3dfe2aca377f1780 +683ccfbf2466cc37e44a8c47cca643482a642db79c51f850469cddd7af5c3b06 diff --git a/sdk/rust/openidea-plugin/src/host.rs b/sdk/rust/openidea-plugin/src/host.rs index 6160ff8054..9e485c5f6d 100644 --- a/sdk/rust/openidea-plugin/src/host.rs +++ b/sdk/rust/openidea-plugin/src/host.rs @@ -1067,6 +1067,65 @@ mod imp { pub fn lsp_notify(project: &ProjectRes, server: &str, method: &str, params: Option<&str>) -> Result<(), Error> { wit::language_servers::notify(project, server, method, params).map_err(error) } + pub fn lsp_definition(project: &ProjectRes, path: &str, at: Position) -> Result, Error> { + wit::language_servers::definition( + project, + path, + wit::types::Position { line: at.line, character: at.character }, + ) + .map(|locs| locs.into_iter().map(|l| Location { path: l.path, range: range_from(l.range) }).collect()) + .map_err(error) + } + pub fn lsp_type_definition(project: &ProjectRes, path: &str, at: Position) -> Result, Error> { + wit::language_servers::type_definition( + project, + path, + wit::types::Position { line: at.line, character: at.character }, + ) + .map(|locs| locs.into_iter().map(|l| Location { path: l.path, range: range_from(l.range) }).collect()) + .map_err(error) + } + pub fn lsp_implementations(project: &ProjectRes, path: &str, at: Position) -> Result, Error> { + wit::language_servers::implementations( + project, + path, + wit::types::Position { line: at.line, character: at.character }, + ) + .map(|locs| locs.into_iter().map(|l| Location { path: l.path, range: range_from(l.range) }).collect()) + .map_err(error) + } + pub fn lsp_references(project: &ProjectRes, path: &str, at: Position, limit: u32) -> Result, Error> { + wit::language_servers::references( + project, + path, + wit::types::Position { line: at.line, character: at.character }, + limit, + ) + .map(|locs| locs.into_iter().map(|l| Location { path: l.path, range: range_from(l.range) }).collect()) + .map_err(error) + } + pub fn lsp_hover_info(project: &ProjectRes, path: &str, at: Position) -> Result, Error> { + wit::language_servers::hover_info( + project, + path, + wit::types::Position { line: at.line, character: at.character }, + ) + .map_err(error) + } + pub fn lsp_document_symbols(project: &ProjectRes, path: &str) -> Result, Error> { + wit::language_servers::document_symbols(project, path) + .map(|syms| { + syms.into_iter() + .map(|s| SymbolInfo { + name: s.name, + kind: s.kind, + container: s.container, + location: Location { path: s.location.path, range: range_from(s.location.range) }, + }) + .collect() + }) + .map_err(error) + } pub fn build_dependencies(project: &ProjectRes, module: Option<&str>) -> Result, Error> { use wit::build::DependencyStatus as S; wit::build::dependencies(project, module) @@ -1493,6 +1552,31 @@ impl Project { imp::database_connect(&self.inner, id) } + /// Queries declaration targets at `at` through running language servers (`code.semantics`, API 1.21). + pub fn lsp_definition(&self, path: &str, at: Position) -> Result, Error> { + imp::lsp_definition(&self.inner, path, at) + } + /// Queries type definition targets at `at` through running language servers (`code.semantics`, API 1.21). + pub fn lsp_type_definition(&self, path: &str, at: Position) -> Result, Error> { + imp::lsp_type_definition(&self.inner, path, at) + } + /// Queries implementation targets at `at` through running language servers (`code.semantics`, API 1.21). + pub fn lsp_implementations(&self, path: &str, at: Position) -> Result, Error> { + imp::lsp_implementations(&self.inner, path, at) + } + /// Queries references at `at`, capped at `limit` (`code.semantics`, API 1.21). + pub fn lsp_references(&self, path: &str, at: Position, limit: u32) -> Result, Error> { + imp::lsp_references(&self.inner, path, at, limit) + } + /// Reads resolved hover/type signature Markdown at `at` (`code.semantics`, API 1.21). + pub fn lsp_hover_info(&self, path: &str, at: Position) -> Result, Error> { + imp::lsp_hover_info(&self.inner, path, at) + } + /// Reads document outline symbols for a project file or read-only `jdt://` URI (`code.semantics`, API 1.21). + pub fn lsp_document_symbols(&self, path: &str) -> Result, Error> { + imp::lsp_document_symbols(&self.inner, path) + } + /// Sends `method` to the language server named `server` (its name in the language /// definition, e.g. `phoxite`) running for this project and returns the result as /// JSON (API 1.9). `params` is JSON. Requires `lsp:` and a trusted project. diff --git a/sdk/rust/openidea-plugin/src/mock.rs b/sdk/rust/openidea-plugin/src/mock.rs index 56cab11290..7674ebc3d9 100644 --- a/sdk/rust/openidea-plugin/src/mock.rs +++ b/sdk/rust/openidea-plugin/src/mock.rs @@ -212,6 +212,12 @@ struct State { lsp_responses: BTreeMap<(String, String), String>, lsp_requests: Vec, lsp_notifications: Vec, + lsp_definitions: BTreeMap<(String, String, u32, u32), Vec>, + lsp_type_definitions: BTreeMap<(String, String, u32, u32), Vec>, + lsp_implementations: BTreeMap<(String, String, u32, u32), Vec>, + lsp_references: BTreeMap<(String, String, u32, u32), Vec>, + lsp_hovers: BTreeMap<(String, String, u32, u32), String>, + lsp_document_symbols: BTreeMap<(String, String), Vec>, mcp_stdio: Option>, extension_points: BTreeMap>, run_targets: BTreeMap<(String, String), crate::PluginRunTargetWithOverrides>, @@ -293,6 +299,7 @@ const ALL: &[&str] = &[ "clipboard.read", "java.agent", "agents", + "code.semantics", ]; impl MockHost { @@ -577,6 +584,30 @@ impl MockHost { self.state.borrow().console_rules.clone() } + pub fn set_lsp_definition(&self, root: &str, path: &str, at: Position, locs: Vec) { + self.state.borrow_mut().lsp_definitions.insert((root.into(), path.into(), at.line, at.character), locs); + } + + pub fn set_lsp_type_definition(&self, root: &str, path: &str, at: Position, locs: Vec) { + self.state.borrow_mut().lsp_type_definitions.insert((root.into(), path.into(), at.line, at.character), locs); + } + + pub fn set_lsp_implementations(&self, root: &str, path: &str, at: Position, locs: Vec) { + self.state.borrow_mut().lsp_implementations.insert((root.into(), path.into(), at.line, at.character), locs); + } + + pub fn set_lsp_references(&self, root: &str, path: &str, at: Position, locs: Vec) { + self.state.borrow_mut().lsp_references.insert((root.into(), path.into(), at.line, at.character), locs); + } + + pub fn set_lsp_hover(&self, root: &str, path: &str, at: Position, markdown: &str) { + self.state.borrow_mut().lsp_hovers.insert((root.into(), path.into(), at.line, at.character), markdown.into()); + } + + pub fn set_lsp_document_symbols(&self, root: &str, path: &str, symbols: Vec) { + self.state.borrow_mut().lsp_document_symbols.insert((root.into(), path.into()), symbols); + } + pub fn context_keys(&self) -> BTreeMap { self.state.borrow().context.clone() } @@ -2972,6 +3003,75 @@ pub mod current { answer.ok_or_else(|| Error::Failed(format!("{server}: method not found: {method}"))) }) } + pub fn lsp_definition(project: &ProjectRes, path: &str, at: Position) -> Result, Error> { + with(|s| { + require(s, "code.semantics")?; + if s.restricted { + return Err(Error::Denied("project is not trusted".into())); + } + Ok(s.lsp_definitions + .get(&(project.root.clone(), path.into(), at.line, at.character)) + .cloned() + .unwrap_or_default()) + }) + } + pub fn lsp_type_definition(project: &ProjectRes, path: &str, at: Position) -> Result, Error> { + with(|s| { + require(s, "code.semantics")?; + if s.restricted { + return Err(Error::Denied("project is not trusted".into())); + } + Ok(s.lsp_type_definitions + .get(&(project.root.clone(), path.into(), at.line, at.character)) + .cloned() + .unwrap_or_default()) + }) + } + pub fn lsp_implementations(project: &ProjectRes, path: &str, at: Position) -> Result, Error> { + with(|s| { + require(s, "code.semantics")?; + if s.restricted { + return Err(Error::Denied("project is not trusted".into())); + } + Ok(s.lsp_implementations + .get(&(project.root.clone(), path.into(), at.line, at.character)) + .cloned() + .unwrap_or_default()) + }) + } + pub fn lsp_references(project: &ProjectRes, path: &str, at: Position, limit: u32) -> Result, Error> { + with(|s| { + require(s, "code.semantics")?; + if s.restricted { + return Err(Error::Denied("project is not trusted".into())); + } + let mut out = s + .lsp_references + .get(&(project.root.clone(), path.into(), at.line, at.character)) + .cloned() + .unwrap_or_default(); + out.truncate(limit as usize); + Ok(out) + }) + } + pub fn lsp_hover_info(project: &ProjectRes, path: &str, at: Position) -> Result, Error> { + with(|s| { + require(s, "code.semantics")?; + if s.restricted { + return Err(Error::Denied("project is not trusted".into())); + } + Ok(s.lsp_hovers.get(&(project.root.clone(), path.into(), at.line, at.character)).cloned()) + }) + } + pub fn lsp_document_symbols(project: &ProjectRes, path: &str) -> Result, Error> { + with(|s| { + require(s, "code.semantics")?; + if s.restricted { + return Err(Error::Denied("project is not trusted".into())); + } + Ok(s.lsp_document_symbols.get(&(project.root.clone(), path.into())).cloned().unwrap_or_default()) + }) + } /// The module roots matching `module` (`group:artifact`, or a Gradle path) and what is /// under them, with `parent` renumbered. pub fn build_dependencies(_project: &ProjectRes, module: Option<&str>) -> Result, Error> { diff --git a/sdk/rust/openidea-plugin/tests/api21_code_semantics.rs b/sdk/rust/openidea-plugin/tests/api21_code_semantics.rs new file mode 100644 index 0000000000..8fb70198e6 --- /dev/null +++ b/sdk/rust/openidea-plugin/tests/api21_code_semantics.rs @@ -0,0 +1,40 @@ +use openidea_plugin::{Error, Location, Position, Range, SymbolInfo, host, mock::MockHost}; + +#[test] +fn semantic_queries_enforce_capability_and_trust_and_round_trip() { + let mock = MockHost::install().with_capabilities(&[]); + mock.add_project("/proj"); + let p = host::project_of("/proj").unwrap(); + let err = p.lsp_definition("src/Main.java", Position::new(1, 2)).unwrap_err(); + assert!(matches!(err, Error::Denied(_)), "expected Denied, got {err:?}"); + + let mock = MockHost::install().with_capabilities(&["code.semantics"]); + mock.add_project("/proj"); + let p = host::project_of("/proj").unwrap(); + let loc = + Location { path: "/proj/src/Target.java".into(), range: Range::new(Position::new(3, 0), Position::new(3, 6)) }; + mock.set_lsp_definition("/proj", "src/Main.java", Position::new(1, 2), vec![loc.clone()]); + mock.set_lsp_type_definition("/proj", "src/Main.java", Position::new(1, 2), vec![loc.clone()]); + mock.set_lsp_implementations("/proj", "src/Main.java", Position::new(1, 2), vec![loc.clone()]); + mock.set_lsp_references("/proj", "src/Main.java", Position::new(1, 2), vec![loc.clone(), loc.clone()]); + mock.set_lsp_hover("/proj", "src/Main.java", Position::new(1, 2), "class Target"); + mock.set_lsp_document_symbols( + "/proj", + "jdt://contents/Target.class", + vec![SymbolInfo { name: "Target".into(), kind: "class".into(), container: None, location: loc }], + ); + + mock.set_restricted(true); + let restricted = p.lsp_hover_info("src/Main.java", Position::new(1, 2)).unwrap_err(); + assert!(matches!(restricted, Error::Denied(_)), "expected restricted Denied, got {restricted:?}"); + + mock.set_restricted(false); + assert_eq!(p.lsp_definition("src/Main.java", Position::new(1, 2)).unwrap().len(), 1); + assert_eq!(p.lsp_type_definition("src/Main.java", Position::new(1, 2)).unwrap().len(), 1); + assert_eq!(p.lsp_implementations("src/Main.java", Position::new(1, 2)).unwrap().len(), 1); + assert_eq!(p.lsp_references("src/Main.java", Position::new(1, 2), 1).unwrap().len(), 1); + assert_eq!(p.lsp_hover_info("src/Main.java", Position::new(1, 2)).unwrap().as_deref(), Some("class Target")); + let syms = p.lsp_document_symbols("jdt://contents/Target.class").unwrap(); + assert_eq!(syms.len(), 1); + assert_eq!(syms[0].name, "Target"); +} diff --git a/sdk/rust/openidea-plugin/wit/host.wit b/sdk/rust/openidea-plugin/wit/host.wit index cfce1430bf..de2c376267 100644 --- a/sdk/rust/openidea-plugin/wit/host.wit +++ b/sdk/rust/openidea-plugin/wit/host.wit @@ -218,10 +218,10 @@ interface command-runner { execute: func(id: string, arg: option) -> result, error>; } -/// Requests to the language servers the IDE runs (API 1.9). +/// Requests and read-only semantic queries against running IDE language servers (API 1.9; semantic queries API 1.21). interface language-servers { - use types.{error}; - use workspace.{project}; + use types.{error, location, position}; + use workspace.{project, symbol-info}; /// Sends `method` to the server named `server` (the `name` of its /// `[[language-servers]]` entry in the language definition, e.g. `phoxite`) @@ -243,6 +243,24 @@ interface language-servers { /// The same for a notification: no answer is awaited. notify: func(project: borrow, server: string, method: string, params: option) -> result<_, error>; + + /// Resolves declaration targets at `at` through running language servers (`code.semantics`, API 1.21). + definition: func(project: borrow, path: string, at: position) -> result, error>; + + /// Resolves type definition targets at `at` through running language servers (`code.semantics`, API 1.21). + type-definition: func(project: borrow, path: string, at: position) -> result, error>; + + /// Resolves implementation targets at `at` through running language servers (`code.semantics`, API 1.21). + implementations: func(project: borrow, path: string, at: position) -> result, error>; + + /// Finds references at `at`, capped at `limit` (`code.semantics`, API 1.21). + references: func(project: borrow, path: string, at: position, limit: u32) -> result, error>; + + /// Reads resolved hover / type signature Markdown at `at` (`code.semantics`, API 1.21). + hover-info: func(project: borrow, path: string, at: position) -> result, error>; + + /// Reads document outline symbols for a project path or read-only `jdt://` URI (`code.semantics`, API 1.21). + document-symbols: func(project: borrow, path: string) -> result, error>; } /// Per-plugin named, read-only Output tabs (API 1.4), with a 1 MiB UTF-8 ring buffer. diff --git a/src/platform/locales/text/en.json b/src/platform/locales/text/en.json index 232dc2f21b..11f389cc36 100644 --- a/src/platform/locales/text/en.json +++ b/src/platform/locales/text/en.json @@ -5703,5 +5703,6 @@ "plugin {pluginId}: {e}": "plugin {pluginId}: {e}", "This build of {display} has expired and stops working soon. Choose a newer build in Language Servers.": "This build of {display} has expired and stops working soon. Choose a newer build in Language Servers.", "This build of {display} has expired and stops working soon. Update it to the latest release?": "This build of {display} has expired and stops working soon. Update it to the latest release?", - "This build of {display} has expired and stops working soon. Install the latest release for the IDE? It is used instead of {path}.": "This build of {display} has expired and stops working soon. Install the latest release for the IDE? It is used instead of {path}." + "This build of {display} has expired and stops working soon. Install the latest release for the IDE? It is used instead of {path}.": "This build of {display} has expired and stops working soon. Install the latest release for the IDE? It is used instead of {path}.", + "Query language server symbol definitions, types, references and outlines in trusted projects": "Query language server symbol definitions, types, references and outlines in trusted projects" } diff --git a/src/platform/locales/text/zh.json b/src/platform/locales/text/zh.json index 7decb5b59a..d5b0109d78 100644 --- a/src/platform/locales/text/zh.json +++ b/src/platform/locales/text/zh.json @@ -12605,5 +12605,6 @@ "plugin {pluginId}: {e}": "插件 {pluginId}:{e}", "This build of {display} has expired and stops working soon. Choose a newer build in Language Servers.": "此版本的 {display} 已过期,很快将停止工作。请在“语言服务器”中选择更新的版本。", "This build of {display} has expired and stops working soon. Update it to the latest release?": "此版本的 {display} 已过期,很快将停止工作。要更新到最新版本吗?", - "This build of {display} has expired and stops working soon. Install the latest release for the IDE? It is used instead of {path}.": "此版本的 {display} 已过期,很快将停止工作。要为 IDE 安装最新版本吗?安装后将代替 {path} 使用。" + "This build of {display} has expired and stops working soon. Install the latest release for the IDE? It is used instead of {path}.": "此版本的 {display} 已过期,很快将停止工作。要为 IDE 安装最新版本吗?安装后将代替 {path} 使用。", + "Query language server symbol definitions, types, references and outlines in trusted projects": "在受信任的项目中查询语言服务器给出的符号定义、类型、引用和大纲" } diff --git a/wit/host.wit b/wit/host.wit index cfce1430bf..de2c376267 100644 --- a/wit/host.wit +++ b/wit/host.wit @@ -218,10 +218,10 @@ interface command-runner { execute: func(id: string, arg: option) -> result, error>; } -/// Requests to the language servers the IDE runs (API 1.9). +/// Requests and read-only semantic queries against running IDE language servers (API 1.9; semantic queries API 1.21). interface language-servers { - use types.{error}; - use workspace.{project}; + use types.{error, location, position}; + use workspace.{project, symbol-info}; /// Sends `method` to the server named `server` (the `name` of its /// `[[language-servers]]` entry in the language definition, e.g. `phoxite`) @@ -243,6 +243,24 @@ interface language-servers { /// The same for a notification: no answer is awaited. notify: func(project: borrow, server: string, method: string, params: option) -> result<_, error>; + + /// Resolves declaration targets at `at` through running language servers (`code.semantics`, API 1.21). + definition: func(project: borrow, path: string, at: position) -> result, error>; + + /// Resolves type definition targets at `at` through running language servers (`code.semantics`, API 1.21). + type-definition: func(project: borrow, path: string, at: position) -> result, error>; + + /// Resolves implementation targets at `at` through running language servers (`code.semantics`, API 1.21). + implementations: func(project: borrow, path: string, at: position) -> result, error>; + + /// Finds references at `at`, capped at `limit` (`code.semantics`, API 1.21). + references: func(project: borrow, path: string, at: position, limit: u32) -> result, error>; + + /// Reads resolved hover / type signature Markdown at `at` (`code.semantics`, API 1.21). + hover-info: func(project: borrow, path: string, at: position) -> result, error>; + + /// Reads document outline symbols for a project path or read-only `jdt://` URI (`code.semantics`, API 1.21). + document-symbols: func(project: borrow, path: string) -> result, error>; } /// Per-plugin named, read-only Output tabs (API 1.4), with a 1 MiB UTF-8 ring buffer.