дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-27 04:56:08 +02:00
Порівняти коміти
13
Коміти
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
e60393eccf | ||
|
|
b26318a32c | ||
|
|
8a2e370178 | ||
|
|
61a05e5a36 | ||
|
|
d9355155f3 | ||
|
|
ecd593eb0c | ||
|
|
0716a48247 | ||
|
|
699c71c1f2 | ||
|
|
014f51ae54 | ||
|
|
30b0549196 | ||
|
|
0ecbc6b35d | ||
|
|
859f63454e | ||
|
|
c1ea7a9ef2 |
No files matched your search
@@ -1,4 +1,4 @@
|
||||
Closes #
|
||||
<!-- If this resolves an issue: Closes #<n> -->
|
||||
|
||||
## What and why
|
||||
|
||||
|
||||
@@ -24,18 +24,9 @@ jobs:
|
||||
const pr = context.payload.pull_request;
|
||||
const LABEL = 'needs-info';
|
||||
const MARKER = '<!-- pr-check -->';
|
||||
// Docs, CI and pure refactors may skip the linked issue.
|
||||
const NO_ISSUE_TYPES = /^(docs|ci|build|chore|refactor|style|test)(\(.+\))?!?:/;
|
||||
|
||||
const body = (pr.body || '').replace(/<!--[\s\S]*?-->/g, '');
|
||||
const problems = [];
|
||||
|
||||
const linksIssue =
|
||||
/\b(close[sd]?|fix(e[sd])?|resolve[sd]?)\s*:?\s+(#\d+|https:\/\/github\.com\/[\w.-]+\/[\w.-]+\/issues\/\d+)/i.test(body);
|
||||
if (!linksIssue && !NO_ISSUE_TYPES.test(pr.title)) {
|
||||
problems.push('Link the issue this PR resolves, e.g. `Closes #123`.');
|
||||
}
|
||||
|
||||
const verified = body.match(/^##+\s*How it was verified\s*$([\s\S]*?)(?=^##+\s|(?![\s\S]))/im);
|
||||
if (!verified || !verified[1].trim()) {
|
||||
problems.push('Fill in **How it was verified**: the commands you ran and their results. UI changes need before/after screenshots.');
|
||||
|
||||
+8
-5
@@ -18,9 +18,12 @@ Visual style: dark, low-contrast greys, one cool accent
|
||||
- `src/ui/` — design-system primitives. `src/features/<name>/` — one feature each,
|
||||
exporting `activate()` registered in `src/features/index.ts`.
|
||||
- `languages/<id>.toml` — language definitions (detection, comments, LSP, DAP).
|
||||
- `crates/ide-host` — the `openidea-server` binary for remote development.
|
||||
- `wit/` — plugin interface definitions; `plugins/` — sample and bundled plugins;
|
||||
`templates/` — plugin starter templates.
|
||||
- `crates/ide-host` — the `openidea-server` binary for remote development and the
|
||||
`openidea-plugin` CLI (plugin starter templates live in its `templates.rs`).
|
||||
- `wit/` — plugin interface definitions; `plugins/` — sample and bundled plugins.
|
||||
Plugin docs: `plugins/README.md`, `docs/plugins/themes.md`.
|
||||
- `java/` — JDT LS extension bundles (`java-usages`, `kotlin-bridge`) and the patched
|
||||
Lombok agent, embedded into the app by `ide-sdk` / `ide-tools`.
|
||||
- `e2e/` — Playwright UI tests (`pnpm e2e`). `fixtures/` — sample projects per language
|
||||
for manual and automated testing.
|
||||
|
||||
@@ -46,8 +49,8 @@ Visual style: dark, low-contrast greys, one cool accent
|
||||
|
||||
## Issues & PRs
|
||||
|
||||
Follow `CONTRIBUTING.md` and `.github/pull_request_template.md`: one issue per PR with
|
||||
`Closes #<n>`, reproduce first, keep the diff focused, short plain description, and a
|
||||
Follow `CONTRIBUTING.md` and `.github/pull_request_template.md`: one problem per PR
|
||||
(`Closes #<n>` when it resolves an issue), reproduce first, keep the diff focused, short plain description, and a
|
||||
**How it was verified** section with commands run, results and (for UI) before/after screenshots.
|
||||
Unclear product decisions → `needs-decision` and stop.
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@ Project layout, coding rules, commands and checks are in [AGENTS.md](AGENTS.md).
|
||||
|
||||
## Pull requests
|
||||
|
||||
- One issue per PR, linked with `Closes #123`. Feature PRs need a `planned` issue.
|
||||
Docs, CI and pure refactors may skip the issue.
|
||||
- One problem per PR. If it resolves an issue, link it with `Closes #123`.
|
||||
- Reproduce the problem first, or write a test that fails before the fix.
|
||||
- Fix the cause, and check whether the same cause breaks anything nearby.
|
||||
- Keep the diff focused. Unrelated refactors go in their own PR.
|
||||
@@ -36,5 +35,4 @@ and the plugin API. Community plugins live in their authors' repositories and
|
||||
are listed through [l0ng-ai/openidea-plugins](https://github.com/l0ng-ai/openidea-plugins);
|
||||
see [`plugins/README.md`](plugins/README.md) § 8.1.
|
||||
|
||||
A check on each PR adds `needs-info` when the issue link or the verification
|
||||
section is missing, and removes it once they're filled in.
|
||||
A check on each PR adds `needs-info` when the verification section is missing, and removes it once it's filled in.
|
||||
Створено
+36
-36
@@ -4038,7 +4038,7 @@ checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
|
||||
|
||||
[[package]]
|
||||
name = "ide-agent"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"encoding_rs",
|
||||
@@ -4061,7 +4061,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-analysis"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"ast-grep-core",
|
||||
"ide-core",
|
||||
@@ -4075,7 +4075,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-build"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"dirs 6.0.0",
|
||||
"dunce",
|
||||
@@ -4090,7 +4090,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-clipboard"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"objc2 0.6.5",
|
||||
"objc2-app-kit 0.3.2",
|
||||
@@ -4099,7 +4099,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-core"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"encoding_rs",
|
||||
@@ -4116,7 +4116,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-coverage"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"ide-core",
|
||||
"ide-run",
|
||||
@@ -4130,7 +4130,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-dap"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"ide-core",
|
||||
"ide-jsonrpc",
|
||||
@@ -4148,7 +4148,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-db"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"bb8",
|
||||
"dirs 6.0.0",
|
||||
@@ -4174,7 +4174,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-docker"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"ide-core",
|
||||
"serde",
|
||||
@@ -4187,7 +4187,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-extension"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"blake3",
|
||||
@@ -4207,7 +4207,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-fonts"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"objc2-core-foundation",
|
||||
"objc2-core-text",
|
||||
@@ -4219,7 +4219,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-github"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"ide-core",
|
||||
"ide-vcs",
|
||||
@@ -4232,7 +4232,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-host"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"criterion",
|
||||
@@ -4293,7 +4293,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-http"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"ide-core",
|
||||
"parking_lot",
|
||||
@@ -4311,7 +4311,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-index"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"blake3",
|
||||
"criterion",
|
||||
@@ -4333,7 +4333,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-jsonrpc"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"futures",
|
||||
@@ -4350,7 +4350,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-language"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"blake3",
|
||||
"criterion",
|
||||
@@ -4406,7 +4406,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-lsp"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"futures",
|
||||
@@ -4432,7 +4432,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-notebook"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"ide-core",
|
||||
@@ -4455,7 +4455,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-plugin"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"blake3",
|
||||
"ide-core",
|
||||
@@ -4475,7 +4475,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-profiler"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"ide-core",
|
||||
"ide-run",
|
||||
@@ -4488,7 +4488,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-remote"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"globset",
|
||||
"ide-core",
|
||||
@@ -4505,7 +4505,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-run"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"encoding_rs",
|
||||
@@ -4528,7 +4528,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-sdk"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"ide-core",
|
||||
@@ -4547,7 +4547,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-search"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"criterion",
|
||||
"globset",
|
||||
@@ -4567,7 +4567,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-spell"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"ide-core",
|
||||
"parking_lot",
|
||||
@@ -4580,7 +4580,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-ssh"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"dirs 6.0.0",
|
||||
"flate2",
|
||||
@@ -4599,7 +4599,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-syntax"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"ide-core",
|
||||
"ide-language",
|
||||
@@ -4614,7 +4614,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-terminal"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"ide-core",
|
||||
"libc",
|
||||
@@ -4627,7 +4627,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-text"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"criterion",
|
||||
"ide-core",
|
||||
@@ -4639,7 +4639,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-tools"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"flate2",
|
||||
"hex",
|
||||
@@ -4660,7 +4660,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-vcs"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"dunce",
|
||||
"encoding_rs",
|
||||
@@ -4679,7 +4679,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-vfs"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"chardetng",
|
||||
"dunce",
|
||||
@@ -4701,7 +4701,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-web"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"ide-core",
|
||||
"open",
|
||||
@@ -4717,7 +4717,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ide-workspace"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"blake3",
|
||||
"dunce",
|
||||
@@ -6189,7 +6189,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "openidea"
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"blake3",
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ members = ["crates/*", "src-tauri"]
|
||||
exclude = ["sdk", "plugins"]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.1.35"
|
||||
version = "0.1.36"
|
||||
edition = "2024"
|
||||
rust-version = "1.96"
|
||||
license = "Apache-2.0"
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
·
|
||||
<a href="#benchmark">Benchmark</a>
|
||||
·
|
||||
<a href="#plugins">Plugins</a>
|
||||
·
|
||||
<a href="#where-its-going">Where it's going</a>
|
||||
·
|
||||
<a href="https://discord.gg/2Zy4yn7gP">Discord</a>
|
||||
</p>
|
||||
|
||||
@@ -45,6 +49,30 @@ IDEA analyses Python more deeply, so "ready" doesn't mean the same work on
|
||||
both sides. Both are measured from the outside, the same way: see
|
||||
[`perf/compare`](perf/compare) to run it on your machine and projects.
|
||||
|
||||
## Plugins
|
||||
|
||||
Plugins add actions, completion, quick fixes, tool windows, custom editors,
|
||||
themes, file icons and languages. They run as sandboxed WebAssembly components;
|
||||
themes, icon themes and languages need no code at all.
|
||||
|
||||
Install them from Settings › Plugins, or start your own with
|
||||
`openidea-plugin new` — see [Writing OpenIDEA plugins](plugins/README.md) and
|
||||
the [official plugins](plugins/official). The plugin API is still a preview.
|
||||
|
||||
## Where it's going
|
||||
|
||||
Concrete work is tracked in
|
||||
[`planned` issues](https://github.com/l0ng-ai/openidea/issues?q=is%3Aopen+label%3Aplanned).
|
||||
|
||||
- **Fast, and staying fast.** Instant typing, smooth scrolling and little memory, even on the largest projects.
|
||||
- **One IDE for every language.** Java, Python, JavaScript, Go, C/C++, C#, Rust, PHP — each as capable as the IDE built just for it.
|
||||
- **Everything included.** Frameworks, databases, profiling — built in. No editions, nothing extra to install.
|
||||
- **Work anywhere.** Local, a remote host, a container or WSL, with the same windows and keys.
|
||||
- **Easy to move over.** Bring your keymap, settings and habits with you.
|
||||
- **Open to extend.** A stable plugin API for what we don't cover.
|
||||
- **An agent workbench.** Run many agents side by side, each in its own worktree; follow, review and merge their work in one place.
|
||||
- **Beyond the desktop.** Follow projects and tasks from a phone or tablet.
|
||||
|
||||
## License
|
||||
|
||||
[Apache 2.0](LICENSE). Bundled third-party assets are listed in [`THIRD_PARTY_LICENSES.md`](THIRD_PARTY_LICENSES.md).
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
## Project Lombok
|
||||
|
||||
`plugins/lombok/lombok-1.18.48-openidea.2.jar` contains Project Lombok v1.18.48 with the Equinox
|
||||
`java/lombok/lombok-1.18.48-openidea.2.jar` contains Project Lombok v1.18.48 with the Equinox
|
||||
classloader fix from [projectlombok/lombok#4059](https://github.com/projectlombok/lombok/pull/4059)
|
||||
and the ECJ constructor-call fix from [projectlombok/lombok#4089](https://github.com/projectlombok/lombok/pull/4089).
|
||||
Copyright (C) 2009-2021 The Project Lombok Authors. MIT license and bundled component
|
||||
notices are retained in [plugins/lombok/LICENSE](plugins/lombok/LICENSE) and inside the jar.
|
||||
Source tag, patch commits and build instructions: [plugins/lombok/README.md](plugins/lombok/README.md).
|
||||
notices are retained in [java/lombok/LICENSE](java/lombok/LICENSE) and inside the jar.
|
||||
Source tag, patch commits and build instructions: [java/lombok/README.md](java/lombok/README.md).
|
||||
|
||||
## JetBrains IntelliJ Platform icons
|
||||
|
||||
|
||||
@@ -946,8 +946,12 @@ mod tests {
|
||||
std::fs::create_dir_all(path.parent().unwrap()).unwrap();
|
||||
std::fs::write(path, content).unwrap();
|
||||
}
|
||||
// The SDK's lockfile keeps the versions its own CI builds with (the resolver also
|
||||
// looks up the wasm-only dependencies, which may not be downloaded yet).
|
||||
let sdk_lock = concat!(env!("CARGO_MANIFEST_DIR"), "/../../sdk/rust/openidea-plugin/Cargo.lock");
|
||||
std::fs::copy(sdk_lock, plugin.join("Cargo.lock")).unwrap();
|
||||
let out = Command::new(std::env::var("CARGO").unwrap_or_else(|_| "cargo".into()))
|
||||
.args(["test", "--offline", "--manifest-path"])
|
||||
.args(["test", "--manifest-path"])
|
||||
.arg(plugin.join("Cargo.toml"))
|
||||
.env("CARGO_TARGET_DIR", dir.join("target"))
|
||||
.output()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Pull Members Up / Push Members Down through the app-owned JDT extension
|
||||
//! (`plugins/java-usages`). The server checks the move and computes the edit; the UI
|
||||
//! (`java/java-usages`). The server checks the move and computes the edit; the UI
|
||||
//! shows its problems and applies the edit itself.
|
||||
use super::COMMAND_TIMEOUT;
|
||||
use crate::types::{HierarchyChoice, HierarchyMembers, HierarchyRefactored, HierarchyRefactoring, RefactoringProblem};
|
||||
|
||||
Бінарний файл не відображається.
@@ -1 +1 @@
|
||||
c9acbc021f3840649823cb7680e13907d429c6fda8271fdb0ae6e5ea89ed15ee
|
||||
a50d1eb41ab8dd0c9c8d6bae8266906cd6eb5de8e6f6ca6f681990389472bb5b
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Sample OpenIDEA plugin, written with the `openidea-plugin` SDK.
|
||||
//! Build with `openidea-plugin build plugins/hello` (see plugins/README.md).
|
||||
//! Build with `openidea-plugin build crates/ide-plugin/tests/fixtures/hello` (see plugins/README.md).
|
||||
|
||||
use openidea_plugin::views::{Body, Button, TreeItem, View, ViewEvent, Viewport, Views};
|
||||
use openidea_plugin::{Context, Error, Invocation, LogLevel, NotificationLevel, Plugin, host, register_plugin};
|
||||
|
||||
@@ -1128,7 +1128,7 @@ mod tests {
|
||||
/// The same jar supplies the JDT command and the private Maven output redirector.
|
||||
pub fn kotlin_bridge_bundle(data_dir: &Path) -> Option<PathBuf> {
|
||||
let extension = data_dir.join("kotlin-bridge-1.0.0.jar");
|
||||
let bytes = include_bytes!("../../../plugins/kotlin-bridge/openidea-kotlin-bridge.jar");
|
||||
let bytes = include_bytes!("../../../java/kotlin-bridge/openidea-kotlin-bridge.jar");
|
||||
if std::fs::read(&extension).is_ok_and(|old| old == bytes) {
|
||||
return Some(extension);
|
||||
}
|
||||
@@ -1171,7 +1171,7 @@ mod kotlin_bridge_bundle_tests {
|
||||
/// Installs the app-owned JDT LS command bundle, falling back to ordinary LSP on IO failure.
|
||||
pub fn usages_bundle(data_dir: &Path) -> Option<PathBuf> {
|
||||
let extension = data_dir.join("java-usages-1.3.0.jar");
|
||||
let bytes = include_bytes!("../../../plugins/java-usages/openidea-java-usages.jar");
|
||||
let bytes = include_bytes!("../../../java/java-usages/openidea-java-usages.jar");
|
||||
if std::fs::read(&extension).is_ok_and(|old| old == bytes) {
|
||||
clean_usages_bundles(data_dir, &extension);
|
||||
return Some(extension);
|
||||
@@ -1256,10 +1256,7 @@ mod usages_bundle_tests {
|
||||
fn installs_the_exact_bundle_and_reuses_it() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let jar = super::usages_bundle(dir.path()).unwrap();
|
||||
assert_eq!(
|
||||
std::fs::read(&jar).unwrap(),
|
||||
include_bytes!("../../../plugins/java-usages/openidea-java-usages.jar")
|
||||
);
|
||||
assert_eq!(std::fs::read(&jar).unwrap(), include_bytes!("../../../java/java-usages/openidea-java-usages.jar"));
|
||||
assert_eq!(super::usages_bundle(dir.path()), Some(jar));
|
||||
assert_eq!(std::fs::read_dir(dir.path()).unwrap().count(), 1);
|
||||
}
|
||||
|
||||
@@ -641,11 +641,11 @@ pub static TOOLS: &[ToolSpec] = &[
|
||||
// ECJ 3.46.200 keeps the constructor call in a constructor's statements, which
|
||||
// @SneakyThrows / @NonNull must not wrap or precede (lombok#4089).
|
||||
// Return to Maven Central once an official release includes both.
|
||||
// Source commit, build instructions and checksum: plugins/lombok/README.md.
|
||||
// Source commit, build instructions and checksum: java/lombok/README.md.
|
||||
method: Method::Bundled {
|
||||
filename: "lombok-1.18.48-openidea.2.jar",
|
||||
version: "1.18.48-openidea.2",
|
||||
bytes: include_bytes!("../../../plugins/lombok/lombok-1.18.48-openidea.2.jar"),
|
||||
bytes: include_bytes!("../../../java/lombok/lombok-1.18.48-openidea.2.jar"),
|
||||
},
|
||||
fallback: None,
|
||||
version: V,
|
||||
|
||||
@@ -71,7 +71,7 @@ fn bundled_lombok_is_available_offline_and_repairs_missing_or_corrupt_files() {
|
||||
let env = Env::new();
|
||||
let data = env.root.parent().unwrap();
|
||||
let agent = managed_bundle(data, "lombok").unwrap();
|
||||
let checksum = include_str!("../../../plugins/lombok/SHA256SUMS").split_whitespace().next().unwrap();
|
||||
let checksum = include_str!("../../../java/lombok/SHA256SUMS").split_whitespace().next().unwrap();
|
||||
assert_eq!(sources::sha256_file(&agent).unwrap(), checksum);
|
||||
for contents in [None, Some(b"incomplete jar".as_slice())] {
|
||||
if let Some(contents) = contents {
|
||||
@@ -93,7 +93,7 @@ fn concurrent_windows_get_the_same_complete_bundled_lombok() {
|
||||
let windows: Vec<_> = (0..8).map(|_| scope.spawn(|| managed_bundle(data, "lombok").unwrap())).collect();
|
||||
let paths: Vec<_> = windows.into_iter().map(|window| window.join().unwrap()).collect();
|
||||
assert!(paths.iter().all(|path| path == &paths[0]));
|
||||
let checksum = include_str!("../../../plugins/lombok/SHA256SUMS").split_whitespace().next().unwrap();
|
||||
let checksum = include_str!("../../../java/lombok/SHA256SUMS").split_whitespace().next().unwrap();
|
||||
assert_eq!(sources::sha256_file(&paths[0]).unwrap(), checksum);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ use super::{DocState, Documents, RegEntry, disk_len, keys_for};
|
||||
use ide_core::error::ErrorKind;
|
||||
use ide_core::{DocId, FileEdit, IdeError, IdeEvent, IdeResult, NullSink, WorkspaceEdit, WorkspaceEditPrecondition};
|
||||
use parking_lot::Mutex;
|
||||
use std::collections::VecDeque;
|
||||
use std::collections::{HashMap, VecDeque};
|
||||
use std::fs;
|
||||
use std::io::Read;
|
||||
use std::path::{Path, PathBuf};
|
||||
@@ -259,7 +259,9 @@ fn hash_bytes(hash: &mut blake3::Hasher, bytes: &[u8]) {
|
||||
hash.update(bytes);
|
||||
}
|
||||
|
||||
fn hash_disk(hash: &mut blake3::Hasher, path: &Path) -> IdeResult<()> {
|
||||
/// Hashes `path` (recursively for a directory). A file in `unsaved` contributes the bytes its
|
||||
/// buffer would save, not its disk bytes, so saving a buffer leaves the hash unchanged.
|
||||
fn hash_disk(hash: &mut blake3::Hasher, path: &Path, unsaved: &HashMap<PathBuf, Vec<u8>>) -> IdeResult<()> {
|
||||
let meta = match fs::symlink_metadata(path) {
|
||||
Ok(meta) => meta,
|
||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
|
||||
@@ -277,6 +279,10 @@ fn hash_disk(hash: &mut blake3::Hasher, path: &Path) -> IdeResult<()> {
|
||||
if meta.file_type().is_symlink() {
|
||||
hash.update(b"link");
|
||||
hash_bytes(hash, fs::read_link(path)?.as_os_str().as_encoded_bytes());
|
||||
} else if let Some(bytes) = unsaved.get(path).filter(|_| meta.is_file()) {
|
||||
hash.update(b"file");
|
||||
hash.update(&(bytes.len() as u64).to_le_bytes());
|
||||
hash.update(bytes);
|
||||
} else if meta.is_file() {
|
||||
hash.update(b"file");
|
||||
hash.update(&meta.len().to_le_bytes());
|
||||
@@ -295,7 +301,7 @@ fn hash_disk(hash: &mut blake3::Hasher, path: &Path) -> IdeResult<()> {
|
||||
entries.sort_by_key(|e| e.file_name());
|
||||
for entry in entries {
|
||||
hash_bytes(hash, entry.file_name().as_encoded_bytes());
|
||||
hash_disk(hash, &entry.path())?;
|
||||
hash_disk(hash, &entry.path(), unsaved)?;
|
||||
}
|
||||
} else {
|
||||
return Err(IdeError::invalid(format!("{} is not a regular file or directory", path.display())));
|
||||
@@ -303,14 +309,19 @@ fn hash_disk(hash: &mut blake3::Hasher, path: &Path) -> IdeResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// A reverted edit may leave the dirty flag set even when all saved bytes match.
|
||||
fn differs_from_disk(state: &DocState) -> IdeResult<bool> {
|
||||
/// The bytes saving `state` would write.
|
||||
fn saved_bytes(state: &DocState) -> IdeResult<Vec<u8>> {
|
||||
let text = state.doc.text_for_save();
|
||||
let bytes = if state.native_to_ascii {
|
||||
Ok(if state.native_to_ascii {
|
||||
ide_vfs::encode_properties_ascii(&text).into_bytes()
|
||||
} else {
|
||||
ide_vfs::encode(&text, &state.encoding, state.has_bom)?
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
/// A reverted edit may leave the dirty flag set even when all saved bytes match.
|
||||
fn differs_from_disk(state: &DocState) -> IdeResult<bool> {
|
||||
let bytes = saved_bytes(state)?;
|
||||
match fs::read(&state.path) {
|
||||
Ok(disk) => Ok(disk != bytes),
|
||||
Err(error) if error.kind() == std::io::ErrorKind::NotFound => Ok(true),
|
||||
@@ -329,35 +340,31 @@ impl Documents {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// What each path holds: disk contents, with unsaved buffers in place of their files. Saving
|
||||
/// a buffer doesn't change it; edits, external writes and file operations do.
|
||||
fn fingerprints(&self, paths: &[PathBuf]) -> IdeResult<Vec<WorkspaceEditPrecondition>> {
|
||||
let mut unsaved = HashMap::new();
|
||||
for id in self.open_documents() {
|
||||
self.with_doc(id, |state| {
|
||||
let file = text_path(&state.path)?;
|
||||
if state.dirty && paths.iter().any(|path| file.starts_with(path)) && differs_from_disk(state)? {
|
||||
unsaved.insert(file, saved_bytes(state)?);
|
||||
}
|
||||
Ok(())
|
||||
})?;
|
||||
}
|
||||
paths
|
||||
.iter()
|
||||
.map(|path| {
|
||||
let mut hash = blake3::Hasher::new();
|
||||
hash_disk(&mut hash, path)?;
|
||||
let mut dirty = Vec::new();
|
||||
for id in self.open_documents() {
|
||||
self.with_doc(id, |state| {
|
||||
let file = text_path(&state.path)?;
|
||||
if state.dirty && file.starts_with(path) && differs_from_disk(state)? {
|
||||
dirty.push((
|
||||
file,
|
||||
state.doc.text(),
|
||||
state.encoding.clone(),
|
||||
state.doc.line_ending(),
|
||||
state.has_bom,
|
||||
));
|
||||
}
|
||||
Ok(())
|
||||
})?;
|
||||
}
|
||||
dirty.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
for (file, text, encoding, ending, bom) in dirty {
|
||||
hash_disk(&mut hash, path, &unsaved)?;
|
||||
// Unsaved files not on disk (yet) or outside what the walk above reached.
|
||||
let mut extra: Vec<_> =
|
||||
unsaved.iter().filter(|(file, _)| file.starts_with(path) && !file.exists()).collect();
|
||||
extra.sort_by(|a, b| a.0.cmp(b.0));
|
||||
for (file, bytes) in extra {
|
||||
hash_bytes(&mut hash, file.as_os_str().as_encoded_bytes());
|
||||
hash_bytes(&mut hash, text.as_bytes());
|
||||
hash_bytes(&mut hash, encoding.as_bytes());
|
||||
hash_bytes(&mut hash, ending.as_str().as_bytes());
|
||||
hash.update(&[u8::from(bom)]);
|
||||
hash_bytes(&mut hash, bytes);
|
||||
}
|
||||
Ok(WorkspaceEditPrecondition { path: path.clone().into(), hash: hash.finalize().to_hex().to_string() })
|
||||
})
|
||||
|
||||
@@ -144,6 +144,38 @@ fn unversioned_preview_rejects_changed_disk_and_dirty_buffers() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn saving_between_preview_and_apply_keeps_the_edit_valid() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
// A new scratch (empty on disk) and an edited file, saved after the edit was computed.
|
||||
for (name, disk, typed) in [("scratch.c", "", "int\n"), ("a.txt", "old\n", "own")] {
|
||||
let path = tmp.path().join(name);
|
||||
std::fs::write(&path, disk).unwrap();
|
||||
let docs = documents();
|
||||
let info = docs.open(&path).unwrap();
|
||||
let replace = if disk.is_empty() { 0 } else { 3 };
|
||||
docs.edit(
|
||||
info.id,
|
||||
info.version,
|
||||
ChangeSet { changes: vec![TextChange { from: 0, to: replace, insert: typed.into() }] },
|
||||
)
|
||||
.unwrap();
|
||||
let mut change = WorkspaceEdit { files: vec![edit(&path, "new")], ..Default::default() };
|
||||
docs.prepare_workspace_edit(&mut change).unwrap();
|
||||
docs.save(info.id).unwrap();
|
||||
docs.apply_workspace_edit(&change).unwrap_or_else(|e| panic!("{name}: {e}"));
|
||||
assert!(docs.snapshot(info.id).unwrap().text.starts_with("new"), "{name}");
|
||||
// A real change after the preview still invalidates it.
|
||||
let mut change = WorkspaceEdit { files: vec![edit(&path, "xyz")], ..Default::default() };
|
||||
docs.prepare_workspace_edit(&mut change).unwrap();
|
||||
let version = docs.snapshot(info.id).unwrap().version;
|
||||
docs.edit(info.id, version, ChangeSet { changes: vec![TextChange { from: 0, to: 0, insert: "!".into() }] })
|
||||
.unwrap();
|
||||
docs.save(info.id).unwrap();
|
||||
assert!(docs.apply_workspace_edit(&change).is_err(), "{name}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn grouped_undo_restores_open_closed_and_unsaved_files() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Pull Members Up / Push Members Down. The language server is stubbed at the IPC layer: the
|
||||
* Java side is covered by plugins/java-usages/tests/hierarchy.py against a real JDT LS.
|
||||
* Java side is covered by java/java-usages/tests/hierarchy.py against a real JDT LS.
|
||||
*/
|
||||
import type { Page } from "@playwright/test";
|
||||
import { expect, openFromTree, test } from "./fixtures";
|
||||
|
||||
@@ -95,10 +95,10 @@ runtime or resolve profile/precedence rules.
|
||||
Use the JDT LS distribution / Java version documented in [README](README.md).
|
||||
|
||||
```sh
|
||||
python3 plugins/java-usages/build.py /path/to/jdtls
|
||||
python3 plugins/java-usages/tests/configuration.py /path/to/jdtls
|
||||
OPENIDEA_CONFIGURATION_STRESS=1 python3 plugins/java-usages/tests/configuration.py /path/to/jdtls
|
||||
OPENIDEA_SPRING_BOOT_JAR=/path/to/spring-boot-autoconfigure.jar python3 plugins/java-usages/tests/configuration.py /path/to/jdtls
|
||||
python3 java/java-usages/build.py /path/to/jdtls
|
||||
python3 java/java-usages/tests/configuration.py /path/to/jdtls
|
||||
OPENIDEA_CONFIGURATION_STRESS=1 python3 java/java-usages/tests/configuration.py /path/to/jdtls
|
||||
OPENIDEA_SPRING_BOOT_JAR=/path/to/spring-boot-autoconfigure.jar python3 java/java-usages/tests/configuration.py /path/to/jdtls
|
||||
cargo test -p ide-language -p ide-lsp
|
||||
```
|
||||
|
||||
File renamed without changes.
@@ -78,7 +78,7 @@ Version 1.3.0 adds the class-hierarchy refactoring commands; its reproducible SH
|
||||
|
||||
```sh
|
||||
export PATH=/path/to/jdk25/bin:$PATH
|
||||
python3 plugins/java-usages/build.py /path/to/jdtls
|
||||
python3 java/java-usages/build.py /path/to/jdtls
|
||||
```
|
||||
|
||||
## Manual upgrades
|
||||
@@ -100,10 +100,10 @@ not rebuild this jar. A maintainer must:
|
||||
## Real server verification
|
||||
|
||||
```sh
|
||||
python3 plugins/java-usages/tests/verify.py /path/to/jdtls /path/to/lombok.jar
|
||||
python3 plugins/java-usages/tests/read-write.py /path/to/jdtls /path/to/lombok.jar > /tmp/read-write.json
|
||||
OPENIDEA_USAGES_INDEX_STRESS=1 python3 plugins/java-usages/tests/read-write.py /path/to/jdtls /path/to/lombok.jar > /tmp/read-write-indexed.json
|
||||
python3 plugins/java-usages/tests/hierarchy.py /path/to/jdtls
|
||||
python3 java/java-usages/tests/verify.py /path/to/jdtls /path/to/lombok.jar
|
||||
python3 java/java-usages/tests/read-write.py /path/to/jdtls /path/to/lombok.jar > /tmp/read-write.json
|
||||
OPENIDEA_USAGES_INDEX_STRESS=1 python3 java/java-usages/tests/read-write.py /path/to/jdtls /path/to/lombok.jar > /tmp/read-write-indexed.json
|
||||
python3 java/java-usages/tests/hierarchy.py /path/to/jdtls
|
||||
```
|
||||
|
||||
The harnesses select the JDT LS configuration for the current platform. The first
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -73,7 +73,7 @@ checks cancellation. No Maven download is needed for this harness.
|
||||
|
||||
```sh
|
||||
export PATH=/path/to/jdk25/bin:$PATH
|
||||
python3 plugins/java-usages/tests/read-write.py /path/to/jdtls /path/to/lombok.jar > /tmp/read-write.json
|
||||
python3 java/java-usages/tests/read-write.py /path/to/jdtls /path/to/lombok.jar > /tmp/read-write.json
|
||||
```
|
||||
|
||||
Then launch the desktop app with `pnpm tauri dev` and open the same Java/Lombok
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -47,8 +47,8 @@ for the JDT command and Java 8 target for the Maven participant. Use Java 25 to
|
||||
run the build compiler. Archive order and timestamps are deterministic.
|
||||
|
||||
```sh
|
||||
python3 plugins/kotlin-bridge/build.py /path/to/jdtls /path/to/maven
|
||||
shasum -a 256 plugins/kotlin-bridge/openidea-kotlin-bridge.jar
|
||||
python3 java/kotlin-bridge/build.py /path/to/jdtls /path/to/maven
|
||||
shasum -a 256 java/kotlin-bridge/openidea-kotlin-bridge.jar
|
||||
```
|
||||
|
||||
Committed jar SHA-256:
|
||||
@@ -61,7 +61,7 @@ data directory, and includes it in JDT LS initialization bundles.
|
||||
|
||||
```sh
|
||||
# `java` on PATH must satisfy JDT LS; JAVA_HOME selects Maven's project JDK.
|
||||
JAVA_HOME=/path/to/project/jdk python3 plugins/kotlin-bridge/tests/verify.py /path/to/jdtls
|
||||
JAVA_HOME=/path/to/project/jdk python3 java/kotlin-bridge/tests/verify.py /path/to/jdtls
|
||||
```
|
||||
|
||||
Requires Maven on PATH and access to Kotlin 2.0.10 and the fixture's Maven
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -52,7 +52,7 @@ git fetch https://github.com/Rawi01/lombok.git eclipse-constructor-call-statemen
|
||||
git cherry-pick 2d535482a913de46c27d06c5b0b294918ede3f9c 3098f4dd78b5349c2f382e7310e64db810dd380b
|
||||
git cherry-pick 7832faa49b35c839088866daf865384c82cd555f 3f3a80b857a969839ab1baba12767aec4965ac32
|
||||
ant dist
|
||||
cp dist/lombok.jar /path/to/openidea/plugins/lombok/lombok-1.18.48-openidea.2.jar
|
||||
cp dist/lombok.jar /path/to/openidea/java/lombok/lombok-1.18.48-openidea.2.jar
|
||||
```
|
||||
|
||||
The changelog context conflicts because the first commit adds a release-note line under the
|
||||
@@ -96,7 +96,7 @@ On macOS arm64 with JDT LS 1.63.0 / Equinox 3.25.0, server OpenJDK 25 and projec
|
||||
programs ran with identical output, and `@NonNull` checks run after the constructor call again.
|
||||
- Real JDT LS `java/buildWorkspace(true)` of the same sources with the agent: `openidea.1` reported
|
||||
Failed with three internal errors and wrote no classes; `openidea.2` Succeeded with all classes.
|
||||
- `plugins/java-usages/tests/verify.py` and `read-write.py` passed with `openidea.2`.
|
||||
- `java/java-usages/tests/verify.py` and `read-write.py` passed with `openidea.2`.
|
||||
|
||||
Windows and Linux runtime validation has not been performed. Rust tests cover source selection
|
||||
for both supported architectures on all three OS variants, offline provisioning, corruption
|
||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -2,7 +2,7 @@
|
||||
"name": "openidea",
|
||||
"private": true,
|
||||
"description": "An open-source IDE inspired by IntelliJ IDEA",
|
||||
"version": "0.1.35",
|
||||
"version": "0.1.36",
|
||||
"license": "Apache-2.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "OpenIDEA",
|
||||
"version": "0.1.35",
|
||||
"version": "0.1.36",
|
||||
"identifier": "ai.l0ng.openidea",
|
||||
"build": {
|
||||
"beforeDevCommand": "pnpm dev",
|
||||
|
||||
@@ -21,6 +21,51 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe("EditorController", () => {
|
||||
it("autosaves on blur, but not while focus is in a popup over the editor", async () => {
|
||||
const backend = createMemoryBackend({ "/p/a.c": "int main() {\n \n}\n" });
|
||||
const save = vi.spyOn(backend, "save");
|
||||
ctrl = new EditorController(backend);
|
||||
ctrl.start();
|
||||
await ctrl.openFile("/p/a.c", { focus: false });
|
||||
const slot = ctrl.activeSlot!;
|
||||
const host = document.createElement("div");
|
||||
const popup = document.createElement("div");
|
||||
popup.setAttribute("data-popup", "");
|
||||
const popupList = document.createElement("button");
|
||||
popup.appendChild(popupList);
|
||||
const elsewhere = document.createElement("button");
|
||||
document.body.append(host, popup, elsewhere);
|
||||
try {
|
||||
const view = slot.mount(host);
|
||||
ctrl.onMounted(slot);
|
||||
const type = () => view.dispatch({ changes: { from: 0, insert: "x" }, userEvent: "input.type" });
|
||||
// Into a popup (⌥↵ intentions): nothing is saved while it is open.
|
||||
view.focus();
|
||||
type();
|
||||
popupList.focus();
|
||||
await new Promise((r) => setTimeout(r, 20));
|
||||
expect(save).not.toHaveBeenCalled();
|
||||
// Back to the editor (popup closed): still nothing.
|
||||
view.focus();
|
||||
await new Promise((r) => setTimeout(r, 20));
|
||||
expect(save).not.toHaveBeenCalled();
|
||||
// From the popup elsewhere: saved then.
|
||||
popupList.focus();
|
||||
await new Promise((r) => setTimeout(r, 20));
|
||||
elsewhere.focus();
|
||||
await vi.waitFor(() => expect(save).toHaveBeenCalledTimes(1));
|
||||
// Straight elsewhere: saved.
|
||||
view.focus();
|
||||
type();
|
||||
elsewhere.focus();
|
||||
await vi.waitFor(() => expect(save).toHaveBeenCalledTimes(2));
|
||||
} finally {
|
||||
host.remove();
|
||||
popup.remove();
|
||||
elsewhere.remove();
|
||||
}
|
||||
});
|
||||
|
||||
it("leaves modified Enter to a non-text editor after switching from a focused file", async () => {
|
||||
ctrl = new EditorController(createMemoryBackend({ "/p/a.ts": "one\ntwo\n" }));
|
||||
ctrl.start();
|
||||
|
||||
@@ -588,7 +588,21 @@ export class EditorController implements SlotHost {
|
||||
|
||||
onBlur(slot: EditorSlot) {
|
||||
setContext("editorTextFocus", false);
|
||||
if (this.autoSave()) void slot.model.save("auto").catch(() => {});
|
||||
if (!this.autoSave()) return;
|
||||
const save = () => void slot.model.save("auto").catch(() => {});
|
||||
if (typeof document === "undefined") return save();
|
||||
// A popup (intentions, completion, …) belongs to the editor: saving under it would change
|
||||
// the text (save cleanup) its items were computed for. Save once focus leaves it elsewhere.
|
||||
setTimeout(() => {
|
||||
if (slot.view?.hasFocus) return;
|
||||
if (!inPopup(document.activeElement)) return save();
|
||||
const onFocusIn = (e: FocusEvent) => {
|
||||
if (inPopup(e.target)) return;
|
||||
document.removeEventListener("focusin", onFocusIn);
|
||||
if (!slot.view?.hasFocus) save();
|
||||
};
|
||||
document.addEventListener("focusin", onFocusIn);
|
||||
});
|
||||
}
|
||||
|
||||
onSelection(slot: EditorSlot, navigatedFrom?: { line: number; col: number }) {
|
||||
@@ -1892,3 +1906,7 @@ function revealLabel(): string {
|
||||
const os = usePlatform.getState().os;
|
||||
return os === "macos" ? "Finder" : os === "windows" ? "Explorer" : "Files";
|
||||
}
|
||||
|
||||
function inPopup(target: EventTarget | null): boolean {
|
||||
return target instanceof Element && !!target.closest("[data-popup]");
|
||||
}
|
||||
@@ -369,17 +369,6 @@
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.marketBar {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.marketBar > :first-child {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.categorySelect {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import {
|
||||
EmptyState,
|
||||
Icon,
|
||||
IconButton,
|
||||
Input,
|
||||
SearchField,
|
||||
Select,
|
||||
Spinner,
|
||||
@@ -48,6 +47,7 @@ import {
|
||||
} from "./store";
|
||||
import { useProject } from "@/platform/project";
|
||||
import { importIntellijTheme, showInstalledIntellijThemes } from "./intellijImport";
|
||||
import { promptInput } from "@/workbench/inputDialogs";
|
||||
import styles from "./PluginsPage.module.css";
|
||||
import { tx } from "@/platform/i18n";
|
||||
|
||||
@@ -537,6 +537,21 @@ interface GearActions {
|
||||
install: (packageFile: boolean) => void;
|
||||
importIntellijFile: () => void;
|
||||
importInstalledIntellij: () => void;
|
||||
editRepository: () => void;
|
||||
}
|
||||
|
||||
/** Asks for the marketplace index URL; an empty one restores the default. */
|
||||
async function editMarketUrl() {
|
||||
const url = await promptInput({
|
||||
title: "Plugin Repository",
|
||||
label: "Marketplace index URL:",
|
||||
initial: usePlugins.getState().marketUrl ?? "",
|
||||
placeholder: "https://…/index.json or a folder path",
|
||||
okLabel: "Save",
|
||||
validate: () => null,
|
||||
hint: <T>Leave empty to use the default repository.</T>,
|
||||
});
|
||||
if (url !== null) await setMarketUrl(url);
|
||||
}
|
||||
|
||||
function gearMenu(plugins: readonly PluginInfo[], updates: number, actions: GearActions): MenuItem[] {
|
||||
@@ -550,6 +565,7 @@ function gearMenu(plugins: readonly PluginInfo[], updates: number, actions: Gear
|
||||
{ kind: "separator" },
|
||||
{ label: "Install Plugin from Disk…", icon: "package", run: () => actions.install(false) },
|
||||
{ label: "Install Plugin from Package File…", run: () => actions.install(true) },
|
||||
{ label: "Plugin Repository…", run: actions.editRepository },
|
||||
...(actions.canImport
|
||||
? [
|
||||
{ kind: "separator" as const },
|
||||
@@ -654,30 +670,6 @@ function CategoryFilter({
|
||||
);
|
||||
}
|
||||
|
||||
/** The marketplace index URL, editable in place. */
|
||||
function MarketUrlBar() {
|
||||
const current = usePlugins((s) => s.marketUrl);
|
||||
const [value, setValue] = useState(current ?? "");
|
||||
useEffect(() => setValue(current ?? ""), [current]);
|
||||
return (
|
||||
<form
|
||||
className={styles.marketBar}
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
void setMarketUrl(value);
|
||||
}}
|
||||
>
|
||||
<Input
|
||||
value={value}
|
||||
placeholder="Marketplace index URL (https://…/index.json or a folder path)"
|
||||
aria-label="Marketplace index URL"
|
||||
onChange={(e) => setValue(e.target.value)}
|
||||
/>
|
||||
<IconButton icon="refresh" title="Refresh Marketplace" type="submit" />
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
function MarketRow({ entry, selected, onSelect }: { entry: MarketPlugin; selected: boolean; onSelect: () => void }) {
|
||||
const update = isUpdate(entry);
|
||||
return (
|
||||
@@ -832,6 +824,7 @@ export function PluginsPage() {
|
||||
install: (packageFile) => void installFromDisk(undefined, packageFile).then(showInstalled),
|
||||
importIntellijFile: () => void importIntellijTheme().then(showInstalled),
|
||||
importInstalledIntellij: () => showInstalledIntellijThemes(showInstalled),
|
||||
editRepository: () => void editMarketUrl(),
|
||||
}),
|
||||
);
|
||||
};
|
||||
@@ -876,7 +869,7 @@ export function PluginsPage() {
|
||||
className={styles.search}
|
||||
value={query}
|
||||
onChange={setQuery}
|
||||
placeholder={tab === "installed" ? "Search installed plugins" : "Search local plugins"}
|
||||
placeholder={tab === "installed" ? "Search installed plugins" : "Search plugins"}
|
||||
aria-label="Filter plugins"
|
||||
/>
|
||||
{tab === "installed" ? (
|
||||
@@ -916,20 +909,11 @@ export function PluginsPage() {
|
||||
</ul>
|
||||
) : (
|
||||
<ul className={styles.list} aria-label={tx("Available plugins")}>
|
||||
<li className={styles.marketItem}>
|
||||
<MarketUrlBar />
|
||||
</li>
|
||||
{(market?.length ?? 0) > 0 && (
|
||||
<li className={styles.marketItem}>
|
||||
<CategoryFilter market={market ?? []} value={category} onChange={setCategory} />
|
||||
</li>
|
||||
)}
|
||||
{!marketUrl && !marketError && (
|
||||
<li className={styles.notice} role="note">
|
||||
<Icon name="info" size={14} />
|
||||
<span>{tx`${NO_REPOSITORY}. Showing plugin packages available on this machine.`}</span>
|
||||
</li>
|
||||
)}
|
||||
{marketError && <li className={clsx(styles.listEmpty, styles.errorText)}>{marketError}</li>}
|
||||
{marketShown.length > 0 && <ListHeader title="Marketplace" count={marketShown.length} />}
|
||||
{marketShown.map((m) => (
|
||||
@@ -983,6 +967,8 @@ export function PluginsPage() {
|
||||
/>
|
||||
) : selectedEntry ? (
|
||||
<CatalogDetails key={selectedEntry.id} entry={selectedEntry} />
|
||||
) : marketUrl ? (
|
||||
<EmptyState className={styles.detailsEmpty} title="No plugin selected" />
|
||||
) : (
|
||||
<EmptyState className={styles.detailsEmpty} title={NO_REPOSITORY}>
|
||||
<T>Install a plugin folder with</T> <code>plugin.toml</code>{" "}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { executeAction, executeActionFrom, getAction, registerAction } from "@/p
|
||||
import { useProject } from "@/platform/project";
|
||||
import { pluginThemeRef, useContributedIconThemes } from "@/platform/themes";
|
||||
import { ContextMenuHost, hideContextMenu } from "@/ui";
|
||||
import { InputDialogsHost } from "@/workbench/inputDialogs";
|
||||
import { provideNotificationService, type NotificationService } from "@/workbench/contributions";
|
||||
import { applyThemeAttributes, previewTheme, useThemeOverride } from "@/workbench/theme";
|
||||
import { createMemoryPluginsBackend, sampleCatalog, setPluginsBackend, type PluginsBackend } from "../backend";
|
||||
@@ -561,7 +562,6 @@ describe("PluginsPage", () => {
|
||||
render(<PluginsPage />);
|
||||
await user.click(screen.getByRole("tab", { name: /Available/ }));
|
||||
const list = await screen.findByRole("list", { name: "Available plugins" });
|
||||
expect(within(list).getByText(new RegExp(NO_REPOSITORY))).toBeInTheDocument();
|
||||
await waitFor(() => expect(within(list).getByText("Toy Language")).toBeInTheDocument());
|
||||
await user.click(within(list).getByText("Toy Language"));
|
||||
expect(screen.getByRole("heading", { level: 2 })).toHaveTextContent("Toy Language");
|
||||
@@ -663,6 +663,53 @@ describe("marketplace", () => {
|
||||
expect(asked[0]).toMatchObject({ pluginId: "hello", kind: "install" });
|
||||
});
|
||||
|
||||
it("doesn't claim there is no repository while one is configured", async () => {
|
||||
setPluginsBackend({
|
||||
...createMemoryPluginsBackend([], []),
|
||||
marketUrl: async () => "https://plugins.example/index.json",
|
||||
market: async () => [],
|
||||
});
|
||||
const user = userEvent.setup();
|
||||
render(<PluginsPage />);
|
||||
await user.click(screen.getByRole("tab", { name: /Available/ }));
|
||||
expect(await screen.findByText("No plugin selected")).toBeInTheDocument();
|
||||
expect(screen.queryByText(new RegExp(NO_REPOSITORY))).not.toBeInTheDocument();
|
||||
expect(screen.getByRole("textbox", { name: "Filter plugins" })).toHaveAttribute("placeholder", "Search plugins");
|
||||
});
|
||||
|
||||
it("edits the repository from the gear menu; an empty URL restores the default", async () => {
|
||||
const base = createMemoryPluginsBackend([], []);
|
||||
const set: (string | null)[] = [];
|
||||
setPluginsBackend({
|
||||
...base,
|
||||
marketUrl: async () => "https://plugins.example/index.json",
|
||||
market: async () => [],
|
||||
setMarketUrl: async (url) => void set.push(url),
|
||||
});
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<>
|
||||
<PluginsPage />
|
||||
<ContextMenuHost />
|
||||
<InputDialogsHost />
|
||||
</>,
|
||||
);
|
||||
await user.click(screen.getByRole("tab", { name: /Available/ }));
|
||||
expect(screen.queryByRole("textbox", { name: /Marketplace index URL/ })).not.toBeInTheDocument();
|
||||
const edit = async (value: string) => {
|
||||
await user.click(screen.getByRole("button", { name: "Manage Plugins" }));
|
||||
await user.click(screen.getByRole("menuitem", { name: "Plugin Repository…" }));
|
||||
const field = await screen.findByRole("textbox", { name: /Marketplace index URL/ });
|
||||
await waitFor(() => expect(field).toHaveValue("https://plugins.example/index.json"));
|
||||
await user.clear(field);
|
||||
if (value) await user.type(field, value);
|
||||
await user.click(screen.getByRole("button", { name: "Save" }));
|
||||
};
|
||||
await edit("https://mirror.example/index.json");
|
||||
await edit("");
|
||||
await waitFor(() => expect(set).toEqual(["https://mirror.example/index.json", null]));
|
||||
});
|
||||
|
||||
it("filters the marketplace by category", async () => {
|
||||
const entry = (id: string, name: string, categories: string[]) => ({
|
||||
id,
|
||||
|
||||
@@ -1859,7 +1859,6 @@
|
||||
"Search frames": "Rechercher des cadres",
|
||||
"Search in comments and strings": "Rechercher dans les commentaires et les chaînes",
|
||||
"Search installed plugins": "Rechercher parmi les plugins installés",
|
||||
"Search local plugins": "Rechercher parmi les plugins locaux",
|
||||
"Search packages": "Rechercher des paquets",
|
||||
"Search projects": "Rechercher des projets",
|
||||
"Search pull requests": "Rechercher des pull requests",
|
||||
@@ -4406,7 +4405,6 @@
|
||||
"Memory & Diagnostics": "Mémoire et diagnostics",
|
||||
"Over budget ({budget})": "Budget dépassé ({budget})",
|
||||
"dev": "dev",
|
||||
"{label}. Showing plugin packages available on this machine.": "{label}. Affichage des packages de plugins disponibles sur cette machine.",
|
||||
"Zoomed into {name}": "Zoom sur {name}",
|
||||
"Rename directory '{current}' and its usages to:": "Renommer le répertoire '{current}' et ses utilisations en :",
|
||||
"Rename file '{current}' and its usages to:": "Renommer le fichier '{current}' et ses utilisations en :",
|
||||
@@ -5548,8 +5546,6 @@
|
||||
"Unsigned": "Non signé",
|
||||
"Roll Back to {previousVersion}": "Revenir à {previousVersion}",
|
||||
"Install Plugin from Package File…": "Installer un plugin depuis un fichier de paquet…",
|
||||
"Marketplace index URL": "URL de l'index de la marketplace",
|
||||
"Refresh Marketplace": "Actualiser la marketplace",
|
||||
"The plugin system is a preview: its API and the plugins may still change.": "Le système de plugins est en préversion : son API et les plugins peuvent encore changer.",
|
||||
"Linked for development": "Lié pour le développement",
|
||||
"Marketplace": "Marketplace",
|
||||
@@ -5782,7 +5778,6 @@
|
||||
"Weekly limit": "Limite hebdomadaire",
|
||||
"Weekly Opus limit": "Limite hebdomadaire Opus",
|
||||
"Weekly Sonnet limit": "Limite hebdomadaire Sonnet",
|
||||
"Marketplace index URL (https://…/index.json or a folder path)": "URL de l'index de la marketplace (https://…/index.json ou un chemin de dossier)",
|
||||
"Editor Providers": "Fournisseurs d'éditeurs",
|
||||
"Syntax errors": "Erreurs de syntaxe",
|
||||
"Pull Members Up…": "Remonter les membres…",
|
||||
|
||||
@@ -1937,7 +1937,6 @@
|
||||
"Search frames": "프레임 검색",
|
||||
"Search in comments and strings": "주석 및 문자열에서 검색",
|
||||
"Search installed plugins": "설치된 플러그인 검색",
|
||||
"Search local plugins": "로컬 플러그인 검색",
|
||||
"Search packages": "패키지 검색",
|
||||
"Search projects": "프로젝트 검색",
|
||||
"Search pull requests": "풀 리퀘스트 검색",
|
||||
@@ -4517,7 +4516,6 @@
|
||||
"Memory & Diagnostics": "메모리 및 진단",
|
||||
"Over budget ({budget})": "예산 초과({budget})",
|
||||
"dev": "개발",
|
||||
"{label}. Showing plugin packages available on this machine.": "{label}. 이 머신에서 사용 가능한 플러그인 패키지를 표시합니다.",
|
||||
"Zoomed into {name}": "{name} 확대됨",
|
||||
"Rename directory '{current}' and its usages to:": "디렉터리 '{current}' 및 해당 사용 위치의 새 이름:",
|
||||
"Rename file '{current}' and its usages to:": "파일 '{current}' 및 해당 사용 위치의 새 이름:",
|
||||
@@ -5708,14 +5706,11 @@
|
||||
"Unsigned": "서명되지 않음",
|
||||
"Roll Back to {previousVersion}": "{previousVersion}(으)로 롤백",
|
||||
"Install Plugin from Package File…": "패키지 파일에서 플러그인 설치…",
|
||||
"Marketplace index URL": "마켓플레이스 인덱스 URL",
|
||||
"Refresh Marketplace": "마켓플레이스 새로 고침",
|
||||
"Marketplace": "마켓플레이스",
|
||||
"Could not download plugin": "플러그인을 다운로드할 수 없습니다",
|
||||
"Rolled back {name} to {version}": "{name}을(를) {version}(으)로 롤백했습니다",
|
||||
"Could not roll back": "롤백할 수 없습니다",
|
||||
"Could not open the package": "패키지를 열 수 없습니다",
|
||||
"Marketplace index URL (https://…/index.json or a folder path)": "마켓플레이스 인덱스 URL(https://…/index.json 또는 폴더 경로)",
|
||||
"Settings of the plugin; projects can override them.": "플러그인 설정입니다. 프로젝트에서 재정의할 수 있습니다.",
|
||||
"Menus": "메뉴",
|
||||
"Shortcuts": "단축키",
|
||||
|
||||
@@ -1940,8 +1940,8 @@
|
||||
"Search frames": "搜索帧",
|
||||
"Search in comments and strings": "在注释和字符串中搜索",
|
||||
"Search installed plugins": "搜索已安装的插件",
|
||||
"Search local plugins": "搜索本地插件",
|
||||
"Search packages": "搜索软件包",
|
||||
"Search plugins": "搜索插件",
|
||||
"Search projects": "搜索项目",
|
||||
"Search pull requests": "搜索拉取请求",
|
||||
"Search query": "搜索查询",
|
||||
@@ -4535,7 +4535,6 @@
|
||||
"Memory & Diagnostics": "内存与诊断",
|
||||
"Over budget ({budget})": "超出预算({budget})",
|
||||
"dev": "开发",
|
||||
"{label}. Showing plugin packages available on this machine.": "{label}。显示此计算机上可用的插件包。",
|
||||
"Zoomed into {name}": "已缩放到 {name}",
|
||||
"Rename directory '{current}' and its usages to:": "将目录“{current}”及其用法重命名为:",
|
||||
"Rename file '{current}' and its usages to:": "将文件“{current}”及其用法重命名为:",
|
||||
@@ -5791,14 +5790,15 @@
|
||||
"1 theme": "1 个主题",
|
||||
"{count} themes": "{count} 个主题",
|
||||
"No theme plugins found in JetBrains IDEs on this computer. Choose a theme plugin downloaded from the JetBrains Marketplace (.jar or .zip) or a .theme.json file instead.": "在此计算机上的 JetBrains IDE 中未找到主题插件。请改为选择从 JetBrains Marketplace 下载的主题插件(.jar 或 .zip)或 .theme.json 文件。",
|
||||
"Marketplace index URL": "插件市场索引 URL",
|
||||
"Refresh Marketplace": "刷新插件市场",
|
||||
"Marketplace": "插件市场",
|
||||
"Plugin Repository…": "插件仓库…",
|
||||
"Plugin Repository": "插件仓库",
|
||||
"Marketplace index URL:": "插件市场索引 URL:",
|
||||
"Leave empty to use the default repository.": "留空则使用默认仓库。",
|
||||
"Could not download plugin": "无法下载插件",
|
||||
"Rolled back {name} to {version}": "已将 {name} 回滚到 {version}",
|
||||
"Could not roll back": "无法回滚",
|
||||
"Could not open the package": "无法打开插件包",
|
||||
"Marketplace index URL (https://…/index.json or a folder path)": "插件市场索引 URL(https://…/index.json 或文件夹路径)",
|
||||
"Settings of the plugin; projects can override them.": "插件的设置;项目可以覆盖。",
|
||||
"Menus": "菜单",
|
||||
"Shortcuts": "快捷键",
|
||||
|
||||
Reference in new issue
Заблокувати користувача