Skip to content

Elvis/vscode extension#445

Open
ezekielelvis wants to merge 9 commits into
masterfrom
elvis/vscode-extension
Open

Elvis/vscode extension#445
ezekielelvis wants to merge 9 commits into
masterfrom
elvis/vscode-extension

Conversation

@ezekielelvis
Copy link
Copy Markdown

[WIP]This pull request introduces significant improvements to the VS Code extension for XTC, focusing on enhanced debugging support, improved task and command integration, and better developer experience through configuration and documentation updates. The main changes are the addition of a Debug Adapter Protocol (DAP) integration, new commands and tasks for running and managing XTC modules, and updates to build scripts and configuration files to support these features.

Debugging and Task Integration

  • Added a new Debug Adapter Protocol (DAP) integration, including a XtcDebugAdapterDescriptorFactory and XtcDebugConfigurationProvider in debug-adapter.ts, enabling users to debug XTC modules directly from VS Code. This includes logic to find the Java executable, launch the DAP server JAR, and provide debug configuration defaults.
  • Introduced a new task provider and command registrations in commands.ts, allowing users to run XTC modules, create new projects, and show language server output directly from the command palette.
  • Updated package.json to declare new commands (xtc.runModule, xtc.restartServer, xtc.showServerOutput), a custom XTC task type, and a new debugger type (xtc) with configuration snippets and attributes for module debugging. [1] [2] [3]

Build and Launch Configuration

  • Updated the build.gradle.kts build script to copy the DAP server JAR into the extension's server directory, and ensured that both the LSP and DAP servers are included in packaging and assembly tasks. The VS Code launch command now opens the test fixtures folder for easier testing. [1] [2] [3] [4]
  • Added and updated VS Code workspace configuration files (.vscode/launch.json, .vscode/tasks.json) to support extension development, building, and debugging workflows for both the root and extension subfolders. [1] [2] [3] [4]
  • Updated .gitignore to exclude .vscode-test/ from version control.

Documentation and Developer Experience

  • Enhanced the README.md with clearer setup instructions, improved project structure documentation, and step-by-step guides for building, running, and testing the extension locally. [1] [2] [3] [4] [5] [6]

These changes collectively make the XTC VS Code extension much more robust and user-friendly, especially for debugging and automation workflows.

@ezekielelvis ezekielelvis requested a review from lagergren April 25, 2026 14:30
Comment thread .vscode/launch.json Outdated
Comment thread javatools/bin/default/README.md Outdated
Comment thread javatools/bin/default/.classpath Outdated
Comment thread javatools/bin/default/build.gradle.kts Outdated
Comment thread javatools/bin/default/LICENSE Outdated
Comment thread lang/vscode-extension/build.gradle.kts
Comment thread lang/vscode-extension/src/lsp-client.ts
@ezekielelvis ezekielelvis marked this pull request as ready for review May 6, 2026 13:24
@ezekielelvis ezekielelvis requested review from ggleyzer and lagergren May 7, 2026 15:06
Copy link
Copy Markdown
Collaborator

@ggleyzer ggleyzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really out of my depth here and would completely defer to Markus.

My only comment is: this PR seems to be an indicator that it wasn't the best idea to keep the plugin as a part of the xvm repo. May be we should start a new "plugin" repo using this PR?

@lagergren
Copy link
Copy Markdown
Contributor

I'm really out of my depth here and would completely defer to Markus.

My only comment is: this PR seems to be an indicator that it wasn't the best idea to keep the plugin as a part of the xvm repo. May be we should start a new "plugin" repo using this PR?

There is nothing in the PR after updates that leaks out of lang, and as we have talked a lot about there is a migration plan to standalone implementation when I have finished the type adapter work, and there is a good reason that this lives under lang until that integration path is finished.

I am still in deployment hell but I will try to review tonight or tomorrow. Now, however, it looks safe, in that it doesn't bleed out state into the rest of the code and lives self contained under lang just like the intellij plugin and the lsp server that both use. The only concern I have is about the node dependency potentially being resolved even if we are not creating a vscode-plugin build, and that, like the intellij toolkit, also is a very large download/install (although cached of course):

ezekielelvis and others added 5 commits May 10, 2026 13:38
- Implemented .gitignore to exclude unnecessary files
- Created launch.json for debugging configurations
- Added tasks.json for npm scripts to compile and watch
- Updated README.md with project structure and local testing instructions
- Enhanced build.gradle.kts to copy DAP server JAR and adjust packaging tasks
- Modified package.json to include new commands and configuration options
- Developed commands.ts to register commands for running modules and creating projects
- Introduced debug-adapter.ts for DAP integration
- Refactored extension.ts to manage activation and language client lifecycle
- Implemented java.ts for Java discovery and JVM argument building
- Created lsp-client.ts to manage the language client and its lifecycle
- Added status-bar.ts for displaying server status in the VS Code status bar
- Developed task-provider.ts for managing custom tasks related to XTC modules
…able detection

- Introduced a new properties file for error messages with comprehensive error codes and descriptions.
- Updated package.json to associate .x files with the xtc language and added workspaceContains activation event.
- Refactored command registration to validate project names using a dedicated function.
- Enhanced the extension to ensure .x files are correctly associated with the xtc language upon opening.
- Improved Java executable detection by consolidating logic and handling errors more gracefully.
- Updated LSP client to manage server state more effectively, including handling crashes and ensuring proper startup.
- Added logging for server startup details and improved error handling for missing Java installations.
refactor: remove VS Code launch and task configurations

chore: update build.gradle.kts to use node plugin for npm tasks

feat: add jdk-utils dependency for Java discovery

fix: enhance findJavaExecutable to support JRE download and caching

feat: update debug adapter to use async Java executable discovery

fix: improve language server startup status indication

refactor: streamline Java discovery process and add download functionality

fix: ensure proper handling of Java executable paths and permissions

chore: update LSP client to handle async Java executable resolution

Co-authored-by: Copilot <copilot@github.com>
@lagergren lagergren force-pushed the elvis/vscode-extension branch from 011d486 to cffa239 Compare May 10, 2026 11:38
@lagergren
Copy link
Copy Markdown
Contributor

There is an issue with the CI / build and test trying to resolve the libs.versions.toml gradle plugin but fails. Not sure why, but I think that it needs to live only under lang an only when the vscode plugin is being built.

@lagergren
Copy link
Copy Markdown
Contributor

Where:
Build file '/home/runner/work/xvm/xvm/lang/vscode-extension/build.gradle.kts' line: 5

  • What went wrong:
    31 actionable tasks: 11 executed, 2 from cache, 18 up-to-date
    Script compilation error:

    Line 5: alias(libs.plugins.langNodeGradle)
    ^ Unresolved reference 'langNodeGradle'.

1 error

Comment thread lang/vscode-extension/build.gradle.kts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants