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
75 changes: 75 additions & 0 deletions .github/workflows/extension-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Extension CI

on:
pull_request:
branches: [master, hdoc-2.0]
push:
branches: [master, hdoc-2.0]

jobs:
build-and-package:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2

- name: Build Zig artifacts
run: zig build install

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install extension dependencies
run: npm ci
working-directory: vscode-ext

- name: Copy wasm artifacts into extension bundle
run: |
mkdir -p vscode-ext/wasm
cp zig-out/www/hyperdoc_wasm.wasm vscode-ext/wasm/ || true
cp zig-out/www/hyperdoc_wasm_lsp.wasm vscode-ext/wasm/

- name: Build extension
run: npm run compile
working-directory: vscode-ext

- name: Test extension
run: npm test
working-directory: vscode-ext

- name: Package extension
run: |
npm run package
mv *.vsix hyperdoc-vscode.vsix
working-directory: vscode-ext

- name: Upload packaged extension
uses: actions/upload-artifact@v4
with:
name: hyperdoc-vscode.vsix
path: vscode-ext/hyperdoc-vscode.vsix

publish:
needs: build-and-package
if: github.event_name == 'push' && github.ref == 'refs/heads/hdoc-2.0'
runs-on: ubuntu-latest
environment:
name: vscode-marketplace
steps:
- name: Download packaged extension
uses: actions/download-artifact@v4
with:
name: hyperdoc-vscode.vsix
path: artifacts

- name: Publish to VS Code Marketplace
run: npx --yes vsce publish --packagePath artifacts/hyperdoc-vscode.vsix -p "$VSCE_PAT"
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 HyperDoc Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
17 changes: 17 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,23 @@ pub fn build(b: *std.Build) void {
});
b.getInstallStep().dependOn(&install_wasm.step);

const wasm_lsp_exe = b.addExecutable(.{
.name = "hyperdoc_wasm_lsp",
.root_module = b.createModule(.{
.root_source_file = b.path("src/wasm-lsp.zig"),
.target = wasm_target,
.optimize = optimize,
.single_threaded = true,
.imports = &.{
.{ .name = "hyperdoc", .module = hyperdoc },
},
}),
});
const install_wasm_lsp = b.addInstallArtifact(wasm_lsp_exe, .{
.dest_dir = .{ .override = www_dir },
});
b.getInstallStep().dependOn(&install_wasm_lsp.step);

const install_web = b.addInstallFileWithDir(b.path("src/playground.html"), www_dir, "index.html");
b.getInstallStep().dependOn(&install_web.step);

Expand Down
9 changes: 9 additions & 0 deletions src/wasm-lsp.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const std = @import("std");

pub export fn _start() void {}

pub export fn hyperdoc_lsp_ping() void {
// Placeholder entrypoint for a wasm-based language server.
// Real initialization will be wired once the wasm server is implemented.
std.mem.doNotOptimizeAway(@as(u32, 0));
}
6 changes: 6 additions & 0 deletions vscode-ext/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
out
*.vsix
.vscode-test
.DS_Store
wasm/
13 changes: 13 additions & 0 deletions vscode-ext/justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
default: setup build test

setup:
npm install

build:
npm run compile

test:
npm test

package:
npm run package
44 changes: 44 additions & 0 deletions vscode-ext/language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/?\\s]+)",
"brackets": [
[
"{",
"}"
],
[
"(",
")"
]
],
"autoClosingPairs": [
{
"open": "{",
"close": "}"
},
{
"open": "(",
"close": ")"
},
{
"open": "\"",
"close": "\"",
"notIn": [
"string"
]
}
],
"surroundingPairs": [
[
"{",
"}"
],
[
"(",
")"
],
[
"\"",
"\""
]
]
}
Loading
Loading