Skip to content

Added LSP Develop gradle task #1059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2025
Merged
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
21 changes: 21 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,27 @@ tasks.compileJava{
options.encoding = "UTF-8"
}

tasks.register("lsp-develop"){
group = "processing"
// This task is used to run the LSP server when developing the LSP server itself
// to run the LSP server for end-users use `processing lsp` instead
dependencies.add("runtimeOnly", project(":java"))

// Usage: ./gradlew lsp-develop
// Make sure the cwd is set to the project directory
// or use -p to set the project directory

// Modify run configuration to start the LSP server rather than the Processing IDE
val run = tasks.named<JavaExec>("run").get()
run.standardInput = System.`in`
run.standardOutput = System.out
dependsOn(run)

// TODO: Remove after command line is integrated, then add the `lsp` argument instead, `lsp-develop` can't be removed because we still need to pipe the input and output
run.jvmArgs("-Djava.awt.headless=true")
compose.desktop.application.mainClass = "processing.mode.java.lsp.PdeLanguageServer"
}

val version = if(project.version == "unspecified") "1.0.0" else project.version

tasks.register<Exec>("installCreateDmg") {
Expand Down