Skip to content

Commit

Permalink
vscode: Restore Extension (#1632)
Browse files Browse the repository at this point in the history
* vscode: Restore Extension

* use node specific image

* fix dockerfile

* add wasm build back

* address comments

* comments
  • Loading branch information
V-FEXrt authored Aug 20, 2024
1 parent d9c5821 commit 835d80a
Show file tree
Hide file tree
Showing 36 changed files with 4,277 additions and 9,671 deletions.
53 changes: 27 additions & 26 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,28 +144,21 @@ jobs:
test_cmd: rpm -i x86_64/*.rpm && cd tests && wake runTests
install_src_glob: build/x86_64/*.rpm

# - target: vscode
# dockerfile: wasm
# extra_docker_build_args: ''
# extra_docker_run_args: -u build
# build_cmd: make -C wake-* vscode
# test_cmd: ls # no-op
# install_src_glob: build/wake-*/extensions/vscode/wake-*.vsix

# Two confounding bugs are breaking the latest emsdk build. We can't really work around them
# so for now, disable the latest target and track them closely.
#
# Bugs:
# webpack tries to resolve new URL into a module which is incorrect (https://github.com/webpack/webpack/issues/16878)
# emscripten may emit ES6 style imports which makes webpack grumpy (https://github.com/emscripten-core/emscripten/issues/19066#issuecomment-1486853354)
#
# - target: vscode_latest
# dockerfile: wasm
# extra_docker_build_args: --build-arg EMSDK_VERSION=latest
# extra_docker_run_args: -u build
# build_cmd: make -C wake-* vscode
# test_cmd: ls # no-op
# install_src_glob: build/wake-*/extensions/vscode/wake-*.vsix
- target: vscode
dockerfile: node
extra_docker_build_args: ''
extra_docker_run_args: -u build
build_cmd: make -C wake-* vscode
test_cmd: ls # no-op
install_src_glob: build/wake-*/extensions/vscode/wake-*.vsix

- target: wasm
dockerfile: wasm
extra_docker_build_args: ''
extra_docker_run_args: -u build
build_cmd: make -C wake-* wasm
test_cmd: ls # no-op
install_src_glob: build/wake-*/lib/wake/lsp-wake.wasm*

steps:
- name: Create target directories
Expand Down Expand Up @@ -282,11 +275,18 @@ jobs:
name: tarball
path: tarball

# - name: Download VSCode
- name: Download VSCode
uses: actions/download-artifact@v3
with:
name: release_vscode
path: vscode

# We don't actually release/upload wasm. It's build to maintain buildabilty
# - name: Download wasm
# uses: actions/download-artifact@v3
# with:
# name: release_vscode
# path: vscode
# name: release_wasm
# path: wasm

# We don't actually release/upload wake_static. Wake is unsupported on old versions
# of alpine, and releasing a "wake_static" artifact is very misleading and prone to
Expand Down Expand Up @@ -320,7 +320,7 @@ jobs:
with:
name: release_ubuntu_22_04
path: ubuntu_22_04

- name: Download Fedora 38
uses: actions/download-artifact@v3
with:
Expand All @@ -345,6 +345,7 @@ jobs:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
files: |
tarball/wake_*.tar.xz
vscode/wake-*.vsix
rocky_8-wake-*-1.x86_64.rpm
rocky_9-wake-*-1.x86_64.rpm
debian-bullseye-wake_*-1_amd64.deb
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/dockerfiles/node
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:latest

RUN apt-get update && apt-get install -y build-essential devscripts git fuse libfuse-dev libgmp-dev libncurses5-dev libre2-dev libsqlite3-dev pkg-config squashfuse wget jq

RUN useradd -m -d /build build

WORKDIR /build
ENV VERSION=1.80.0
ENV RUST_FOLDER="rust-$VERSION-x86_64-unknown-linux-gnu"
ENV RUST_TAR="$RUST_FOLDER.tar.gz"
RUN wget "https://static.rust-lang.org/dist/$RUST_TAR"
RUN tar -xf $RUST_TAR
RUN sh ./$RUST_FOLDER/install.sh --verbose --prefix=/usr
4 changes: 1 addition & 3 deletions .github/workflows/dockerfiles/wasm
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ARG EMSDK_VERSION=3.1.26

FROM emscripten/emsdk:$EMSDK_VERSION
FROM emscripten/emsdk:latest

RUN apt-get update && apt-get install -y build-essential devscripts git fuse libfuse-dev libgmp-dev libncurses5-dev libre2-dev libsqlite3-dev pkg-config squashfuse wget jq

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ tarball: wake.db
vscode: wake.db
$(WAKE_ENV) ./bin/wake vscode

wasm: wake.db
$(WAKE_ENV) ./bin/wake build wasm

static: wake.db
$(WAKE_ENV) ./bin/wake static

Expand Down
6 changes: 6 additions & 0 deletions build.wake
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ def toVariant = match _
"default" -> Pass (Pair "native-cpp14-release" "native-c11-release")
"static" -> Pass (Pair "native-cpp14-static" "native-c11-static")
"debug" -> Pass (Pair "native-cpp14-debug" "native-c11-debug")
"wasm" -> Pass (Pair "wasm-cpp14-release" "wasm-c11-release")
s -> Fail "Unknown build target ({s})".makeError

export def build: List String => Result String Error = match _
"tarball", Nil ->
tarball Unit
| rmap (\_ "TARBALL")
"wasm", Nil ->
require Pass variant = toVariant "wasm"

buildLSP variant
| rmap format
kind, Nil ->
require Pass variant = toVariant kind

Expand Down
30 changes: 30 additions & 0 deletions extensions/vscode/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "import",
"format": [ "camelCase", "PascalCase" ]
}
],
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}
7 changes: 2 additions & 5 deletions extensions/vscode/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package.json
stdlib.json
.vscode/
.vscode-test-web/
node_modules/
lsp-client/out/
lsp-server/out/
lsp-server/wasm/lsp-wake.js
out/
dist/
wake-*.vsix
share/
5 changes: 5 additions & 0 deletions extensions/vscode/.vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'out/test/**/*.test.js',
});
10 changes: 5 additions & 5 deletions extensions/vscode/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"amodio.tsl-problem-matcher"
"dbaeumer.vscode-eslint",
"ms-vscode.extension-test-runner"
]
}
}
26 changes: 9 additions & 17 deletions extensions/vscode/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
// A launch configuration that runs the extension inside a new window
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Web Extension in VS Code",
"name": "Run Extension",
"type": "extensionHost",
"debugWebWorkerHost": true,
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionDevelopmentKind=web"
],
"outFiles": ["${workspaceFolder}/out/clientWeb.js"],
"preLaunchTask": "npm: watch"
},
{
"name": "Run Node Extension in VS Code",
"type": "extensionHost",
"debugWebWorkerHost": true,
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": ["${workspaceFolder}/out/clientNode.js"],
"preLaunchTask": "npm: watch"
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
29 changes: 7 additions & 22 deletions extensions/vscode/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "compile",
"group": "build",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"panel": "dedicated",
"reveal": "never"
},
"problemMatcher": [
"$ts-webpack",
"$tslint-webpack"
]
},
{
"type": "npm",
"script": "watch",
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"panel": "dedicated",
"reveal": "never"
},
"problemMatcher": [
"$ts-webpack-watch",
"$tslint-webpack-watch"
]
}
}
]
}
}
16 changes: 16 additions & 0 deletions extensions/vscode/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.vscode/**
.vscode-test/**
src/**
.gitignore
.yarnrc
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.ts
**/.vscode-test.*
out/**
node_modules/**
vsce-stdin
vscode.wake
package.json.in
esbuild.js
1 change: 0 additions & 1 deletion extensions/vscode/.wakeignore

This file was deleted.

Loading

0 comments on commit 835d80a

Please sign in to comment.