дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-04 17:21:13 +02:00
feat(plugins): tell plugins which editor lines are on screen (API 1.21)
text-editor.visible-lines (editor.read) returns the first and last document line shown in the editor when the command or event was invoked, or none when the editor is not on screen. The workbench fills it from the focused editor view with the rest of the plugin editor context; older clients leave it out. The SDK wraps it as TextEditor::visible_lines and MockHost::set_visible_lines sets it in tests.
Цей коміт міститься в:
1 джерело
b16d485f35
коміт
b9fa19edf8
129 files changed
+178
-65
No files matched your search
@@ -2369,6 +2369,7 @@ pub async fn lsp_execute_command(host: &Host, window: &str, doc: DocId, command:
|
||||
path: snap.path.0.clone(),
|
||||
language: snap.language.0,
|
||||
selections: vec![],
|
||||
visible_lines: None,
|
||||
}),
|
||||
selected_paths: vec![snap.path.0],
|
||||
..Default::default()
|
||||
@@ -2410,6 +2411,7 @@ async fn run_plugin_server_command(
|
||||
path: snap.path.0.clone(),
|
||||
language: snap.language.0,
|
||||
selections: vec![],
|
||||
visible_lines: None,
|
||||
}),
|
||||
selected_paths: vec![snap.path.0],
|
||||
..Default::default()
|
||||
|
||||
@@ -463,11 +463,19 @@ pub struct PluginEditor {
|
||||
pub path: String,
|
||||
pub language: String,
|
||||
pub selections: Vec<ide_core::Range>,
|
||||
/// First and last document line on screen (0-based, inclusive); absent from older clients.
|
||||
#[serde(default)]
|
||||
pub visible_lines: Option<(u32, u32)>,
|
||||
}
|
||||
|
||||
impl PluginEditor {
|
||||
pub fn context(self) -> ide_plugin::EditorContext {
|
||||
ide_plugin::EditorContext { path: self.path.into(), language: self.language, selections: self.selections }
|
||||
ide_plugin::EditorContext {
|
||||
path: self.path.into(),
|
||||
language: self.language,
|
||||
selections: self.selections,
|
||||
visible_lines: self.visible_lines,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,12 @@ pub fn view_invocation(
|
||||
Some(doc) => {
|
||||
let project = project.as_ref().ok_or_else(|| IdeError::not_found("no project is open in this window"))?;
|
||||
let info = project.documents.snapshot(doc)?;
|
||||
Some(EditorContext { path: info.path.0, language: info.language.0, selections: Vec::new() })
|
||||
Some(EditorContext {
|
||||
path: info.path.0,
|
||||
language: info.language.0,
|
||||
selections: Vec::new(),
|
||||
visible_lines: None,
|
||||
})
|
||||
}
|
||||
};
|
||||
Ok(Invocation {
|
||||
@@ -129,7 +134,12 @@ mod tests {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let host = Host::new(HostConfig::for_test(tmp.path()));
|
||||
let range = ide_core::Range::new(ide_core::Pos::new(1, 0), ide_core::Pos::new(1, 4));
|
||||
let active = PluginEditor { path: "/p/a.rs".into(), language: "rust".into(), selections: vec![range] };
|
||||
let active = PluginEditor {
|
||||
path: "/p/a.rs".into(),
|
||||
language: "rust".into(),
|
||||
selections: vec![range],
|
||||
visible_lines: None,
|
||||
};
|
||||
let inv = view_invocation(&host, "main", None, Some(active)).unwrap();
|
||||
let editor = inv.editor.expect("the active editor");
|
||||
assert_eq!((editor.path.to_string_lossy().as_ref(), editor.selections.as_slice()), ("/p/a.rs", &[range][..]));
|
||||
|
||||
@@ -65,7 +65,7 @@ impl TestWorkspace {
|
||||
.iter()
|
||||
.map(|&(a, b, c, d)| ide_core::Range::new(ide_core::Pos::new(a, b), ide_core::Pos::new(c, d)))
|
||||
.collect();
|
||||
EditorContext { path, language: "text".into(), selections }
|
||||
EditorContext { path, language: "text".into(), selections, visible_lines: None }
|
||||
}
|
||||
|
||||
fn text(&self, rel: &str) -> String {
|
||||
@@ -7374,6 +7374,7 @@ fn api14_settings_and_input_events_use_other_and_capture_the_editor() {
|
||||
path: path.clone(),
|
||||
language: "text".into(),
|
||||
selections: vec![ide_core::Range::default()],
|
||||
visible_lines: Some((10, 52)),
|
||||
}),
|
||||
);
|
||||
f.host.flush_events_at(Instant::now() + Duration::from_secs(2));
|
||||
@@ -7399,6 +7400,7 @@ fn api14_settings_and_input_events_use_other_and_capture_the_editor() {
|
||||
assert_eq!(events[4]["editor"][0], path.as_str());
|
||||
assert_eq!(events[2]["editor"][0], path);
|
||||
assert_eq!(events[2]["editor"][1][0], serde_json::json!([0, 0, 0, 0]));
|
||||
assert_eq!(events[2]["editor"][2], serde_json::json!([10, 52]));
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
|
||||
@@ -20,6 +20,8 @@ pub struct EditorContext {
|
||||
pub language: String,
|
||||
/// Selections when the command was invoked (cursors are empty ranges).
|
||||
pub selections: Vec<ide_core::Range>,
|
||||
/// First and last document line on screen when the command was invoked.
|
||||
pub visible_lines: Option<(u32, u32)>,
|
||||
}
|
||||
|
||||
/// Where a command or event batch comes from: the window and its project.
|
||||
|
||||
@@ -1337,6 +1337,13 @@ impl editor::HostTextEditor for StoreData {
|
||||
Ok(Ok(self.table.get(&this)?.ctx.selections.iter().map(range_to_wit).collect()))
|
||||
}
|
||||
|
||||
fn visible_lines(&mut self, this: Resource<EditorRes>) -> Fallible<Option<(u32, u32)>> {
|
||||
if let Err(e) = self.require(Capability::EditorRead) {
|
||||
return Ok(Err(e));
|
||||
}
|
||||
Ok(Ok(self.table.get(&this)?.ctx.visible_lines))
|
||||
}
|
||||
|
||||
fn apply_edits(&mut self, this: Resource<EditorRes>, version: u64, edits: Vec<wit::TextEdit>) -> Fallible<u64> {
|
||||
if let Err(e) = self.require(Capability::EditorWrite) {
|
||||
return Ok(Err(e));
|
||||
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
391e0b78cbb610ca32b7b74b6b2026376557554ee3d9e607579173157d6505c0
|
||||
244ffe98b63d788f6c5ad6e5576b80dec67ed2057183df7f3ca4489d1d562f9c
|
||||
@@ -174,6 +174,7 @@ impl Plugin for Api14 {
|
||||
.into_iter()
|
||||
.map(|r| [r.start.line, r.start.character, r.end.line, r.end.character])
|
||||
.collect::<Vec<_>>(),
|
||||
e.visible_lines().unwrap(),
|
||||
)
|
||||
});
|
||||
received.push(serde_json::json!({ "kind": kind, "data": data, "editor": editor }));
|
||||
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
28ae86e361923f5603829368d4e51f9c11323e9871b348191b046b171a455837
|
||||
bbfda2afbe532ef2e38987d91c53dbebc38aca9452bf695c49a50ced64ebc635
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
885e682ee7bdab8c44257cefb0266c31582fbd76a1a00c867697379b57ebf431
|
||||
8f4f12c201798d4b1a041aba62b3d23ed4684667cce3ee4429ded25c5c463947
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
25de09055141345b3de8939a43dad4f79d57304b140367097a1016ed076ca4fc
|
||||
b4300eab1e04c3d39af47ed4119b063be9ce4a8fce92515c871ebb2bf2abdd2f
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
c84299a4bdeade40350fffb6020bfb5378f824d96651045c82ddcc121f6a9547
|
||||
5a94ee984d01361df78343ad48bafd92da8e0ff15df505e25a17648c48c8b407
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
65ea37261173e1100f6a5a650e95c0c07ddce0f81cba737d277c385196c5674b
|
||||
77d2759b26bb3ca862bed35e7ac1e877d18a9823c38f8c55d210ba4b6804cf70
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
44e139c052f87ec409eb7ac36240a22272d9f2b0bd41a37ff6c01e726457e424
|
||||
54f343b109b0f31b29193f234b23c93d0180c115953edf7000a6247b7a89483f
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
c59d0f0d1fb4abc052a2e978201a8b149ace29699d38d1924720b77e9ee41d92
|
||||
2faf258198c311437e68eba7541bb4a9d614e8c04a4e20ecba8cd47600a281fe
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
47fe447ccb9f76d69cffe69713a2177fceca1b69eb039f13bb912b80578e6126
|
||||
0006cfa14e4d6032e2cb1d61287117da71bfef8cbaba6a4de0940e30fdf1fabf
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
925e17f44beeb4ba34b1e60466299101b3e8dbd025f7e011ec335839b5e1077c
|
||||
8357dc7454ec00407dc515c94b3116df431f8495ef38eb5752a1d905cb187acd
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
2602908184d78bcad536606ce9af2bcc893067f2fce8f78273beef523a470b73
|
||||
9207f220790ba0dfa0bcd8cc1fedf6d21793c674bf64fad4eee43428eb85851b
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
36de99a64635a3536433b328c787578593435f82c5f8e714b185ea2af6d08f60
|
||||
4bb7e1ad135260cddb6a4b1d531e011b416bd6b19be369062fdfa2df41940cc5
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
51f6a7efff3b6d48e2ee37aa830f3ff79fa12adbfbe39407d56edb1149e8c55a
|
||||
b5471fd88ab877f313cbaac50f9df5bad131f09f668022dc6bde396f962cd05e
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
0d75629cdc43f130ba3628b068caf36dacac07e26ef55c89b999e8bafc13ebc0
|
||||
ad767ede1307a6b293d465a2aeb9761a5ad4634d4317804416c7ea8831e76368
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
0972b15707c35be7e27846e6d219cd4d02c0ae3fef91d414f521a2f4f6ca96ff
|
||||
b532b1145679c40e9f60467ce0d0572088b2396cb5900f817d4dfb2751e1b27c
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
23fc8f3a0c7920d91e0cf90ec4a58e82ff6deb92159e197a971fd47a280810a6
|
||||
f53864320473858d3a8e6777ed32ca10544f3e30f6f683383733c211b76647b7
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
491b3794111b43a0c6408fb3399d1a9ac080df213d962ef04adebee411e9def1
|
||||
36a7d4350382ed2fac390b7553d67c776211a1b137c7a80f0353f45ece9b6db1
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
b887aa0ed1908edf6dc684d4d84a15209f14c7dfb1c7fdf6d2c3e7f61ff2d720
|
||||
b5f119da24a63a60ab6cf6a47e41b8c990c8f282f3e85313cbcf6c455b24f6f9
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
e31e18cb72f04e852f246b71f7b789ade9dad8148de8cc5b9aa449c1a101a743
|
||||
a602879b68787d0dc444d9c199d6ac4382e23daea875614651764cba26a23d70
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
9929514bef85155c849854d97fc6a9a45c0ad51b9d3fdcaae631a6359d9d42f9
|
||||
422cf15eda4f9680c3adf7e6a1b90a1fa372fc03e3e27d4c2636d3dcb29d7827
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
3e481672018f10fd4a34fb78e5e88f387f6e9725f16a7947a177ae26bab4473f
|
||||
8a0bd030284f98383254e5b4795cc75a777b302def29d3950f9a9ef62b252204
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
cb23d0a4d417f447df9f25966e3da6b3adf2d029bbd727bde84a1faae7678814
|
||||
8ebe6be0901cd84fb2909b291142097edd56193a372815d92d9a00166b58f361
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
8933abce0c2a1cb10294d27556ebea6bfe135253fc0843c84c93e60842087103
|
||||
d5906b043c9aeb558c70bba5e1c66afc7448b6d17c42c416cbd5c02e746297c0
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
16e0ff152c05bb80798289c9e7177c1a4330f929f4547b61bbe0672010eff021
|
||||
0c4d8de94293f8503f5102da3dc3ce99c9dd99e1710200d43cbbcc70f261a31a
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
f6a63dec9001b61ba344dcdacb3b4b691b8d1573bf2238b5717d7fc8426c1631
|
||||
85f2c06f202a859237c82901bcb4813e681b122ddca8c12bb3cbbc9b7dcd4cc7
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
629c57f6b44d3f68fef666b308c8514ba4a30706c8db8455264e6f968646bc98
|
||||
bfd81257b024a2ab6d4ac455d2f23a3f5a3371045818297a0ec953be227128d7
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
4703155f9e9a2b4223e6051e0fa42a2c80eeb5fc5fbf65e2f6d8afc725b50a7a
|
||||
9d13280b5ff7279d0225b003c419711d1f6f26761727a51093d079ab407d3a64
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
8af5461eac6516304f489e206ff0025254e97a6609e56c99683678c82eb0c1d8
|
||||
57bff8769cfe6fe7b3375c2af7c1ff7b32e1c8d0853cf0d34ff59f203a852345
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
e1a56f411e1d0832b29ba0222ea75b12f46d7707fff37657761fe07202165788
|
||||
ff0d089139909e646c20f9bcbc37e45a06eb1aefe294558a2943cf43da0960f1
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
57ab2fdf586569182cd20ccb4545e98ad6397245548df8179eac9c8be5f8b671
|
||||
b8d927b3ede9ffd0b1856f3df9eb554c3ad201c5bf55f9b56b3361c21bb9aac0
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
30c1eb52773e246d5cd8962496a94d2b8ac0d82d4270d5ea344d70e845cf199c
|
||||
5ea93f9ace6a67df3add841bb031f8d2bb35f1ad10435924568637c54cb85391
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
a027b038cb64534a912b193b01385aac5ba211c0b12b9be5159c6c03e729a571
|
||||
8729533edfa602e12007abdef72fd989fe12a7505c486225e4f332fcced9044d
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
650b3808c5b1b5754c7234956f86bf019f5e90aa0e24dfd7892a8bb75cd2b7f5
|
||||
1a691187c2d4d7867fec1ab34319b181b5103418353b23b843cc9379ae8bfd18
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
3b48734ff47c29a1b2fb2e9874af51bc0def268e4dd806acbd1058293fd0a273
|
||||
728d224a958f95cfff676071da9dedd4536cc25f10911980e191da834da345db
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
94d998d39ee416368f54d5cb80fc36748cc4f6ddd7e87665298bd909d6163d0f
|
||||
28f5214e89a70fe792aaca4f4a5fd8f646519dc722c55dfcd668531ef165c292
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
60a68dc591eb93835230294126ae7ff2ab4af64841d2d4edac2139c72bf9f183
|
||||
2ef5a79b48db148079e9cefa27c18ea90d07012368677913c0ab4ff4f3965104
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
31cff1565b566a95eb8900142c6f305f992b1a54cd51fb4bebcd11db90334cf9
|
||||
812b65ce95b8ff1fe5ff98c919c19f90ecdb44658da9a1b6b4a4bc82e5fd266a
|
||||
Бінарний файл не відображається.
+1
-1
@@ -1 +1 @@
|
||||
e7daf6caa658dbdad3612de14afbe7734a05f8e2970b87f92b2d14cb2161c018
|
||||
7f738fbfe5c9ef33641e6a337460fc2eee63f540e212e112aa955f44fe9f2833
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
b9d10203717998684946e01d513915ba385d745c7ff6599d708189ffcc084bc9
|
||||
6595f85e9c756a8798fa8c28ff37779093d4d6dd772344ec566353e0f607356b
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
9e59e5374e230da448032a6cd528f8279c9d24d14d5e1f5ba3f0d95d9f26333d
|
||||
d3c50aaf8621c503ec1e8c426faf23d224129586749e34c31ac11987e03f17df
|
||||
@@ -53,7 +53,7 @@ Later:
|
||||
| ------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
|
||||
| `project.read` | Low | `Project::root`, `read_file`, `find_files`, `symbols`, `search_text`, `host::projects`, publishing diagnostics, `problems`, opening editors, decorations | 1.0 |
|
||||
| `project.write` | High | `Project::write_file`: creates and replaces text files inside the open projects, never git's own files (`.git`) | 1.3 |
|
||||
| `editor.read` | Low | `TextEditor::document`, `selections`, `host::open_editors` | 1.0 |
|
||||
| `editor.read` | Low | `TextEditor::document`, `selections`, `visible_lines`, `host::open_editors` | 1.0 |
|
||||
| `editor.write` | Medium | `TextEditor::apply_edits` | 1.0 |
|
||||
| `vcs.read` | Low | `vcs_status`, `vcs_remotes`, `vcs_log`, `vcs_blame`, `vcs_diff`, the pending commit, before-commit checks | 1.0 |
|
||||
| `vcs.write` | Medium | `vcs_fetch` (trusted projects only), `host::set_commit_message` | 1.0 |
|
||||
|
||||
@@ -35,7 +35,7 @@ The plugin API has one version number: the version of the WIT package in [`wit/`
|
||||
| 1.18.0 | OpenIDEA 0.1.54 | `[[contributes.overlays]]`: a package web page floating over the workbench that never takes the keyboard focus, placed and resized through `openidea.overlay`; `[[contributes.dialogs]]`: a package web page in a modal, resizable IDE dialog opened with `views.reveal`, with a `closed` view event and `openidea.dialog.close()`; `events.subscribe-paths-with-options` (`debounce-ms`), `workspace.project.generation` and `FilesChanged` project/generation fields, stale run target/configuration rejection, and the `project-closed` lifecycle event; `execution-configurations`, `run.start-with-options` and `runDetectors.outputMode`: `pipes` or `pty` console output for plugin run configurations; `[[contributes.runAnything]]` with the `run-anything-provider` export: Run Anything lines starting with the plugin's prefix; `views.open-terminal-session-in`: a keyed terminal in a project directory; `workspace.invoking-project`: the project of the window a call serves, also in `gutter-actions` and `hover-actions`; `events.watch-paths` and the `watched-files-changed` event: files and directories outside the project, within `fs.read` grants; the `run-configuration-completion` export: completion in the Arguments field of the plugin's own run configurations; `services.context` and `services.toolbar` menus on the IDE's own Services nodes, with the selected services as the command argument; `executor` on `[[contributes.javaAgents]]`: "Run/Debug '<name>' with <title>" beside Run and Debug, the only launches that get that agent, also startable from the plugin's own commands with a configuration id; grant-scoped `agents.fork-session`: fork a recorded native agent session (`claude`, `codex`, or `copilot`) into a new task in the invoking window's project (`agents` capability), with the host validating the session and building the fork invocation itself |
|
||||
| 1.19.0 | OpenIDEA 0.1.56 | `[capabilities.reasons]`: the plugin's own sentence on why it asks for a capability, shown below the host's description in the permission dialog and Settings › Plugins; `settings.open` / `settings.open-permissions`: open Settings at one of the plugin's own pages or at its permissions; `net.fetch-stream`: a response whose body is read as it arrives (server-sent events, streamed model replies), with the SDK's `host::fetch_stream` and `sse` parser; `editor.open-as-text`: open a file in the built-in text editor even when a custom editor claims it (the SDK's `host::open_editor_as_text`); the `openIn` menu: the **Open In** submenu of the editor, its tab and the Project view |
|
||||
| 1.20.0 | OpenIDEA 0.1.57 | Database table context menus and read-only table schema inspection (`database.schema`). Optional `syntax-decorations-provider` export: foreground marks on an open text editor, in the theme tokens `rainbow-1` … `rainbow-5` or its own `#rrggbb` colours for dark and light themes, and a bounded slice of the editor's syntax tree. |
|
||||
| 1.21.0 | In development | Run lifecycle & Run Config extensions: `run-started` event, `run-exited` for user-launched plugin runs, `run.stop`, `"java"` in `attach-child`, `prepareCommand` `mode` (`"run"` / `"debug"`) and loopback `javaDebug` JDWP attach, `run.upsert-configuration`, `run.open-edit-configurations`, `ownsBeforeLaunch`, transient `logFiles` log-tail tabs (`project.read` / `fs.read`), and the `runConsole.toolbar` menu. Settings controls: `presentation` (`radio`, `segmented`, `slider`, `color`, `checkbox-list`), `enumOptions` labels, hints and icons for `enum` values, `minimum` / `maximum` / `step`, and `when` conditions that hide a setting. `build.sdks` and `build.artifacts` under `build.read`: read installed JDKs/Maven/toolchains (`active` marking the project selection), build-model Maven/Gradle WAR artifacts, and Project Structure › Artifacts definitions (with `id`, `origin`, and `tool`) in trusted projects. |
|
||||
| 1.21.0 | In development | Run lifecycle & Run Config extensions: `run-started` event, `run-exited` for user-launched plugin runs, `run.stop`, `"java"` in `attach-child`, `prepareCommand` `mode` (`"run"` / `"debug"`) and loopback `javaDebug` JDWP attach, `run.upsert-configuration`, `run.open-edit-configurations`, `ownsBeforeLaunch`, transient `logFiles` log-tail tabs (`project.read` / `fs.read`), and the `runConsole.toolbar` menu. Settings controls: `presentation` (`radio`, `segmented`, `slider`, `color`, `checkbox-list`), `enumOptions` labels, hints and icons for `enum` values, `minimum` / `maximum` / `step`, and `when` conditions that hide a setting. `build.sdks` and `build.artifacts` under `build.read`: read installed JDKs/Maven/toolchains (`active` marking the project selection), build-model Maven/Gradle WAR artifacts, and Project Structure › Artifacts definitions (with `id`, `origin`, and `tool`) in trusted projects. `TextEditor::visible_lines` under `editor.read`: the first and last document line on screen when the command or event was invoked. |
|
||||
|
||||
The full list of what each version added is in [`plugins/README.md`](https://github.com/l0ng-ai/openidea/blob/main/plugins/README.md).
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ optional = ["net:127.0.0.1", "clipboard.read"]
|
||||
| ------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
|
||||
| `project.read` | 低 | `Project::root`、`read_file`、`find_files`、`symbols`、`search_text`、`host::projects`、发布诊断、`problems`、打开编辑器、装饰 | 1.0 |
|
||||
| `project.write` | 高 | `Project::write_file`:在打开的项目中创建和替换文本文件,但不能写 git 自己的文件(`.git`) | 1.3 |
|
||||
| `editor.read` | 低 | `TextEditor::document`、`selections`、`host::open_editors` | 1.0 |
|
||||
| `editor.read` | 低 | `TextEditor::document`、`selections`、`visible_lines`、`host::open_editors` | 1.0 |
|
||||
| `editor.write` | 中 | `TextEditor::apply_edits` | 1.0 |
|
||||
| `vcs.read` | 低 | `vcs_status`、`vcs_remotes`、`vcs_log`、`vcs_blame`、`vcs_diff`、待提交的内容、提交前检查 | 1.0 |
|
||||
| `vcs.write` | 中 | `vcs_fetch`(仅受信任项目)、`host::set_commit_message` | 1.0 |
|
||||
|
||||
@@ -32,7 +32,7 @@ description: "engines.openidea、插件 API 从 1.0 到 1.21 的各个版本,
|
||||
| 1.18.0 | OpenIDEA 0.1.54 | `[[contributes.overlays]]`:悬浮在工作台上方、从不抢占键盘焦点的插件网页,可通过 `openidea.overlay` 移动和调整大小;`[[contributes.dialogs]]`:插件网页显示在可调整大小的模态对话框中,用 `views.reveal` 打开,关闭时发 `closed` 视图事件,页面可调用 `openidea.dialog.close()`;`events.subscribe-paths-with-options`(`debounce-ms`)、`workspace.project.generation` 与 `FilesChanged` 的 `project`/`generation` 字段、过期运行目标/配置拒绝以及 `project-closed` 生命周期事件;`execution-configurations`、`run.start-with-options` 与 `runDetectors.outputMode`:插件运行配置的控制台输出方式(`pipes` 或 `pty`);`[[contributes.runAnything]]` 与 `run-anything-provider` 导出:以插件前缀开头的 Run Anything 行;`views.open-terminal-session-in`:在项目子目录中打开带 key 的终端;`workspace.invoking-project`:本次调用所服务窗口的项目,`gutter-actions` 和 `hover-actions` 中也可用;`events.watch-paths` 与 `watched-files-changed` 事件:监听项目之外、`fs.read` 授权范围内的文件和目录;`run-configuration-completion` 导出:补全插件自己运行配置的“实参”字段;`services.context` 和 `services.toolbar` 菜单:作用于 IDE 自带的 Services 节点,命令参数是选中的服务;`[[contributes.javaAgents]]` 的 `executor`:运行和调试旁边的“使用 <title> 运行/调试 '<name>'”,只有经它启动时才加载该代理,插件自己的命令也可用配置 id 经它启动;需授权的 `agents.fork-session`:把录制的原生 agent 会话(`claude`、`codex` 或 `copilot`)派生为调用窗口项目中的新任务(`agents` 能力),宿主自行校验会话并构造 fork 调用 |
|
||||
| 1.19.0 | OpenIDEA 0.1.56 | `[capabilities.reasons]`:插件用一句话说明为什么需要某个能力,显示在授权对话框和 设置 › 插件 中宿主说明的下方;`settings.open` / `settings.open-permissions`:打开设置并定位到插件自己的页面或它的权限;`net.fetch-stream`:边到达边读取响应体(服务器推送事件 SSE、模型的流式回复),SDK 提供 `host::fetch_stream` 和 `sse` 解析器;`editor.open-as-text`:即使文件被自定义编辑器认领,也用内置文本编辑器打开(SDK 的 `host::open_editor_as_text`);菜单点 `openIn`:编辑器、标签页和项目视图的 **打开方式** 子菜单 |
|
||||
| 1.20.0 | OpenIDEA 0.1.57 | 数据库表的上下文菜单和只读表结构查看(`database.schema`)。可选的 `syntax-decorations-provider` 导出:用主题 token `rainbow-1` … `rainbow-5` 或自带的深色/浅色主题 `#rrggbb` 颜色,给打开的文本编辑器中的范围涂前景色,依据编辑器语法树的有界片段。 |
|
||||
| 1.21.0 | `main` 上开发中 | 运行配置与运行生命周期扩展:`run-started` 事件与用户启动配置时的 `run-exited`、`run.stop`、`attach-child` 支持 `"java"`、`prepareCommand` 传入 `mode`(`"run"` / `"debug"`)并支持回环 `javaDebug` 附加 JDWP 调试器、`run.upsert-configuration`、`run.open-edit-configurations`、`ownsBeforeLaunch`、控制台日志文件实时标签页 `logFiles`(按 `project.read` / `fs.read` 授权)以及 `runConsole.toolbar` 菜单位置。设置控件:`presentation`(`radio`、`segmented`、`slider`、`color`、`checkbox-list`),为 `enum` 值提供标签、说明和图标的 `enumOptions`,`minimum` / `maximum` / `step`,以及隐藏设置的 `when` 条件。`build.read` 新增 `build.sdks` 与 `build.artifacts`:在受信任项目中读取已安装的 JDK / Maven / 工具链(带项目当前选中的 `active` 标记)以及构建模型 Maven/Gradle WAR 产物和 Project Structure › Artifacts 定义(含 `id`、`origin` 与 `tool`)。 |
|
||||
| 1.21.0 | `main` 上开发中 | 运行配置与运行生命周期扩展:`run-started` 事件与用户启动配置时的 `run-exited`、`run.stop`、`attach-child` 支持 `"java"`、`prepareCommand` 传入 `mode`(`"run"` / `"debug"`)并支持回环 `javaDebug` 附加 JDWP 调试器、`run.upsert-configuration`、`run.open-edit-configurations`、`ownsBeforeLaunch`、控制台日志文件实时标签页 `logFiles`(按 `project.read` / `fs.read` 授权)以及 `runConsole.toolbar` 菜单位置。设置控件:`presentation`(`radio`、`segmented`、`slider`、`color`、`checkbox-list`),为 `enum` 值提供标签、说明和图标的 `enumOptions`,`minimum` / `maximum` / `step`,以及隐藏设置的 `when` 条件。`build.read` 新增 `build.sdks` 与 `build.artifacts`:在受信任项目中读取已安装的 JDK / Maven / 工具链(带项目当前选中的 `active` 标记)以及构建模型 Maven/Gradle WAR 产物和 Project Structure › Artifacts 定义(含 `id`、`origin` 与 `tool`)。`editor.read` 下的 `TextEditor::visible_lines`:命令或事件触发时屏幕上显示的首行和末行。 |
|
||||
|
||||
每个版本新增内容的完整列表见 [`plugins/README.md`](https://github.com/l0ng-ai/openidea/blob/main/plugins/README.md)。
|
||||
|
||||
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
9550f8b917b596af31b7eb2566f3953873a2449d33c44ad843a3965e71f6ea59
|
||||
87af98a559f73518b6b2cf6d5c4d487dfd45337cfa45439185f713b236a22d3c
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
522d29bbbc6876a30a40994e650276492db6b830e3f74c4064da50e63c522bd6
|
||||
0c90adbfa742427cf0b719c5b22c734f09abf9ac647d630d301d7bd9df1e1174
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
2e655148d562d2c44b073d1151f162fa13e291f441a179069128dd819329629f
|
||||
8e8624b51e683987719d9510484dfc8dc2e54b3783eaa92535f2f0afb7543dff
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
061f7136d157566c4dfa44f30e7cb9e2fbed32d3455e77d67d2a26795ac58c7e
|
||||
4f97d4a779aa11a7078df2c7256b4b0c7761e2c25b60deae8386bec25897c2d0
|
||||
Бінарний файл не відображається.
Loaded 100 of 129 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Заблокувати користувача