mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 16:04:21 +00:00
feat(plugins): API 1.14 hover actions (#4544)
Adds the optional hover-actions export (plugin API 1.14): plugins contribute a host-rendered action at the left edge of an editor line, revealed by hovering the first four columns of any line in its start-line..end-line range and anchored to its declaration line. The host keeps it left of the line's text, out of the intention bulb's row, never takes focus on hover, collapses several actions into an overflow menu, and lists them in the editor context menu for keyboard access. SDK HoverActions, a minimal fixture, API-compat tests, docs and regenerated components. Review fixes: the button is positioned on its first show (it was left unpositioned until the next mouse move), the styles use theme tokens, the overflow menu is the shared context menu, and the labels go through the text catalog. Co-authored-by: NeverKnowsTomorrow <36879844+NeverKnowsTomorrow@users.noreply.github.com>
This commit is contained in:
@@ -34,7 +34,7 @@ use std::path::{Component, Path, PathBuf};
|
||||
|
||||
pub const MANIFEST_FILE: &str = "plugin.toml";
|
||||
/// The plugin API (engine) version this host implements.
|
||||
pub const ENGINE_VERSION: &str = "1.13.0";
|
||||
pub const ENGINE_VERSION: &str = "1.14.0";
|
||||
/// The 0.1 API, still accepted for contribution-only packages and 0.1 components.
|
||||
pub const LEGACY_API: &str = "0.1";
|
||||
/// Marketplace categories, in the order they are shown.
|
||||
|
||||
@@ -1976,6 +1976,7 @@ pub struct PluginLanguageVisuals {
|
||||
pub injections: Vec<ide_plugin::language_features::Injection>,
|
||||
pub colors: Vec<(String, ide_plugin::language_features::ColorInfo)>,
|
||||
pub gutter_actions: Vec<(String, ide_plugin::language_features::GutterAction)>,
|
||||
pub hover_actions: Vec<(String, ide_plugin::language_features::HoverAction)>,
|
||||
}
|
||||
#[command(trust = trusted)]
|
||||
pub async fn plugin_language_visuals(host: &Host, window: &str, doc: DocId) -> IdeResult<PluginLanguageVisuals> {
|
||||
@@ -1989,14 +1990,20 @@ pub async fn plugin_language_visuals(host: &Host, window: &str, doc: DocId) -> I
|
||||
version: u64::from(snap.version),
|
||||
text: snap.text,
|
||||
};
|
||||
let mut out =
|
||||
PluginLanguageVisuals { version: d.version, injections: vec![], colors: vec![], gutter_actions: vec![] };
|
||||
let mut out = PluginLanguageVisuals {
|
||||
version: d.version,
|
||||
injections: vec![],
|
||||
colors: vec![],
|
||||
gutter_actions: vec![],
|
||||
hover_actions: vec![],
|
||||
};
|
||||
if d.text.len() <= crate::plugins::navigation::MAX_DOCUMENT_BYTES
|
||||
&& let Some(plugins) = crate::plugins::editor_plugin_host()
|
||||
{
|
||||
out.injections = plugins.provide_injections(&d);
|
||||
out.colors = plugins.language_colors(&d);
|
||||
out.gutter_actions = plugins.language_gutter_actions(&d);
|
||||
out.hover_actions = plugins.language_hover_actions(&d);
|
||||
}
|
||||
project.lsp.set_injections_at(
|
||||
doc,
|
||||
|
||||
@@ -276,6 +276,34 @@ impl PluginHost {
|
||||
}
|
||||
out
|
||||
}
|
||||
/// Optional API 1.14 hover actions. Only plugins declaring the
|
||||
/// `hover-actions` provider kind are asked; the released language-features
|
||||
/// export remains unchanged.
|
||||
pub fn language_hover_actions(&self, doc: &ProviderDocument) -> Vec<(String, HoverAction)> {
|
||||
let mut out = Vec::new();
|
||||
for (d, _bounds) in self.feature_documents(doc, None) {
|
||||
let snapshot = d.clone();
|
||||
let text = ide_text::Document::new(&snapshot.text);
|
||||
let d = Arc::new(d);
|
||||
let results = self
|
||||
.document_calls(ProviderKind::HoverActions, &snapshot, move |rt, t| rt.language_hover_actions(&d, t));
|
||||
for (p, items) in results {
|
||||
let commands: std::collections::HashSet<_> =
|
||||
self.ui.items(super::COMMANDS, Some(p.id())).into_iter().map(|c| c.key).collect();
|
||||
for i in items {
|
||||
let lines = text.line_count();
|
||||
let anchor_ok = i.line < lines;
|
||||
let range_ok = i.start_line <= i.end_line && i.end_line < lines;
|
||||
let contains_anchor = i.start_line <= i.line && i.line <= i.end_line;
|
||||
if anchor_ok && range_ok && contains_anchor && commands.contains(&i.command) {
|
||||
out.push((p.id().to_owned(), i));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
pub fn language_gutter_actions(&self, doc: &ProviderDocument) -> Vec<(String, GutterAction)> {
|
||||
let mut out = Vec::new();
|
||||
for (d, bounds) in self.feature_documents(doc, None) {
|
||||
|
||||
@@ -54,6 +54,7 @@ pub enum ProviderKind {
|
||||
Implementation,
|
||||
TypeDefinition,
|
||||
GutterActions,
|
||||
HoverActions,
|
||||
Injections,
|
||||
}
|
||||
|
||||
@@ -204,11 +205,15 @@ impl ExtensionPoint for ProvidersPoint {
|
||||
| ProviderKind::Implementation
|
||||
| ProviderKind::TypeDefinition
|
||||
| ProviderKind::GutterActions
|
||||
| ProviderKind::HoverActions
|
||||
| ProviderKind::Injections
|
||||
)
|
||||
}) {
|
||||
pkg.manifest.needs_api("contributes.providers: language features and injections", 4)?;
|
||||
}
|
||||
if d.kinds.contains(&ProviderKind::HoverActions) {
|
||||
pkg.manifest.needs_api("contributes.providers: hover-actions", 14)?;
|
||||
}
|
||||
for l in &d.languages {
|
||||
if l != "*"
|
||||
&& (l.is_empty()
|
||||
|
||||
@@ -152,6 +152,9 @@ async fn editor_ops_merge_the_fixture_format_selection_and_execute_owned_command
|
||||
let visuals = ops::lsp::plugin_language_visuals(&host, "main", doc.id).await.unwrap();
|
||||
assert_eq!(visuals.colors.len(), 1);
|
||||
assert_eq!(visuals.gutter_actions.len(), 1);
|
||||
assert_eq!(visuals.hover_actions.len(), 1);
|
||||
assert_eq!(visuals.hover_actions[0].1.command, "run");
|
||||
assert_eq!(visuals.hover_actions[0].1.end_line, 2);
|
||||
assert_eq!(
|
||||
ops::lsp::plugin_color_presentations(&host, "main", doc.id, ID.into(), visuals.colors[0].1.clone())
|
||||
.await
|
||||
|
||||
@@ -100,6 +100,22 @@ pub struct GutterAction {
|
||||
pub command: String,
|
||||
pub argument: Option<String>,
|
||||
}
|
||||
/// An action rendered at the left edge of a line and revealed by hover.
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Type)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct HoverAction {
|
||||
/// The line the button is drawn on; normally the declaration line.
|
||||
pub line: u32,
|
||||
/// First line whose leftmost strip reveals this action, inclusive.
|
||||
pub start_line: u32,
|
||||
/// Last line whose leftmost strip reveals this action, inclusive.
|
||||
pub end_line: u32,
|
||||
pub icon: Option<String>,
|
||||
pub label: String,
|
||||
pub tooltip: Option<String>,
|
||||
pub command: String,
|
||||
pub argument: Option<String>,
|
||||
}
|
||||
/// Injection data.
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Type)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
||||
@@ -16,6 +16,7 @@ use crate::types::{
|
||||
FieldValue, ServiceLog, ServiceLogToggle, ServicePane, ServiceTab, TableSort, View, ViewBody, ViewButton,
|
||||
ViewEvent, ViewField, ViewListItem, ViewTable, ViewTreeItem, Viewport,
|
||||
};
|
||||
use crate::wit_host::hover_actions_bindings::exports::openidea::plugin::hover_actions as wit_hia;
|
||||
use crate::wit_host::injections_bindings::exports::openidea::plugin::injections as wit_inj;
|
||||
use crate::wit_host::language_features_bindings::exports::openidea::plugin::language_features as wit_lf;
|
||||
use crate::wit_host::run_target_validation_bindings::exports::openidea::plugin::run_target_validation as wit_rtv;
|
||||
@@ -57,7 +58,7 @@ use views_bindings::exports::openidea::plugin::view_provider as wit_view;
|
||||
use views_bindings::openidea::plugin::view_types as wit_vt;
|
||||
|
||||
/// The API version of the world above, `major.minor` of [`host_api`].
|
||||
pub const API_VERSION: &str = "1.13";
|
||||
pub const API_VERSION: &str = "1.14";
|
||||
const EPOCH_TICK: Duration = Duration::from_millis(10);
|
||||
pub(crate) const MAX_TEXT: usize = 1 << 20;
|
||||
/// The most text, and the most PNG bytes, `ui.read-clipboard` returns.
|
||||
@@ -1049,6 +1050,7 @@ struct Exports {
|
||||
inlay: Option<wit_inlay::Guest>,
|
||||
endpoints: Option<wit_endpoints::Guest>,
|
||||
search: Option<wit_search::Guest>,
|
||||
hover_actions: Option<wit_hia::Guest>,
|
||||
run_configurations: Option<wit_configs::Guest>,
|
||||
launch_configurations: Option<wit_launch::Guest>,
|
||||
test_results: Option<wit_tests::Guest>,
|
||||
@@ -1190,6 +1192,7 @@ impl Runtime {
|
||||
let inlay_indices = wit_inlay::GuestIndices::new(&pre).ok();
|
||||
let endpoint_indices = wit_endpoints::GuestIndices::new(&pre).ok();
|
||||
let search_indices = wit_search::GuestIndices::new(&pre).ok();
|
||||
let hover_actions_indices = wit_hia::GuestIndices::new(&pre).ok();
|
||||
let configs_indices = wit_configs::GuestIndices::new(&pre).ok();
|
||||
let launch_indices = wit_launch::GuestIndices::new(&pre).ok();
|
||||
let tests_indices = wit_tests::GuestIndices::new(&pre).ok();
|
||||
@@ -1255,6 +1258,8 @@ impl Runtime {
|
||||
None => None,
|
||||
};
|
||||
let search = search_indices.map(|i| i.load(&mut store, &instance)).transpose().map_err(api_hint)?;
|
||||
let hover_actions =
|
||||
hover_actions_indices.map(|i| i.load(&mut store, &instance)).transpose().map_err(api_hint)?;
|
||||
let endpoints = match endpoint_indices {
|
||||
Some(indices) => Some(indices.load(&mut store, &instance).map_err(api_hint)?),
|
||||
None => None,
|
||||
@@ -1278,6 +1283,7 @@ impl Runtime {
|
||||
inlay,
|
||||
endpoints,
|
||||
search,
|
||||
hover_actions,
|
||||
run_configurations,
|
||||
launch_configurations,
|
||||
test_results,
|
||||
@@ -2616,6 +2622,19 @@ fn gutter_action_from(v: wit_lf::GutterAction) -> crate::language_features::Gutt
|
||||
argument: v.argument.map(|v| crate::runtime::clip(v, 65536)),
|
||||
}
|
||||
}
|
||||
fn hover_action_from(v: wit_hia::HoverAction) -> crate::language_features::HoverAction {
|
||||
crate::language_features::HoverAction {
|
||||
line: v.line,
|
||||
start_line: v.start_line,
|
||||
end_line: v.end_line,
|
||||
icon: v.icon.map(|v| crate::runtime::clip(v, 65536)),
|
||||
label: crate::runtime::clip(v.label, 65536),
|
||||
tooltip: v.tooltip.map(|v| crate::runtime::clip(v, 65536)),
|
||||
command: crate::runtime::clip(v.command, 65536),
|
||||
argument: v.argument.map(|v| crate::runtime::clip(v, 65536)),
|
||||
}
|
||||
}
|
||||
|
||||
fn parameter_label_from(v: wit_lf::ParameterLabel) -> crate::language_features::ParameterLabel {
|
||||
use crate::language_features::ParameterLabel as P;
|
||||
match v {
|
||||
@@ -2844,6 +2863,30 @@ impl Runtime {
|
||||
let result = self.language_feature_call(timeout, |p, s| p.call_gutter_actions(s, &d))?;
|
||||
Ok(result.into_iter().take(10000).map(gutter_action_from).collect())
|
||||
}
|
||||
pub fn has_hover_actions(&self) -> bool {
|
||||
self.exports.hover_actions.is_some()
|
||||
}
|
||||
|
||||
pub fn language_hover_actions(
|
||||
&mut self,
|
||||
doc: &ProviderDocument,
|
||||
timeout: Duration,
|
||||
) -> Result<Vec<crate::language_features::HoverAction>, CallError> {
|
||||
if self.exports.hover_actions.is_none() {
|
||||
return Err(CallError::missing_export("hover-actions"));
|
||||
}
|
||||
let d = wit_hia::Document {
|
||||
path: to_ipc(&doc.path),
|
||||
language: doc.language.clone(),
|
||||
version: doc.version,
|
||||
text: doc.text.clone(),
|
||||
};
|
||||
let result = self.call(Invocation::default(), timeout, |exports, store| {
|
||||
exports.hover_actions.as_ref().expect("checked").call_hover_actions(store, &d)
|
||||
})?;
|
||||
Ok(result.into_iter().take(10_000).map(hover_action_from).collect())
|
||||
}
|
||||
|
||||
pub fn provide_injections(
|
||||
&mut self,
|
||||
doc: &ProviderDocument,
|
||||
|
||||
@@ -72,6 +72,46 @@ pub(crate) mod syntax_bindings {
|
||||
});
|
||||
}
|
||||
|
||||
/// The optional `hover-actions` export, bound on its own when present.
|
||||
pub(crate) mod hover_actions_bindings {
|
||||
wasmtime::component::bindgen!({
|
||||
world: "plugin-hover-actions",
|
||||
path: "../../wit",
|
||||
imports: { default: trappable },
|
||||
with: {
|
||||
"openidea:plugin/types": super::bindings::openidea::plugin::types,
|
||||
"openidea:plugin/log": super::bindings::openidea::plugin::log,
|
||||
"openidea:plugin/ui": super::bindings::openidea::plugin::ui,
|
||||
"openidea:plugin/storage": super::bindings::openidea::plugin::storage,
|
||||
"openidea:plugin/workspace": super::bindings::openidea::plugin::workspace,
|
||||
"openidea:plugin/editor": super::bindings::openidea::plugin::editor,
|
||||
"openidea:plugin/decorations": super::bindings::openidea::plugin::decorations,
|
||||
"openidea:plugin/invocation": super::bindings::openidea::plugin::invocation,
|
||||
"openidea:plugin/vcs": super::bindings::openidea::plugin::vcs,
|
||||
"openidea:plugin/build": super::bindings::openidea::plugin::build,
|
||||
"openidea:plugin/commit": super::bindings::openidea::plugin::commit,
|
||||
"openidea:plugin/events": super::bindings::openidea::plugin::events,
|
||||
"openidea:plugin/tasks": super::bindings::openidea::plugin::tasks,
|
||||
"openidea:plugin/diagnostics": super::bindings::openidea::plugin::diagnostics,
|
||||
"openidea:plugin/net": super::bindings::openidea::plugin::net,
|
||||
"openidea:plugin/secrets": super::bindings::openidea::plugin::secrets,
|
||||
"openidea:plugin/run": super::bindings::openidea::plugin::run,
|
||||
"openidea:plugin/process": super::bindings::openidea::plugin::process,
|
||||
"openidea:plugin/output": super::bindings::openidea::plugin::output,
|
||||
"openidea:plugin/auth": super::bindings::openidea::plugin::auth,
|
||||
"openidea:plugin/command-runner": super::bindings::openidea::plugin::command_runner,
|
||||
"openidea:plugin/language-servers": super::bindings::openidea::plugin::language_servers,
|
||||
"openidea:plugin/ipc": super::bindings::openidea::plugin::ipc,
|
||||
"openidea:plugin/fs": super::bindings::openidea::plugin::fs,
|
||||
"openidea:plugin/views": super::bindings::openidea::plugin::views,
|
||||
"openidea:plugin/settings": super::bindings::openidea::plugin::settings,
|
||||
"openidea:plugin/database": super::bindings::openidea::plugin::database,
|
||||
"openidea:plugin/mcp": super::bindings::openidea::plugin::mcp,
|
||||
"openidea:plugin/extensions": super::bindings::openidea::plugin::extensions,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/// The optional `providers` export.
|
||||
pub(crate) mod providers_bindings {
|
||||
wasmtime::component::bindgen!({
|
||||
|
||||
@@ -33,6 +33,7 @@ fn components() -> Vec<PathBuf> {
|
||||
repo().join("crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm"),
|
||||
repo().join("crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm"),
|
||||
repo().join("crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm"),
|
||||
repo().join("crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm"),
|
||||
repo().join("crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm"),
|
||||
repo().join("crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm"),
|
||||
repo().join("crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm"),
|
||||
@@ -92,7 +93,7 @@ fn the_sdk_carries_the_hosts_wit() {
|
||||
|
||||
#[test]
|
||||
fn the_version_check_runs_compatible_components_and_explains_the_rest() {
|
||||
let host = v("1.13.0");
|
||||
let host = v("1.14.0");
|
||||
for ok in [
|
||||
"1.0.0",
|
||||
"1.3.0",
|
||||
@@ -106,15 +107,16 @@ fn the_version_check_runs_compatible_components_and_explains_the_rest() {
|
||||
"1.11.0",
|
||||
"1.12.0",
|
||||
"1.13.0",
|
||||
"1.14.0",
|
||||
"1.0.0-rc.1",
|
||||
] {
|
||||
assert_eq!(check_api(&v(ok), &host), Ok(()), "{ok}");
|
||||
}
|
||||
let newer = check_api(&v("1.14.0"), &host).unwrap_err();
|
||||
assert!(newer.contains("1.13") && newer.contains("update OpenIDEA"), "{newer}");
|
||||
let newer = check_api(&v("1.15.0"), &host).unwrap_err();
|
||||
assert!(newer.contains("1.15") && newer.contains("update OpenIDEA"), "{newer}");
|
||||
assert!(check_api(&v("2.0.0"), &host).unwrap_err().contains("update OpenIDEA"));
|
||||
let older = check_api(&v("0.2.0"), &host).unwrap_err();
|
||||
assert!(older.contains("rebuild it with the 1.13 SDK"), "{older}");
|
||||
assert!(older.contains("rebuild it with the 1.14 SDK"), "{older}");
|
||||
// 0.x: every minor is its own API.
|
||||
assert_eq!(check_api(&v("0.2.0"), &v("0.2.5")), Ok(()));
|
||||
assert!(check_api(&v("0.1.0"), &v("0.2.0")).is_err());
|
||||
@@ -141,6 +143,21 @@ fn shipped_components_are_built_for_this_api() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_1_14_component_exports_the_optional_hover_actions_world() {
|
||||
let engine = PluginEngine::new().unwrap();
|
||||
let component =
|
||||
engine.compile(&repo().join("crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm")).unwrap();
|
||||
let exports: Vec<String> =
|
||||
component.component_type().exports(engine.engine()).map(|(name, _)| name.to_owned()).collect();
|
||||
assert!(exports.iter().any(|name| name.starts_with("openidea:plugin/hover-actions@1.14.0")), "{exports:?}");
|
||||
// A 1.13-compatible plugin that does not export the new world stays valid.
|
||||
let old = engine.compile(&repo().join("plugins/official/test-runner/dist/plugin.wasm")).unwrap();
|
||||
let old_exports: Vec<String> =
|
||||
old.component_type().exports(engine.engine()).map(|(name, _)| name.to_owned()).collect();
|
||||
assert!(!old_exports.iter().any(|name| name.starts_with("openidea:plugin/hover-actions")));
|
||||
}
|
||||
|
||||
// --- a later host, simulated -------------------------------------------------------------
|
||||
|
||||
struct Data {
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
1e2844d1172750841afd4ba2a8b811522e90522588b1330474207468cbf2a3df
|
||||
ffc03214c22ab2e732255f56e7d434adb8119094ad706bc395c4c045c4057053
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
c4d00fe3170a0159e56af61fe715ffb892755cce17cdae5ecb1355fd8e90189e
|
||||
8eaf0a89d176151d71eccd2b67c9793d68c254c5f82fdc70fc8d31e78b4f977b
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
ce791decf9a771b43872777a5c97050d9b7b48f5dd0ba0342ad0580bceb93d8c
|
||||
a65bcaee7be6c24e14e2a0d4daa7d6d9ee2785680c09f35e93696b25fc4d0625
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
f8e768db576e717ec00696098faa3434e9cea0680a1770f303bc071206727607
|
||||
799abbd34c0faa68a4ea16c0d5b8e18a6df667b18d47c5467d78921ba8d1903a
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
2bd0f9e7f3ca03410389d0b125372eb322fae411272b597795cbd77ea894076d
|
||||
0dcd6097bf7c0c89dc334b3acf203bf4c5611914beb201413f148d58a1cb32ff
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
30dee06cb90e54e7d930996569a3d44e9c9013077c2439880f99e1c99e15cf58
|
||||
d1671c61724b2b56902b4476d831ccb41bdff2da644d00ca3b8fff962bdf529b
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
63772fa0f67274c5326a162340aa773c54bd08d0233c726213feedc827bd1a6c
|
||||
82c878059800ffd425adabb88a273b0e877ca7046b621235762f4db31488e5d6
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
910d62d7f53480961b8c25b5e8d6300bee3fc0e413f35d3b7d78d6e238c65387
|
||||
88f90bb030b3e58ae52cdb7c665e254bda12fce812944e0ebd952923ad380834
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
b05e1146eb97d5c787c826206b0d2257d1390f21a87501efa8901de3f5cb6017
|
||||
8e04459a5e453c4bc8746bfb5d13317b6a56d09aec28f6025be36421f79e6865
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
aa14bcafa1009b014ba2ca754711fc3b19149ff05dfefddd10edb94d16551c3d
|
||||
c0aea41383801b3ed39ed1177ffcb40b818e6e259c577a90f1a689332be37195
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
3c0d0aa400e83c2f8e77fbec32277a23af290d4469d62d5c0046923ee7ae2c49
|
||||
2ec59dc4be1d8f50e24e9e179c37ae95176d85f0feed49741bfdbb9c457b9343
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
a1a3f1691d6d7e837f893580f75935bf83a6c0ae9224ac832c9401885f9ef504
|
||||
73d82deae2acdccf346cc8a78670abd6076b79d13b5a32a0b72d6fc337707672
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
97f80158eda60e5b34e4760607cfdf5c8f22debf49e438a4b3fffaf7184ad59e
|
||||
28d198f98b792316019f0c03873274938f961edbafd625babe31cb5dccb40db5
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
7eff77b3997303adab7b8ef7999b563325e333f0696c63e1a6505579a2a41070
|
||||
c9145df209a7a969c17a041f30d4fe2ffc12e4ce941b318212c904c47e90edef
|
||||
|
||||
+336
@@ -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.104"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
|
||||
|
||||
[[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.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
|
||||
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-hover-actions"
|
||||
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"
|
||||
@@ -0,0 +1,20 @@
|
||||
[package]
|
||||
name = "openidea-test-hover-actions"
|
||||
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"
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
ef50da6bb4eb37f1e81055212e7e8ffb0587bd24a9cbcbe0b318e5847c11e0b3
|
||||
@@ -0,0 +1,14 @@
|
||||
id = "test.hover-actions"
|
||||
name = "Hover actions fixture"
|
||||
version = "0.1.0"
|
||||
engines.openidea = "^1.14"
|
||||
wasm = "dist/plugin.wasm"
|
||||
|
||||
[[contributes.providers]]
|
||||
kinds = ["hover-actions"]
|
||||
languages = ["plaintext", "text"]
|
||||
|
||||
[[contributes.commands]]
|
||||
id = "run"
|
||||
title = "Run hover action"
|
||||
icon = "run"
|
||||
@@ -0,0 +1,32 @@
|
||||
//! Minimal API 1.13 fixture for the optional `hover-actions` export.
|
||||
use openidea_plugin::language_features::Document;
|
||||
use openidea_plugin::{Error, HoverAction, HoverActions, Invocation, Plugin, register_plugin};
|
||||
|
||||
#[derive(Default)]
|
||||
struct Fixture;
|
||||
|
||||
impl Plugin for Fixture {
|
||||
fn run_command(&mut self, id: &str, _: &Invocation, arg: Option<&str>) -> Result<Option<String>, Error> {
|
||||
match id {
|
||||
"run" => Ok(arg.map(str::to_owned)),
|
||||
_ => Err(Error::NotFound(id.into())),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl HoverActions for Fixture {
|
||||
fn hover_actions(&mut self, _: &Document) -> Vec<HoverAction> {
|
||||
vec![HoverAction {
|
||||
line: 0,
|
||||
start_line: 0,
|
||||
end_line: 2,
|
||||
icon: Some("run".into()),
|
||||
label: "Run hover action".into(),
|
||||
tooltip: Some("Run hover action".into()),
|
||||
command: "run".into(),
|
||||
argument: Some("hover".into()),
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
register_plugin!(Fixture, hover_actions);
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
507827131b48fc6c679d8c2558c2e519e03e77ebbdeaaf25d9322f36d721201e
|
||||
0807c0c1cf4b9ab340ca5991c9ca4d74b7ae9917de527b4be0a118ac778cf857
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
ba97c6ec41ee0e2996ddd1d1c9432fad2ea0afb4c237f67c2ffb61cd25b4296c
|
||||
7a69d58846ddb5dfad48fd2c5dc87cd026a0971b24f8ff743e45c59f33160fbe
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
2db9659a4a5fee1cf7179fc5f66ee7ea93f98fa8e844db4213be8cb280998b62
|
||||
7024ae9d20f7b0ca6ce1ff77d9b3913ade91288016c07ac74602c96db766df1b
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
f6ca5c93b202794571b09d0882b6809e28cd54be61765265565e991c49f9b021
|
||||
312b8299192e159d8008b2ad7217abc442b9f7a95951fc60c4f95b81dee0dfd9
|
||||
|
||||
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
ef28c6f306a3adfc7d9fc7e6ec057845b2dc159866cd07745e949436de8a2107
|
||||
f43c8b7790393f6c55c626882a5a5815de49a29301d67d8ff6164dc51970c3bf
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
id = "test.language-features"
|
||||
name = "Language features fixture"
|
||||
version = "0.1.0"
|
||||
engines.openidea = "^1.4"
|
||||
engines.openidea = "^1.14"
|
||||
wasm = "dist/plugin.wasm"
|
||||
|
||||
[[contributes.providers]]
|
||||
kinds = ["formatting", "signature-help", "document-highlights", "document-links", "code-lenses", "selection-ranges", "folding", "colors", "document-symbols", "implementation", "type-definition", "gutter-actions", "injections"]
|
||||
kinds = ["formatting", "signature-help", "document-highlights", "document-links", "code-lenses", "selection-ranges", "folding", "colors", "document-symbols", "implementation", "type-definition", "gutter-actions", "hover-actions", "injections"]
|
||||
languages = ["plaintext", "text", "sql"]
|
||||
|
||||
[[contributes.providers]]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use openidea_plugin::language_features::*;
|
||||
use openidea_plugin::{
|
||||
Diagnostic, Error, Invocation, Location, Plugin, Position, Range, Severity, TextEdit, register_plugin, text,
|
||||
Diagnostic, Error, HoverAction, HoverActions, Invocation, Location, Plugin, Position, Range, Severity, TextEdit,
|
||||
register_plugin, text,
|
||||
};
|
||||
#[derive(Default)]
|
||||
struct Fixture {
|
||||
@@ -102,6 +103,20 @@ impl LanguageFeatures for Fixture {
|
||||
}]
|
||||
}
|
||||
}
|
||||
impl HoverActions for Fixture {
|
||||
fn hover_actions(&mut self, _: &Document) -> Vec<HoverAction> {
|
||||
vec![HoverAction {
|
||||
line: 0,
|
||||
start_line: 0,
|
||||
end_line: 2,
|
||||
icon: Some("run".into()),
|
||||
label: "Run fixture".into(),
|
||||
tooltip: Some("Run fixture".into()),
|
||||
command: "run".into(),
|
||||
argument: Some("inline".into()),
|
||||
}]
|
||||
}
|
||||
}
|
||||
impl Injections for Fixture {
|
||||
fn injections(&mut self, d: &Document) -> Vec<Injection> {
|
||||
if d.language == "sql" {
|
||||
@@ -141,4 +156,4 @@ impl openidea_plugin::diagnostics::DiagnosticsProvider for Fixture {
|
||||
]
|
||||
}
|
||||
}
|
||||
register_plugin!(Fixture, language_features, injections, providers, hover, diagnostics);
|
||||
register_plugin!(Fixture, language_features, hover_actions, injections, providers, hover, diagnostics);
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
abcb633eb89a522e4659cb21770517bb51e889d55c80854d6adc55d0ba33c41b
|
||||
6534015874177fa3bdad1d6fa4dbf571b83572635632c2b0294ca9594346520d
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
d696eacb402c81a04c42440593363fafe67d11487905a18151976253544415df
|
||||
9b1fb340840109da9efa88a1b41d00b1f0b9eb162c5029cf0b647d39a1dc8c36
|
||||
|
||||
+3
-3
@@ -5,9 +5,9 @@ wit_bindgen::generate!({
|
||||
inline: "
|
||||
package fixture:misbehave;
|
||||
world misbehave {
|
||||
include openidea:plugin/plugin-syntax@1.13.0;
|
||||
export openidea:plugin/providers@1.13.0;
|
||||
export openidea:plugin/file-actions@1.13.0;
|
||||
include openidea:plugin/plugin-syntax@1.14.0;
|
||||
export openidea:plugin/providers@1.14.0;
|
||||
export openidea:plugin/file-actions@1.14.0;
|
||||
}
|
||||
",
|
||||
path: "../../../../../wit",
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
fe55436cf32ce58ba8f8a681617e3e6d7fb94aaac1ce52eb4be620450f68b588
|
||||
4bde4785c0c30aeb5236a164e813b33b29cafc8c663a25a6621c2b4485a50f42
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
e6b23695cff3baf9e6d522b778799c937aff0df9037c62b14b96ad0ad2721225
|
||||
f3258dd48ae2468f9b513df27373224dc6b32284de0956642f11509d91adf1fd
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
c66907db0638d971126a5dd70a9b2e6a18af3d29f2c2fa2d860a726be9b76f75
|
||||
91ef32f574c389d6ab1d38e3570c763a695b0e0006b82a2957b8ab3042cd7415
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
id = "test.search"
|
||||
name = "Search fixture"
|
||||
version = "0.1.0"
|
||||
engines.openidea = "^1.13"
|
||||
engines.openidea = "^1.14"
|
||||
wasm = "dist/plugin.wasm"
|
||||
capabilities.required = ["project.read"]
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
a5c854e0ddb90ffddc600c196a78efc4e318b675ef8f7ef9c1059d05bbdc6de6
|
||||
4fdc7ecd459008c8f6457ff9985807c4808eaaca541e4efad5da2d445ba1552f
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
496e2cb9969f14ef82b2b5982e96c14bf5f586716f15141d5b80b025c4860ef0
|
||||
958eefe7f24c581db9bfcf64c59c2108dc3ec56d99cc2ae0d9dac087449cac60
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
6b790c68221c7a4071e99ba2794a3f156e90109185814bf6b21cf4f5ef907642
|
||||
3aacbd38fd26c73b252dac1f580d1890dcb9feb61ef89275617b47609aa7be5e
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
e7974d1c1b09578664869857cfa9ab05080540096c5a2b8601adb2ee30649d6f
|
||||
2768e1b2e434b9e3e51544879b14ccb24bb03790cb97c30faa6c8cd2f410e702
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
9563467036c1a365aa6df01cc7fbdb50c4b8b66656bb0d3b5864da58a3b8763d
|
||||
760f11fff96302bc212c31ac82a18126cac2392c2547ddaf0fa5a358de43f6aa
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
17d352320df9d4ccb67f80a4b6a7e8b13c7c1402375e1d1cf86154ce9026c9dd
|
||||
d65bc6dfd172ed545ac96d9197ca5af39f97362ad3a0b5967cac4f4e6c56b3a2
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
f3f3ea4688f068e1b2913bdaa6d2a4ec9f91f441caa5a6f50205fcec0bf6b565
|
||||
67610a3d7d09813deaf1152f1b5b5a7ced9de089ab24c285b9d2f9763242e648
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
d0d9887dea30561a313bb45e3ae7520bb49b0e6eef353fd91c0487c498265dc6
|
||||
d4653877beb8d12faac30170b99cbe48f08c883155aaa588031c1e60586b1e93
|
||||
|
||||
@@ -69,13 +69,14 @@ The IDE calls these. The first three are in every code plugin; the rest are opti
|
||||
| `language-features` | [language-features.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/language-features.wit) | Formatting, signature help, highlights, links, code lenses, folds, colours, symbols, gutter actions and more (API 1.4) |
|
||||
| `injections` | [injections.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/injections.wit) | Ranges of embedded languages inside a document (API 1.4) |
|
||||
| `hover-provider` | [hover.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/hover.wit) | Markdown added to the hover of any language |
|
||||
| `hover-actions` | [hover-actions.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/hover-actions.wit) | Hover-revealed line actions at the left edge of a line (API 1.14): anchor line and inclusive trigger line range |
|
||||
| `inlay-hints-provider` | [inlay.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/inlay.wit) | Inline hints in any language |
|
||||
| `semantic-tokens-provider` | [semantic.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/semantic.wit) | Semantic colouring in any language |
|
||||
| `diagnostics-provider` | [diagnostics.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/diagnostics.wit) | Problems in the current, possibly unsaved document |
|
||||
| `file-actions` | [file-actions.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/file-actions.wit) | Quick fixes and refactorings that create, rename or delete files |
|
||||
| `document-indexer` | [indexing.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/indexing.wit) | Cross-file definitions, references and gutter markers, indexed in the background |
|
||||
| `endpoints-provider` | [endpoints.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/endpoints.wit) | A project's HTTP endpoints for Search Everywhere and the HTTP client |
|
||||
| `search-provider` | [search.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/search.wit) | Cancellable queries for a plugin-defined Search Everywhere tab (API 1.13) |
|
||||
| `search-provider` | [search.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/search.wit) | Cancellable queries for a plugin-defined Search Everywhere tab (API 1.14) |
|
||||
| `view-provider` | [views.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/views.wit) | Content and events of declared views and custom editors |
|
||||
| `detail-provider` | [details.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/details.wit) | The detail pane of the plugin's nodes in the Services tool window |
|
||||
| `commit-checker` | [commit.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/commit.wit) | Before-commit checks |
|
||||
|
||||
@@ -228,6 +228,7 @@ Declare any of these kinds with `engines.openidea = "^1.4"`, implement
|
||||
| `implementation` | `implementation(doc, at)` | Merged with the server's implementations. |
|
||||
| `type-definition` | `type_definition(doc, at)` | Merged with the server's type declarations. |
|
||||
| `gutter-actions` | `gutter_actions(doc)` | Gutter buttons that run one of the plugin's declared commands, with an optional argument. |
|
||||
| `hover-actions` | `hover_actions(doc)` | Actions at the left edge of a line, revealed while the pointer is in the first four editing-area columns for any line in `start-line..=end-line`; the button is anchored to `line` and never covers text (API 1.14). |
|
||||
|
||||
A code lens that offers a command, from the
|
||||
[Blame Annotations](https://github.com/l0ng-ai/openidea/tree/main/plugins/official/blame-annotations)
|
||||
|
||||
@@ -27,7 +27,8 @@ The plugin API has one version number: the version of the WIT package in [`wit/`
|
||||
| 1.10.0 | OpenIDEA 0.1.47 | `build.dependencies`: the Maven / Gradle dependency graph the IDE resolved (`build.read`) |
|
||||
| 1.11.0 | In development on `main` | `ui.read-clipboard`: the clipboard's text and image in commands the user ran (`clipboard.read`) |
|
||||
| 1.12.0 | In development on `main` | `ui.set-console-rules`: highlight rules (regex, palette colours, styles) for Run and Debug console output |
|
||||
| 1.13.0 | In development on `main` | Optional `search-provider` export and `searchCategories`: custom Search Everywhere tabs with cancellable queries |
|
||||
| 1.13.0 | OpenIDEA 0.1.49 | Optional `search-provider` export and `searchCategories`: custom Search Everywhere tabs with cancellable queries |
|
||||
| 1.14.0 | In development on `main` | Optional `hover-actions` export: left-edge line actions revealed by line-edge hover, with an anchor line and inclusive trigger range |
|
||||
|
||||
The full list of what each version added is in [`plugins/README.md`](https://github.com/l0ng-ai/openidea/blob/main/plugins/README.md).
|
||||
|
||||
|
||||
@@ -69,13 +69,14 @@ description: "openidea:plugin WIT 包中的每个 interface:一句话说明及
|
||||
| `language-features` | [language-features.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/language-features.wit) | 格式化、签名帮助、高亮、链接、代码透镜、折叠、颜色、符号、装订区操作等(API 1.4) |
|
||||
| `injections` | [injections.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/injections.wit) | 文档中嵌入语言的范围(API 1.4) |
|
||||
| `hover-provider` | [hover.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/hover.wit) | 向任意语言的悬停追加 Markdown |
|
||||
| `hover-actions` | [hover-actions.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/hover-actions.wit) | 行左侧边缘的 hover 操作(API 1.14):锚定行和包含式触发行范围 |
|
||||
| `inlay-hints-provider` | [inlay.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/inlay.wit) | 任意语言中的内嵌提示 |
|
||||
| `semantic-tokens-provider` | [semantic.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/semantic.wit) | 任意语言中的语义着色 |
|
||||
| `diagnostics-provider` | [diagnostics.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/diagnostics.wit) | 当前文档(可能未保存)中的问题 |
|
||||
| `file-actions` | [file-actions.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/file-actions.wit) | 创建、重命名或删除文件的快速修复和重构 |
|
||||
| `document-indexer` | [indexing.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/indexing.wit) | 在后台索引的跨文件定义、引用和装订区标记 |
|
||||
| `endpoints-provider` | [endpoints.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/endpoints.wit) | 项目的 HTTP 端点,供 随处搜索 和 HTTP 客户端使用 |
|
||||
| `search-provider` | [search.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/search.wit) | 插件自定义全局搜索分类的可取消查询(API 1.13) |
|
||||
| `search-provider` | [search.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/search.wit) | 插件自定义全局搜索分类的可取消查询(API 1.14) |
|
||||
| `view-provider` | [views.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/views.wit) | 声明的视图和自定义编辑器的内容与事件 |
|
||||
| `detail-provider` | [details.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/details.wit) | Services 工具窗口中插件节点的详情面板 |
|
||||
| `commit-checker` | [commit.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/commit.wit) | 提交前检查 |
|
||||
|
||||
@@ -209,6 +209,7 @@ impl InlayHints for MyPlugin {
|
||||
| `implementation` | `implementation(doc, at)` | 与服务器的实现结果合并。 |
|
||||
| `type-definition` | `type_definition(doc, at)` | 与服务器的类型声明结果合并。 |
|
||||
| `gutter-actions` | `gutter_actions(doc)` | 行号槽按钮,执行插件声明的命令,可带参数。 |
|
||||
| `hover-actions` | `hover_actions(doc)` | 行左侧边缘的操作,在 `start-line..=end-line` 内任意一行的编辑区前四列悬浮时显示;按钮锚定到 `line`,不覆盖文本(API 1.14)。 |
|
||||
|
||||
下面是 [Blame Annotations](https://github.com/l0ng-ai/openidea/tree/main/plugins/official/blame-annotations)
|
||||
示例中提供命令入口的代码透镜:
|
||||
|
||||
@@ -24,7 +24,8 @@ description: "engines.openidea、插件 API 从 1.0 到 1.13 的各个版本,
|
||||
| 1.10.0 | OpenIDEA 0.1.47 | `build.dependencies`:IDE 已解析的 Maven / Gradle 依赖图(`build.read`) |
|
||||
| 1.11.0 | `main` 上开发中 | `ui.read-clipboard`:在用户运行的命令中读取剪贴板的文本和图片(`clipboard.read`) |
|
||||
| 1.12.0 | `main` 上开发中 | `ui.set-console-rules`:Run/Debug 控制台输出的高亮规则(正则、调色板颜色、文本样式) |
|
||||
| 1.13.0 | `main` 上开发中 | 新增 `search-provider` 导出和 `searchCategories` 贡献点:可取消查询的全局搜索自定义分类 |
|
||||
| 1.13.0 | OpenIDEA 0.1.49 | 新增 `search-provider` 导出和 `searchCategories` 贡献点:可取消查询的全局搜索自定义分类 |
|
||||
| 1.14.0 | `main` 上开发中 | 可选 `hover-actions` 导出:行内侧 hover 显示的左侧操作,带锚定行和包含式触发行范围 |
|
||||
|
||||
每个版本新增内容的完整列表见 [`plugins/README.md`](https://github.com/l0ng-ai/openidea/blob/main/plugins/README.md)。
|
||||
|
||||
|
||||
@@ -426,6 +426,44 @@ are always available. Calling a gated function without its capability returns
|
||||
|
||||
## 3. Writing code (Rust SDK)
|
||||
|
||||
### API 1.14
|
||||
|
||||
API 1.14.0 is in development on `main`. Use `engines.openidea = "^1.14"` and the
|
||||
matching SDK. Plugins for 1.13 and earlier keep working. New in 1.14:
|
||||
|
||||
- **Hover-revealed line actions.** The optional `hover-actions` export
|
||||
(world `plugin-hover-actions`, SDK `HoverActions`, registration
|
||||
`register_plugin!(Plugin, hover_actions)`) contributes clickable actions at
|
||||
the left edge of an editor line. Declare `kinds = ["hover-actions"]` under
|
||||
`[[contributes.providers]]`. The host reveals an action while the pointer is
|
||||
in the first four character columns of the editing area for any line in its
|
||||
`start-line`/`end-line` range, anchors it to `line`, and never covers the
|
||||
code text. The released `language-features` interfaces stay unchanged.
|
||||
|
||||
Example:
|
||||
|
||||
```rust
|
||||
#[derive(Default)]
|
||||
struct MyPlugin;
|
||||
impl openidea_plugin::HoverActions for MyPlugin {
|
||||
fn hover_actions(&mut self, doc: &openidea_plugin::language_features::Document)
|
||||
-> Vec<openidea_plugin::HoverAction>
|
||||
{
|
||||
vec![openidea_plugin::HoverAction {
|
||||
line: 0,
|
||||
start_line: 0,
|
||||
end_line: 10,
|
||||
icon: Some("run".into()),
|
||||
label: "Call this method".into(),
|
||||
tooltip: Some("Call this method".into()),
|
||||
command: "call".into(),
|
||||
argument: None,
|
||||
}]
|
||||
}
|
||||
}
|
||||
openidea_plugin::register_plugin!(MyPlugin, hover_actions);
|
||||
```
|
||||
|
||||
### API 1.13
|
||||
|
||||
API 1.13.0 is in development on `main`. Use `engines.openidea = "^1.13"` and the
|
||||
@@ -1578,6 +1616,7 @@ and register `register_plugin!(MyPlugin, language_features)`:
|
||||
| `implementation` | `implementation(doc, at)` | Merged with LSP Go to Implementation, deduplicated by location. |
|
||||
| `type-definition` | `type_definition(doc, at)` | Merged with LSP Go to Type Declaration, deduplicated by location. |
|
||||
| `gutter-actions` | `gutter_actions(doc)` | Buttons beside line markers. Clicks invoke only the returning plugin's declared command, with its optional string argument and the editor window/project context. Icons accept the same names, aliases and declared marker SVG paths as line markers. |
|
||||
| `hover-actions` | `hover_actions(doc)` | Left-edge actions revealed by line-edge hover, with an anchor line and an inclusive trigger line range (API 1.14). |
|
||||
|
||||
The optional WIT interface is `language-features`, in worlds
|
||||
`plugin-language-features` / `editor-language-features`. Its own `document`
|
||||
|
||||
BIN
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
68087f0299ec1cef65d1527a9198f31665f6a428edbbc3e37a33262e4984b96a
|
||||
aa4cc3efbfe6f26930e1f448f00361df453ff6aedc3a6223786c2946add2c20f
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
7b48ea8b3724072605e979d47c501aa221f78213b5028383f55c517e00925b8f
|
||||
086dd13f1510b06064e399f463fc719e41fed90eadaa8d151826aed3efc29d84
|
||||
|
||||
BIN
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
6e1a6b0a87403dda7d9e780a43c7da97ab6673b80bc2ed7365d0b6e7d8191e47
|
||||
ceace9d394ce329f644ea4dec6e6b2c6bd64e2b9177a67744c84166768812c81
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
c0c583007f253e9466feb0cf49ddb0981470e3a41ededdeb08b468a86a69454e
|
||||
ee01772f5bc9a0ea75c7a7078875414ec8e2d1506c58ca07cefb8534ca9d20e6
|
||||
|
||||
BIN
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
7b7d7927f454ab760d1c01ec5f09e5be8dc1f3f8d5d293dd02c8a1373109784b
|
||||
9a887b53a9bc0113fe12c839cdafd7dbe7bb8ca436c38c5d02eaf3fbe74efb11
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user