Порівняти коміти

...
6 Коміти
Автор SHA1 Повідомлення Дата
l0ng-ai 1a12c88f0c fix(build): give the type check in pnpm build a 4 GB heap (#4448)
tsc --noEmit now peaks at about 2.8 GB, past Node's default heap on the 7 GB macOS runners, so the macOS release builds died with "JavaScript heap out of memory" in beforeBuildCommand.
2026-11-19 14:48:55 +08:00
l0ng-ai 6400206a94 chore: v0.1.49 2026-11-19 14:07:24 +08:00
l0ng-ai 49d8e1bc71 test: fix main CI failures on Windows and slow runners (#4437)
Windows: compare the java-analyzer jdkHome with dunce::canonicalize (std adds the \\?\ prefix). macOS: wait for the hard-deadline interruption instead of a fixed sleep. Ubuntu: give a reclaimed plugin instance room to restart within the run-target validation timeout.
2026-11-19 13:36:34 +08:00
l0ng-ai 8a56c204f4 fix(editor): drop kept unsaved files when the project closes (#4435)
With autosave off, a modified file whose last tab closed stayed in the document manager across Close Project / project switch, so after Don't Save the reopened project reused the stale model: it showed the discarded text and the close prompt counted it again. A project change now drops every model except untitled buffers.
2026-11-19 13:00:30 +08:00
l0ng-ai 5bf4d4bb15 fix(search): Delete in Recent Files and Recent Locations edits the filter first (#4434)
Delete in the filter field always removed the selected entry, so a typed filter couldn't be edited with forward-delete. It now edits the filter while there is a selection or text after the caret, and removes the entry otherwise.
2026-11-19 13:00:21 +08:00
l0ng-ai 84dcd99f7b revert: start Python debuggees in the internal console on Windows (#4404) (#4430)
#4404 assumed 0.1.48 already had #4185 (ConPTY cursor position answer)
and still failed on Windows. It doesn't: #4185 merged after the 0.1.48
release, so the reports on 0.1.48 say nothing about it. Python debugging
on Windows goes back to runInTerminal with #4185, which keeps input()
working in the debug console.
2026-11-19 12:10:43 +08:00
41 змінених файлів з 241 додано та 125 видалено

No files matched your search

Створено
+47 -47
Переглянути файл
@@ -4144,7 +4144,7 @@ checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
[[package]]
name = "ide-agent"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"blake3",
"dunce",
@@ -4169,7 +4169,7 @@ dependencies = [
[[package]]
name = "ide-analysis"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ast-grep-core",
"ide-core",
@@ -4183,7 +4183,7 @@ dependencies = [
[[package]]
name = "ide-android"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-core",
"serde",
@@ -4194,7 +4194,7 @@ dependencies = [
[[package]]
name = "ide-build"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"blake3",
"chardetng",
@@ -4212,7 +4212,7 @@ dependencies = [
[[package]]
name = "ide-cli"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"dirs 6.0.0",
"serde",
@@ -4226,7 +4226,7 @@ dependencies = [
[[package]]
name = "ide-clipboard"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"gtk",
"objc2 0.6.5",
@@ -4237,7 +4237,7 @@ dependencies = [
[[package]]
name = "ide-command"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -4248,7 +4248,7 @@ dependencies = [
[[package]]
name = "ide-core"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"dunce",
"encoding_rs",
@@ -4265,7 +4265,7 @@ dependencies = [
[[package]]
name = "ide-coverage"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-core",
"ide-run",
@@ -4279,7 +4279,7 @@ dependencies = [
[[package]]
name = "ide-dap"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"base64 0.22.1",
"futures",
@@ -4308,7 +4308,7 @@ dependencies = [
[[package]]
name = "ide-db"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"base64 0.22.1",
"bb8",
@@ -4346,7 +4346,7 @@ dependencies = [
[[package]]
name = "ide-docker"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-core",
"serde",
@@ -4359,7 +4359,7 @@ dependencies = [
[[package]]
name = "ide-extension"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"base64 0.22.1",
"blake3",
@@ -4380,7 +4380,7 @@ dependencies = [
[[package]]
name = "ide-flutter"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-android",
"ide-core",
@@ -4391,7 +4391,7 @@ dependencies = [
[[package]]
name = "ide-fonts"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"objc2-core-foundation",
"objc2-core-text",
@@ -4403,7 +4403,7 @@ dependencies = [
[[package]]
name = "ide-github"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-core",
"ide-vcs",
@@ -4416,7 +4416,7 @@ dependencies = [
[[package]]
name = "ide-heap"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"criterion",
"ide-core",
@@ -4434,7 +4434,7 @@ dependencies = [
[[package]]
name = "ide-host"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"base64 0.22.1",
"blake3",
@@ -4509,7 +4509,7 @@ dependencies = [
[[package]]
name = "ide-http"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-core",
"ide-vfs",
@@ -4528,7 +4528,7 @@ dependencies = [
[[package]]
name = "ide-index"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"blake3",
"criterion",
@@ -4550,7 +4550,7 @@ dependencies = [
[[package]]
name = "ide-jdwp"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-jvm-inspect",
"proptest",
@@ -4562,7 +4562,7 @@ dependencies = [
[[package]]
name = "ide-jsonrpc"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"encoding_rs",
"futures",
@@ -4579,7 +4579,7 @@ dependencies = [
[[package]]
name = "ide-jvm-attach"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"libc",
"tempfile",
@@ -4588,7 +4588,7 @@ dependencies = [
[[package]]
name = "ide-jvm-inspect"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"futures",
"serde",
@@ -4599,7 +4599,7 @@ dependencies = [
[[package]]
name = "ide-language"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"blake3",
"criterion",
@@ -4658,7 +4658,7 @@ dependencies = [
[[package]]
name = "ide-lsp"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"dunce",
"encoding_rs",
@@ -4686,7 +4686,7 @@ dependencies = [
[[package]]
name = "ide-mcp"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"bytes",
"dunce",
@@ -4705,7 +4705,7 @@ dependencies = [
[[package]]
name = "ide-notebook"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"futures",
"ide-core",
@@ -4728,7 +4728,7 @@ dependencies = [
[[package]]
name = "ide-plugin"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"blake3",
"dunce",
@@ -4751,7 +4751,7 @@ dependencies = [
[[package]]
name = "ide-profiler"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-core",
"ide-jvm-attach",
@@ -4765,7 +4765,7 @@ dependencies = [
[[package]]
name = "ide-remote"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"dunce",
"futures",
@@ -4785,7 +4785,7 @@ dependencies = [
[[package]]
name = "ide-run"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"dunce",
"encoding_rs",
@@ -4809,7 +4809,7 @@ dependencies = [
[[package]]
name = "ide-scaffold"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-core",
"ide-tools",
@@ -4825,7 +4825,7 @@ dependencies = [
[[package]]
name = "ide-sdk"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"dunce",
"flate2",
@@ -4848,7 +4848,7 @@ dependencies = [
[[package]]
name = "ide-search"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"criterion",
"encoding_rs",
@@ -4869,7 +4869,7 @@ dependencies = [
[[package]]
name = "ide-spell"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-core",
"parking_lot",
@@ -4882,7 +4882,7 @@ dependencies = [
[[package]]
name = "ide-ssh"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"dirs 6.0.0",
"flate2",
@@ -4907,7 +4907,7 @@ dependencies = [
[[package]]
name = "ide-streams"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-core",
"ide-language",
@@ -4920,7 +4920,7 @@ dependencies = [
[[package]]
name = "ide-syntax"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-core",
"ide-language",
@@ -4935,7 +4935,7 @@ dependencies = [
[[package]]
name = "ide-terminal"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"ide-core",
"libc",
@@ -4948,7 +4948,7 @@ dependencies = [
[[package]]
name = "ide-text"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"criterion",
"ide-core",
@@ -4961,7 +4961,7 @@ dependencies = [
[[package]]
name = "ide-tools"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"flate2",
"hex",
@@ -4982,7 +4982,7 @@ dependencies = [
[[package]]
name = "ide-vcs"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"blake3",
"dunce",
@@ -5003,7 +5003,7 @@ dependencies = [
[[package]]
name = "ide-vfs"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"chardetng",
"dunce",
@@ -5029,7 +5029,7 @@ dependencies = [
[[package]]
name = "ide-web"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"dirs 6.0.0",
"ide-core",
@@ -5045,7 +5045,7 @@ dependencies = [
[[package]]
name = "ide-workspace"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"blake3",
"dunce",
@@ -6674,7 +6674,7 @@ dependencies = [
[[package]]
name = "openidea"
version = "0.1.48"
version = "0.1.49"
dependencies = [
"base64 0.22.1",
"blake3",
+1 -1
Переглянути файл
@@ -5,7 +5,7 @@ members = ["crates/*", "src-tauri"]
exclude = ["sdk", "plugins"]
[workspace.package]
version = "0.1.48"
version = "0.1.49"
edition = "2024"
rust-version = "1.96"
license = "Apache-2.0"
-25
Переглянути файл
@@ -26,12 +26,6 @@ pub(super) fn prepare_debug(config: &mut LaunchConfig, paths: &[PathBuf]) -> Ide
if extra.as_ref().is_some_and(|e| e.get("debugServer").is_some()) {
return Ok(());
}
if cfg!(windows)
&& let Some(extra) = extra.as_mut()
{
start_in_internal_console(extra);
config.extra_json = Some(extra.to_string());
}
if let Some(env) = extra.as_mut().and_then(|e| e.get_mut("env")) {
if env.is_null() {
*env = serde_json::json!({});
@@ -52,29 +46,10 @@ pub(super) fn prepare_debug(config: &mut LaunchConfig, paths: &[PathBuf]) -> Ide
Ok(())
}
/// On Windows debugpy's launcher never connects when it runs on the pseudo-terminal of
/// `runInTerminal` (ConPTY), and the launch times out; started by debugpy itself it does. The
/// program then can't read typed input, but it can be debugged.
fn start_in_internal_console(extra: &mut serde_json::Value) {
if extra.get("console").and_then(|c| c.as_str()) == Some("integratedTerminal") {
extra["console"] = serde_json::json!("internalConsole");
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn windows_debuggees_start_in_the_internal_console() {
let mut extra = serde_json::json!({"console": "integratedTerminal", "python": "python"});
start_in_internal_console(&mut extra);
assert_eq!(extra["console"], "internalConsole");
let mut external = serde_json::json!({"console": "externalTerminal"});
start_in_internal_console(&mut external);
assert_eq!(external["console"], "externalTerminal");
}
#[test]
fn debug_preserves_remote_paths_and_handles_null_env() {
let root = std::env::temp_dir().join("project");
+2 -1
Переглянути файл
@@ -471,7 +471,8 @@ async fn run_target_validation_gates_launches_and_preserves_selection() {
f._tmp.path().join("plugins"),
Arc::new(|_: Option<&str>, _| {}),
Limits {
timeout: Duration::from_millis(200),
// Room for a reclaimed instance to start again on a slow runner.
timeout: Duration::from_millis(750),
idle_timeout: Some(Duration::from_millis(20)),
restart_backoff: Duration::ZERO,
..Default::default()
+5 -1
Переглянути файл
@@ -1560,7 +1560,11 @@ fn edit_path_calls_have_soft_and_hard_deadlines() {
// Past the hard deadline: interrupted; the next call gets a new instance.
assert!(provider.highlights(&mis, "spin").is_none());
std::thread::sleep(Duration::from_millis(450));
host.tick();
// A slow runner may interrupt the spinning call a little after its deadline.
assert!(eventually(|| {
host.tick();
host.info_of("misbehave").unwrap().stats.crashes > 0
}));
let info = host.info_of("misbehave").unwrap();
assert_eq!(info.stats.crashes, 1, "{:?}", info.error);
assert!(info.error.as_deref().is_some_and(|e| e.contains("timed out after 400ms")), "{:?}", info.error);
+1 -1
Переглянути файл
@@ -359,7 +359,7 @@ fn java_analyzer_gets_the_project_jdk_and_maven_local_repository() {
s.languages.java.jdk = jdk.to_string_lossy().into_owned();
s.languages.java.maven.local_repository = repo.to_string_lossy().into_owned();
let options = configured(&s).unwrap();
assert_eq!(options["jdkHome"], jdk.canonicalize().unwrap().to_string_lossy().as_ref());
assert_eq!(options["jdkHome"], dunce::canonicalize(&jdk).unwrap().to_string_lossy().as_ref());
assert_eq!(options["maven"]["localRepository"], repo.to_string_lossy().as_ref());
// A `jdkHome` in the server's own settings wins.
s.language_servers.insert(
+2 -2
Переглянути файл
@@ -2,12 +2,12 @@
"name": "openidea",
"private": true,
"description": "An open-source IDE inspired by IntelliJ IDEA",
"version": "0.1.48",
"version": "0.1.49",
"license": "Apache-2.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc --noEmit && vite build && node scripts/check-webkit.ts",
"build": "node --max-old-space-size=4096 node_modules/typescript/bin/tsc --noEmit && vite build && node scripts/check-webkit.ts",
"preview": "vite preview",
"tauri": "node scripts/tauri.ts",
"test": "vitest run",
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// The commit being prepared in the window the current command or event came
/// from (the Commit tool window, or the Commit dialog while it is open): the
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Plugin-owned project data sources. Requires database.sources and project trust.
/// Runs on the Database subsystem's host, including on remote project servers.
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Editor and project-tree decorations (API 1.4). Requires project.read. An editor set
/// follows its file: the file's own project, or the nearest one when it is outside them all.
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// What the pane beside the Services tree shows for a plugin's node.
interface detail-types {
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Optional export (world `plugin-diagnostics`): problems in the current,
/// possibly unsaved document, for the languages declared with the
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// HTTP endpoints found in a project (`[[contributes.endpoints]]`).
interface endpoints-provider {
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Workbench events, delivered in batches to `event-handler.handle`.
interface events {
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
interface lifecycle {
use types.{context, error};
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// What other plugins contributed to the extension points this plugin declares
/// (`[[extension-points]]` in `plugin.toml`; the contributors list this plugin
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Optional export (world `plugin-file-actions`): quick fixes and
/// refactorings that create, rename or delete files, next to the text edits
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Files outside the open projects: the configuration of the program a
/// plugin integrates with, a tool installed elsewhere, a licence file.
+37 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Writes to the IDE log, tagged with the plugin id.
interface log {
@@ -34,6 +34,31 @@ interface ui {
text(string),
}
/// A highlight rule for Run and Debug console output (API 1.12).
record console-rule {
/// A regular expression (at most 512 bytes) in the syntax shared by
/// Rust's `regex` and JavaScript: no inline flags, named groups,
/// lookaround, backreferences, `\A`, `\z`, `\p`, POSIX classes or
/// repeated groups such as `(…)+`. A pattern that could take too long
/// on a long line is `invalid`. It sees the first 2000 characters of a line.
pattern: string,
ignore-case: bool,
/// A console palette colour: `black`, `red`, `green`, `yellow`,
/// `blue`, `magenta`, `cyan`, `white`, or one of them with `bright-`
/// (`bright-red`). The colour scheme's Console Colors decide how they
/// look. Unknown names are ignored.
foreground: option<string>,
/// A palette colour behind the text, as `foreground`.
background: option<string>,
/// Any of `bold`, `italic`, `underline`, `strikethrough`, `dim`.
/// Unknown names are ignored.
styles: list<string>,
/// Style the whole line instead of only the matched text.
whole-line: bool,
/// A disabled rule keeps its place in the list but never matches.
enabled: bool,
}
/// A notification button that runs one of the plugin's commands.
record notification-action {
/// Up to 256 bytes, one line.
@@ -65,6 +90,17 @@ interface ui {
set-window-status-item: func(id: string, item: status-item) -> result<_, error>;
/// Removes this window's override, falling back to the global item.
remove-window-status-item: func(id: string) -> result<_, error>;
/// Replaces the plugin's console highlight rules (API 1.12); an empty
/// list removes them. Every window applies them to the stdout and stderr
/// lines of its Run and Debug consoles; the plugin never sees the output.
/// The first enabled whole-line rule that matches a line styles it,
/// instead of the colour of its log level; each enabled match-only rule
/// styles its matches on top, an earlier rule winning where matches
/// overlap. A rule's colours and styles replace the program's own. Rules
/// of several plugins apply in plugin id order. At most 100 rules; an
/// invalid one fails the call and keeps the previous rules. They go
/// away when the plugin stops. Needs no capability.
set-console-rules: func(rules: list<console-rule>) -> result<_, error>;
/// Sets the plugin's context key `key`, which `when` clauses test as
/// `plugin.<id>.<key>`, in the window the current command or event came
/// from (every window when there is none). A window's value takes
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Optional export (world `plugin-hover`): Markdown added to the hover of
/// documents of the languages declared with the `hover` provider kind,
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Cross-file associations a plugin publishes for the files it declares under
/// `[[contributes.documentIndexers]]`. The host calls `index` in cancellable
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Embedded languages. The host routes plugin providers and configured language
/// servers inside these ranges, preserving host-document UTF-16 coordinates.
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Optional export (world `plugin-inlay-hints`): inline hints in documents of
/// the languages declared with the `inlay-hints` provider kind, including
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Problems in files, shown in the editor and the Problems view.
interface diagnostics {
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Additional language features, called only for declared API 1.4 provider kinds.
/// Editor calls have a 50 ms soft / 500 ms hard budget; formatting has 5 seconds.
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Discovery of the IDE's built-in MCP server; never exposes its URL or token.
interface mcp {
+6 -1
Переглянути файл
@@ -8,7 +8,7 @@
/// `fs` and `workspace`, and everything else goes through the imports below,
/// gated by the capabilities granted in `plugin.toml` (a missing one returns
/// `error::denied`).
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
world plugin {
import log;
@@ -212,3 +212,8 @@ world mcp-tools { export mcp-provider; }
world plugin-run-target-validation { include plugin; export run-target-validation; }
/// Export-only validation, composed with the base plugin world.
world run-target-validator { export run-target-validation; }
/// A plugin with custom Search Everywhere categories.
world plugin-search { include plugin; export search-provider; }
/// Optional export composed with the base plugin by the SDK.
world search { export search-provider; }
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Editor features a plugin provides for the languages it declares under
/// `[[contributes.providers]]` (the host calls only declared kinds). They run
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Project-scoped targets owned by the registering plugin (API 1.4).
interface run-targets {
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Launches this plugin's configurations in the invoking window's Run tool window.
interface run {
+34
Переглянути файл
@@ -0,0 +1,34 @@
package openidea:[email protected];
/// On-demand results for `[[contributes.searchCategories]]`. Optional, API 1.13.
interface search-provider {
use types.{error, location};
use invocation.{invocation};
record search-command {
/// A command declared by this plugin, without the host's prefix.
id: string,
arg: option<string>,
}
variant search-target {
/// A valid UTF-16 range inside the current project.
location(location),
command(search-command),
}
record search-item {
/// Stable within this plugin's category and query results.
id: string,
title: string,
description: option<string>,
target: search-target,
}
record search-page {
items: list<search-item>,
has-more: bool,
}
/// The category's local manifest id, raw query (at most 1024 UTF-8 bytes),
/// and requested maximum (1–200). Preserve ranking in the returned list.
/// Empty queries may return initial suggestions. This is a background call:
/// no prompts or implicit commands. Superseded queries are cancelled by the host.
search: func(category: string, query: string, limit: u32, ctx: borrow<invocation>) -> result<search-page, error>;
}
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Optional export (world `plugin-semantic-tokens`): semantic colouring of
/// documents of the languages declared with the `semantic-tokens` provider
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Shared types. Positions are 0-based lines and UTF-16 code unit columns,
/// as in the editor and LSP.
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
/// Declarative views: tool windows declared
/// under `[[contributes.views]]` and custom editors under
+1 -1
Переглянути файл
@@ -1,4 +1,4 @@
package openidea:[email protected]1.0;
package openidea:[email protected]3.0;
interface workspace {
use types.{error, location};
+1 -1
Переглянути файл
@@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "OpenIDEA",
"version": "0.1.48",
"version": "0.1.49",
"identifier": "ai.l0ng.openidea",
"build": {
"beforeDevCommand": "pnpm dev",
+1
Переглянути файл
@@ -434,6 +434,7 @@ export class EditorController implements SlotHost {
_setEditorSwitching(false);
}
for (const tab of carriedUntitled) void this.ensureSlot(tab.id);
this.manager.releaseProjectDocuments();
this.closeSession = null;
this.closeCommitted = false;
this.preparedDocuments.clear();
+22
Переглянути файл
@@ -369,6 +369,28 @@ describe("DocumentManager + slots", () => {
}
});
it("drops the modified files kept without a tab when the project goes, but keeps untitled buffers", async () => {
const { backend, manager } = setup({ "/p/a.txt": "a\n" }, { files: { autoSave: false } });
try {
const a = await manager.acquire("/p/a.txt");
const slot = new EditorSlot(a, "t1", host);
backend.patch(a.doc, [{ from: 0, to: 0, insert: "changed " }]);
slot.dispose();
const untitled = manager.adopt(await backend.openUntitled(null));
await new Promise((r) => setTimeout(r, 0));
expect(manager.byPath.get("/p/a.txt")).toBe(a);
manager.releaseProjectDocuments();
expect(a.closed).toBe(true);
expect(manager.byPath.has("/p/a.txt")).toBe(false);
expect(manager.byId.has(a.doc)).toBe(false);
expect(useDocMeta.getState()["/p/a.txt"]).toBeUndefined();
expect(manager.byPath.get(untitled.path)).toBe(untitled);
expect(await manager.acquire("/p/a.txt")).not.toBe(a);
} finally {
manager.stop();
}
});
it("Save All rejects a failed document save after saving the remaining dirty documents", async () => {
const { backend, manager } = setup({ "/p/a.txt": "a\n", "/p/b.txt": "b\n" }, { files: { autoSave: false } });
try {
+28 -15
Переглянути файл
@@ -917,21 +917,8 @@ export class DocumentManager {
if (!handoff && model.getMeta().dirty && !isUntitledUri(model.path)) return;
if (model.inUse()) return;
await model.sync.whenIdle();
if (model.inUse()) return;
model.dispose();
this.byPath.delete(model.path);
this.byId.delete(model.doc);
useDocMeta.setState((s) => {
const next = { ...s };
delete next[model.path];
return next;
}, true);
useOutline.setState((s) => {
const next = { ...s };
delete next[model.path];
return next;
}, true);
_emitEditorEvent({ type: "docClosed", doc: model.doc, path: model.path });
if (model.inUse() || model.closed) return;
this.forget(model);
try {
await this.backend.close(model.doc);
} catch (e) {
@@ -940,6 +927,32 @@ export class DocumentManager {
});
}
/**
* The project closed or another one replaced it: its backend documents are gone, including
* those kept open without a tab for their unsaved changes (the leave guard already saved or
* discarded them). Untitled buffers follow the window and stay.
*/
releaseProjectDocuments() {
for (const model of [...this.byPath.values()]) if (!isUntitledUri(model.path)) this.forget(model);
}
private forget(model: DocModel) {
model.dispose();
this.byPath.delete(model.path);
this.byId.delete(model.doc);
useDocMeta.setState((s) => {
const next = { ...s };
delete next[model.path];
return next;
}, true);
useOutline.setState((s) => {
const next = { ...s };
delete next[model.path];
return next;
}, true);
_emitEditorEvent({ type: "docClosed", doc: model.doc, path: model.path });
}
applySettings() {
for (const m of this.byPath.values()) m.applySettings();
}
+16
Переглянути файл
@@ -540,6 +540,22 @@ describe("Recent Files multi-selection", () => {
expect(useRecentPopup.getState().open).toBeNull();
});
it("Delete edits the filter while it has text after the caret, else removes the file", async () => {
const remove = vi.spyOn(commands, "removeRecent").mockResolvedValue({ status: "ok", data: null });
const input = (await showFiles()) as HTMLInputElement;
fireEvent.change(input, { target: { value: "index" } });
const before = options().length;
input.setSelectionRange(0, 0);
fireEvent.keyDown(input, { key: "Delete" });
await tick();
expect(options()).toHaveLength(before);
expect(remove).not.toHaveBeenCalled();
input.setSelectionRange(input.value.length, input.value.length);
fireEvent.keyDown(input, { key: "Delete" });
await tick();
expect(options()).toHaveLength(before - 1);
});
it("starts a range at the initially selected previous file", async () => {
vi.spyOn(contributions, "maybeEditorService").mockReturnValue({
activePath: () => "/p/one/index.ts",
+13 -4
Переглянути файл
@@ -53,6 +53,13 @@ import { cycleSwitcher, hideRecentPopup, showRecentPopup, useRecentPopup } from
import styles from "./RecentPopups.module.css";
import { tx } from "@/platform/i18n";
/** Whether Delete in `target` (a filter field) has text to delete: a selection or text after the caret. */
function textAfterCaret(target: EventTarget): boolean {
if (!(target instanceof HTMLInputElement)) return false;
const { selectionStart, selectionEnd, value } = target;
return selectionStart !== selectionEnd || (selectionEnd ?? value.length) < value.length;
}
export function RecentPopupsOverlay() {
const open = useRecentPopup((s) => s.open);
const session = useRecentPopup((s) => s.session);
@@ -267,8 +274,9 @@ function RecentFilesDialog() {
cycleSwitcher(e.shiftKey ? -1 : 1);
return;
}
// In Recent Files Backspace edits the speed search text first.
if (e.key === "Delete" || (e.key === "Backspace" && !query)) {
// In Recent Files Backspace edits the speed search text first, and so does Delete while
// the filter has text after the caret.
if ((e.key === "Delete" && !textAfterCaret(e.target)) || (e.key === "Backspace" && !query)) {
e.preventDefault();
void removeSelected();
return;
@@ -601,8 +609,9 @@ function RecentLocationsDialog() {
open(items[active], e.shiftKey);
return;
}
// IDEA: Delete removes the selected place (Backspace too while there is no filter text).
if ((e.key === "Delete" || (e.key === "Backspace" && !query)) && items[active]) {
// IDEA: Delete removes the selected place (Backspace too while there is no filter text), unless
// the filter has text after the caret to delete.
if (((e.key === "Delete" && !textAfterCaret(e.target)) || (e.key === "Backspace" && !query)) && items[active]) {
e.preventDefault();
dismissLocation(items[active]!);
return;