Skip to content

feat(vscode): add VSCode extension with embedded server and webview UI#143

Merged
jung-thomas merged 21 commits into
mainfrom
feature/vscode-extension
May 17, 2026
Merged

feat(vscode): add VSCode extension with embedded server and webview UI#143
jung-thomas merged 21 commits into
mainfrom
feature/vscode-extension

Conversation

@jung-thomas
Copy link
Copy Markdown
Contributor

@jung-thomas jung-thomas commented May 17, 2026

Summary

  • Adds a native VSCode extension that embeds the hana-cli Express server and renders the Vue UI inside webview panels
  • Custom editors for HANA artifacts (.hdbtable, .hdbview, .hdbprocedure, .hdbfunction, .hdbcalculationview) open chromeless inspector/editor views
  • CAP-first connection resolver with 6-step fallback chain, status bar indicator, and SecretStorage for credentials
  • Dual Vite build target produces a dist-vscode/ bundle with stable chunk names for webview consumption
  • CLI command hana-cli vscode install/uninstall/status for managing the extension
  • GitHub Actions workflow for automated extension build and release

Key Design Decisions

  • ensureServer-first pattern: All webviews await the Express server before rendering HTML, eliminating port race conditions
  • CORS middleware: Webviews run from vscode-resource origin; server allows * for local-only traffic
  • HANA_CLI_ env vars*: Connection injection uses discrete env vars (not VCAP_SERVICES) to avoid deletion by connections.js
  • Chromeless mode: Individual tools and custom editors hide the shell/nav via CSS, showing only the relevant view
  • esbuild bundling: Extension source is bundled into a single dist/extension.js with custom plugins for route resolution

Test plan

  • Extension activates and status bar shows connection state
  • "HANA: Open Tools" shows full UI with navigation
  • Individual commands (System Info, Tables, Views, Query, Import, CF Login) open chromeless
  • Custom editors (.hdbtable, .hdbview, .hdbprocedure, .hdbfunction) open correct inspector views
  • Calc view editor (.hdbcalculationview) opens graph editor chromeless
  • Data loads from connected HANA instance (no CORS or connection errors)
  • Extension integration tests pass (npm run test:integration)
  • E2E smoke tests pass (npm run test:e2e)

Design for integrating hana-cli into VSCode as a native extension
with embedded Express server, custom editors for HANA artifacts,
and the full Vue UI surfaced as webview panels.
15-task implementation plan covering extension scaffold, server
lifecycle, webview integration, custom editors, connection management,
CLI installer, build pipeline, and CI/CD.
…hutdown

Implements the embedded Express server that powers data operations for
Vue webviews. Routes are statically imported via a barrel file so esbuild
can bundle them into the extension — no dynamic filesystem discovery needed
in the packaged .vsix.
…all/status

Adds a new CLI command to manage the hana-cli VSCode extension directly
from the terminal. Supports install (from local .vsix or marketplace),
uninstall, and status checking. Detects code/codium/code-insiders CLI
with cross-platform Windows .cmd wrapper support via cmd.exe invocation.
Two-stage build: TypeScript compiles to out/, then esbuild bundles
into a single dist/extension.js for the .vsix package. Includes a
resolve plugin to map parent-project route imports and externals for
optional dependencies not needed in the extension runtime.
… tests

Add @vscode/test-electron test runner, Mocha-based suite discoverer, and
initial activation tests that verify the extension is present and all
commands are registered. Uses a separate tsconfig.test.json to compile
test files without affecting the main build output structure.
- Switch all editors to ensureServer-first pattern (eliminates port=0 race condition)
- Fix route paths to kebab-case matching Vue router (inspect-table, calc-view-editor, etc.)
- Add chromeless flag to custom editors (hides shell/nav in artifact inspectors and calc view)
- Add CORS middleware for webview-to-localhost fetch requests
- Use HANA_CLI_* env vars for connection injection (avoids VCAP_SERVICES deletion)
- Add base layout CSS (height:100%, flex column) matching Vue app's index.html
- Enhance esbuild config with route bundling plugins for VSCode-specific build
- Improve connection resolver with CAP binding support and status bar feedback
- Remove stale app/vue/dist hashed assets (replaced by new Vite build output)
@jung-thomas jung-thomas merged commit 3e1de63 into main May 17, 2026
26 checks passed
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.

1 participant