Files
prometeu-studio/tools/vscode-extension/README.md
bquarkz ea1cc26fe3
Test / Tests and coverage occurred while executing withChecks step.
Intrepid/Prometeu/Studio/pipeline/pr-master There was a failure building this commit
feat(studio): improve compiler reliability and AI diagnostics
Preserve structured diagnostics, source attribution, phase outcomes and revision context through compiler, Studio, LSP, MCP and JavaFX. Add project service discovery and resilient VS Code reconnection.

Correct all eight reproduced PBS production failures in expression context, sibling executable bindings and nominal owner identity. Consolidate specs, lessons, immutable baseline evidence and the maintained source-to-guest qualification runner.

Validation: required Gradle gate recorded 724 tests, with 711 passed and 13 skipped. Full corpus passed 168 compilation observations and 108 guest runs (104 successes and four deliberate faults); supplemental controls passed 42 compilations and 16 guest runs. TypeScript compilation, two Node discovery tests and discussion validation passed.
2026-11-10 12:36:25 +00:00

5.0 KiB

Prometeu VS Code Extension

VS Code bridge for Prometeu Studio.

This extension does not start the language server itself. It connects to the Prometeu Studio LSP server running locally.

VS Code Extension
    -> vscode-languageclient
    -> project-local .studio/lsp.json
    -> TCP 127.0.0.1:<project-port>
    -> Prometeu Studio Java/LSP4J

Requirements

  • Node.js
  • npm
  • VS Code
  • Prometeu Studio running with the embedded LSP server enabled

Open the same project in Studio and in the Extension Development Host. Studio publishes its OS-assigned loopback LSP port in .studio/lsp.json. Discovery is automatic and independent of an automation grant. Rebuild/restart older Studio versions first: they do not publish this file.

Install dependencies

From this directory:

npm install

Compile

npm run compile

This generates:

out/extension.js

Run in development mode

Open this extension folder in VS Code:

code .

Press:

F5

This opens a second VS Code window called Extension Development Host.

In that second window, open a Prometeu project and create/open a file like:

main.pbs

or:

main.barrel

Expected output in:

View -> Output -> Prometeu LSP
Prometeu VS Code extension activated.
Connecting to 127.0.0.1:<project-port>
TCP connection established with Prometeu Studio.
Connected to Studio at 127.0.0.1:<project-port>

Run commands manually

In the Extension Development Host window:

Cmd+Shift+P
Prometeu: Connect to Studio LSP

To restart the client:

Cmd+Shift+P
Prometeu: Restart Studio LSP

Package as VSIX

npm run compile
vsce package --allow-missing-repository

This creates a file like:

prometeu-vscode-extension-0.0.1.vsix

Install locally

code --install-extension prometeu-vscode-extension-0.0.1.vsix --force

Then open a Prometeu project normally:

code /path/to/prometeu-project

With Prometeu Studio running, opening .pbs or .barrel files should activate the extension and connect to the Studio LSP server.

Configuration

Automatic discovery is the default:

{
  "prometeu.studio.connectionMode": "auto"
}

Open exactly one local project folder (the folder containing prometeu.json). The extension validates the canonical project root, schema, loopback endpoint and Studio process. It watches discovery changes and reconnects after a Studio restart. Missing discovery means “Waiting for Studio” in the status bar; retries increase from 2 seconds to at most 30 seconds without repeated error dialogs. Click the status item to retry immediately. Transient discovery is not versioned.

For a separately hosted LSP or an older Studio, explicitly select manual mode:

{
  "prometeu.studio.connectionMode": "manual",
  "prometeu.studio.host": "127.0.0.1",
  "prometeu.studio.port": 7775
}

Host/port settings apply only in manual mode. Changing connection settings restarts the client. Automatic discovery never falls back to the fixed port.

Run discovery regressions after compiling:

node --test out/test/discovery.js

Current status

The extension currently provides only the minimal LSP client bridge:

  • registers .pbs
  • registers .barrel
  • connects to Prometeu Studio over TCP
  • starts a VS Code LanguageClient
  • receives LSP messages from the Java/LSP4J server

The Studio remains the source of trut

Reading SDK/core and libraries

F12 opens bundled SDK/core and admitted dependency declarations as read-only prometeu-source: documents. Hover, continued F12 and semantic highlighting work inside them. Files in the editable project keep normal file: editing. A library under .workspace is still external. SDK/core are never copied to an editorial folder or cache. Formatting, rename and code actions cannot change external sources; a proposal touching both project and dependency files is refused in full.

An open external document keeps its source revision. Disconnect leaves its text visible, with queries unavailable until reconnection and revalidation. If the source changed, navigate again from the project to obtain new text and positions. The status bar indicates when an active external source is unavailable.

Compile with npm run compile before running the extension. Development acceptance can launch an isolated real VS Code host against the test LSP classpath:

PROMETEU_VSCODE_DEV_TEST=1 ./gradlew :prometeu-lsp:prometeu-lsp-v1:test --tests '*ExternalSourceDevelopmentHostTest' --console=plain

Run that Gradle command from the repository root. Set PROMETEU_VSCODE_EXECUTABLE when VS Code is not installed at the default macOS application path. The test covers read-only typing, declaration ranges, hover/F12, highlighting, dependency sources with Unicode/CRLF, reconnection and normal project editing. It does not validate a packaged Studio distribution or installed JAR. Dependencies must already exist on disk; dependency management remains a separate product task.