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
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

## [Unreleased]

### Changed

- **Upgraded `vscode-languageclient` 9 → 10** — adopted the new LSP client API. `LanguageClientOptions.outputChannel`/`traceOutputChannel` now require a `LogOutputChannel`, so the shared `SysML` channel is created with `{ log: true }` and typed accordingly across `extension.ts` and the LSP client factories.
- **Bumped `sysml-v2-lsp` 0.21.0 → 0.22.0**, picking up two browser fixes:
- The browser server no longer attempts to spawn a `worker_threads` parse worker (unavailable in a Web Worker); parsing runs inline, removing a misleading worker-failure log.
- Go-to-Definition into bundled `sysml-stdlib:` documents now resolves regardless of URI authority/percent-encoding variations.

### Fixed

- Restored explicit `tsconfig` `types` (`node`, `vscode`, `mocha`) so Node/VS Code/Mocha globals resolve under TypeScript 6, fixing the post-upgrade compile errors and unit test failures.
- **`make web` runs headless** — the target now passes `--browser` (with a `WEB_BROWSER` override, default `none`) so the web extension can be served in CI/headless environments without launching a browser.

## [0.40.0]

### Added
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,21 @@ debug-watch: install
# Run the web (browser) build in a local @vscode/test-web host. This serves
# the SAME experience as vscode.dev: a browser extension host with the LSP
# running as a Web Worker. Use WEB_PORT to override the default port.
#
# WEB_BROWSER controls how the host opens:
# none (default) — serve only; open the printed URL yourself. Works in
# headless/remote/SSH/container envs with no display.
# chromium|firefox|webkit — auto-launch that browser (needs a display/X server).
WEB_PORT ?= 3000
WEB_BROWSER ?= none
.PHONY: web
web: $(NODE_MODULES)
@echo "$(YELLOW)Building and serving the web extension on port $(WEB_PORT)...$(NC)"
npm run build:web
npm run build:webview-assets
@echo "$(BLUE)Open http://localhost:$(WEB_PORT) — the samples/ folder is the default workspace$(NC)"
@echo "$(YELLOW)Press Ctrl+C to stop$(NC)"
npx vscode-test-web --browserType=chromium --port=$(WEB_PORT) \
npx vscode-test-web --browser=$(WEB_BROWSER) --port=$(WEB_PORT) \
--extensionDevelopmentPath=. samples

# Run the web integration tests headlessly in a real browser extension host
Expand Down
6 changes: 3 additions & 3 deletions media/vendor/cytoscape.min.js

Large diffs are not rendered by default.

112 changes: 53 additions & 59 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,8 @@
},
"dependencies": {
"elkjs": "^0.11.0",
"sysml-v2-lsp": "^0.21.0",
"vscode-languageclient": "^9.0.1"
"sysml-v2-lsp": "^0.22.0",
"vscode-languageclient": "10.0.0"
},
"overrides": {
"brace-expansion": "^5.0.5",
Expand Down
6 changes: 3 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export { hideModelMetrics, hideParseProgress, showMetricsLoading, showParseProgr

let modelExplorerProvider: ModelExplorerProvider;
let featureExplorerProvider: FeatureExplorerProvider;
let outputChannel: vscode.OutputChannel;
let outputChannel: vscode.LogOutputChannel;
let lspModelProvider: LspModelProvider;
let parseOrchestrator: ParseOrchestrator;

Expand Down Expand Up @@ -80,7 +80,7 @@ export function notifyServerParseDone(uri?: string): void {
*/
async function registerMcpServer(
context: vscode.ExtensionContext,
outputChannel: vscode.OutputChannel,
outputChannel: vscode.LogOutputChannel,
): Promise<void> {
const mcpServerUri = vscode.Uri.joinPath(
context.extensionUri,
Expand Down Expand Up @@ -113,7 +113,7 @@ async function registerMcpServer(

export function activate(context: vscode.ExtensionContext) {
// Create dedicated output channel for logging
outputChannel = vscode.window.createOutputChannel('SysML');
outputChannel = vscode.window.createOutputChannel('SysML', { log: true });
context.subscriptions.push(outputChannel);

outputChannel.appendLine('SysML v2.0 extension is now active');
Expand Down
2 changes: 1 addition & 1 deletion src/lsp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let parsingTimeoutHandle: ReturnType<typeof setTimeout> | undefined;
*/
export function startLanguageClient(
context: vscode.ExtensionContext,
outputChannel: vscode.OutputChannel
outputChannel: vscode.LogOutputChannel
): BaseLanguageClient {
const clientOptions: LanguageClientOptions = {
documentSelector: [
Expand Down
7 changes: 5 additions & 2 deletions src/lsp/createClient.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ const CLIENT_NAME = 'SysML v2 Language Server';
export function createLanguageClient(
context: vscode.ExtensionContext,
clientOptions: LanguageClientOptions,
outputChannel: vscode.OutputChannel,
outputChannel: vscode.LogOutputChannel,
): BaseLanguageClient {
const serverUri = vscode.Uri.joinPath(context.extensionUri, 'dist', 'web', 'sysmlServer.js');
outputChannel.appendLine(`Starting SysML v2 language server (Web Worker): ${serverUri.toString(true)}`);

const worker = new Worker(serverUri.toString(true));
return new LanguageClient(CLIENT_ID, CLIENT_NAME, clientOptions, worker);
// vscode-languageclient v10 browser constructor signature is
// (id, name, serverOptions /* Worker */, clientOptions) — matching the
// Node variant. (v9 took clientOptions before the worker.)
return new LanguageClient(CLIENT_ID, CLIENT_NAME, worker, clientOptions);
}
2 changes: 1 addition & 1 deletion src/lsp/createClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function resolveServerPath(): string {
export function createLanguageClient(
_context: vscode.ExtensionContext,
clientOptions: LanguageClientOptions,
outputChannel: vscode.OutputChannel,
outputChannel: vscode.LogOutputChannel,
): BaseLanguageClient {
const serverModule = resolveServerPath();
outputChannel.appendLine(`Starting SysML v2 language server: ${serverModule}`);
Expand Down
Loading