Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
node-version: 22
- name: Test package resources
run: node --test --test-timeout=60000 scripts/package/*.test.mjs
- name: Test bounded integration tool cleanup
run: node --test --test-timeout=15000 scripts/compiler/process.test.mjs
- name: Check formatting
run: cargo fmt --all --check
- name: Lint
Expand Down Expand Up @@ -74,6 +76,17 @@ jobs:
package=$(scripts/build-package.sh --arch "$arch")
scripts/archive-package.sh --package "$package" --arch "$arch"
done
- name: Verify native compiler settings and JARs with JDT
run: |
package=".artifacts/package/$(uname -m)/io.github.lithe-idea.java-support"
node scripts/compiler/test-live.mjs "$package"
LITHE_JAVA_PROJECT_KIND=eclipse node scripts/compiler/test-live.mjs "$package"
- name: Upload native compiler projections
uses: actions/upload-artifact@v4
with:
name: native-compiler-projection
path: .artifacts/compiler/visual-*.json
if-no-files-found: error
- name: Upload the archives
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -126,3 +139,42 @@ jobs:
dist/*-linux-*.zip.sha256
if-no-files-found: error
retention-days: 7

native-settings-visual:
name: Native compiler settings screenshots
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
needs: package
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: native-compiler-projection
path: .artifacts/compiler
- name: Read pinned host revision
id: host
run: echo "revision=$(node -p 'JSON.parse(require("fs").readFileSync("compiler-host.json")).revision')" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
repository: 1lck/Lithe-IDEA
ref: ${{ steps.host.outputs.revision }}
path: .artifacts/host
- uses: actions/setup-go@v5
with:
go-version-file: .artifacts/host/desktop/go.mod
cache: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.100.0
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Render actual compiler projections through the native host
run: node scripts/compiler/visual.mjs .artifacts/host
- uses: actions/upload-artifact@v4
with:
name: native-compiler-settings-screenshots
path: .artifacts/compiler/visual/
if-no-files-found: error
retention-days: 14
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
# Tags must match plugin.json. Build macOS arm64/x64, Windows x64 and Linux
# ARM64/x64 packages from the same revision, then upload a draft prerelease.
# The maintainer verifies the downloaded assets before publishing the draft.
# Contract 0 currently requires the matching Viva preview, not stable Lithe.
# Publish only after verification and after a stable desktop supports the required capabilities.
on:
push:
tags: ["v*"]
Expand Down
84 changes: 84 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ base64 = "0.22.1"
zip.workspace = true
url.workspace = true
dunce = "1.0.5"

sha2.workspace = true
java-properties = "2.0.0"
xmltree = "0.12.0"
jsonc-parser = { version = "0.34.0", features = ["cst", "serde"] }
libc = "0.2"
10 changes: 9 additions & 1 deletion backend/src/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,14 +647,22 @@ pub fn resolve_launch_function(
};
let trigger_files = trigger_files(&folders)?;
context.check_cancelled()?;
let answer = resolve(
let mut answer = resolve(
&request,
&package_root,
&fragments,
&trigger_files,
now_unix_seconds(),
&report,
)?;
if let Some(folder) = folders.first() {
let configuration = crate::settings_session::with_native_settings(
answer["workspaceConfiguration"].clone(),
folder,
)?;
answer["workspaceConfiguration"] = configuration.clone();
answer["initializationOptions"]["settings"] = configuration;
}
context.check_cancelled()?;
Ok(answer)
}
Expand Down
13 changes: 13 additions & 0 deletions backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
pub mod class_content;
pub mod launch;
pub mod plugin_functions;
pub mod project_settings;
pub mod run;
pub mod settings_session;

Expand Down Expand Up @@ -240,6 +241,18 @@ pub fn backend() -> Result<Backend, SdkError> {
let run_session = Arc::clone(&run_session);
move |params, context| run::rerun_function(&run_session, params, context)
})?;
let projects = Arc::new(project_settings::ProjectSettings::default());
for (function, libraries) in [("compiler.settings", false), ("libraries.settings", true)] {
let projects = Arc::clone(&projects);
let session = Arc::clone(&session);
backend.function(function, move |params, context| {
projects.snapshot(params, context, libraries, &session)
})?;
backend.suppress_success_diagnostics(function)?;
}
backend.function("compiler.prepareSettings", move |params, context| {
projects.edit(params, context)
})?;
Ok(backend)
}

Expand Down
Loading
Loading