diff --git a/.vscode/launch.json b/.vscode/launch.json index d1a81c2..3e243ba 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,4 +1,3 @@ -// A launch configuration that compiles the extension and then opens it inside a new window { "version": "0.2.0", "configurations": [ @@ -15,22 +14,22 @@ ], }, { + "name": "Launch Extension", "type": "extensionHost", "request": "launch", - "name": "Launch Client", + // path to VSCode executable "runtimeExecutable": "${execPath}", "args": [ - "--extensionDevelopmentPath=${workspaceFolder}" + "--extensionDevelopmentPath=${workspaceFolder}", ], "outFiles": [ - "${workspaceFolder}/client/out/**/*.js", - ], - "preLaunchTask": { - "type": "npm", - "path": "client", - "script": "compile", - }, - } + "${workspaceFolder}/client/dist/**/*.js" + ], + "sourceMaps": true, + "smartStep": true, + "preLaunchTask": "npm: bundle-dev", + "cwd": "${workspaceFolder}/client" + }, ], "compounds": [ { @@ -39,7 +38,7 @@ // the extension expects to be able to immediately connect to the specified port without a mechanism to wait for server fully starts // this works because VSCode spends around 1 second to initialize, before loading extensions // if VSCode gets any faster it might be a problem - "configurations": ["Launch Server", "Launch Client"], + "configurations": ["Launch Server", "Launch Extension"], } ] -} \ No newline at end of file +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 5195040..18c0323 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,38 +1,74 @@ +// Available variables which can be used inside of strings. +// ${workspaceFolder}: the root folder of the team +// ${file}: the current opened file +// ${fileBasename}: the current opened file's basename +// ${fileDirname}: the current opened file's dirname +// ${fileExtname}: the current opened file's extension +// ${cwd}: the current working directory of the spawned process + +// A task runner that calls the Typescript compiler (tsc) and +// compiles the extension. { "version": "2.0.0", + + // we want to run npm + "command": "npm", + + // the command is a shell script + "type": "shell", + + // don't show the output window, rely on the problem matcher. + "presentation": { + "reveal": "never" + }, + + // we run the custom script "compile" as defined in package.json + "args": ["run", "compile"], + + // The tsc compiler is started in watching mode + "isBackground": true, + + // use the standard tsc in watch mode problem matcher to find compile problems in the output. + "problemMatcher": "$tsc-watch", "tasks": [ { - "type": "npm", - "path": "client", - "script": "compile", - "group": "build", - "presentation": { - "panel": "dedicated", - "reveal": "never" - }, + "type": "typescript", + "tsconfig": "client/tsconfig.json", "problemMatcher": [ "$tsc" - ] + ], }, { "type": "npm", - "path": "client", "script": "watch", + "problemMatcher": "$tsc-watch", "isBackground": true, - "runOptions": { - "runOn": "folderOpen" + "presentation": { + "reveal": "never" }, "group": { "kind": "build", "isDefault": true }, + "path": "client" + }, + { + "type": "npm", + "script": "bundle-watch", + "group": "build", + "problemMatcher": "$esbuild-watch", + "isBackground": true, "presentation": { - "panel": "dedicated", "reveal": "never" }, - "problemMatcher": [ - "$tsc-watch" - ], + "path": "client" }, + { + "type": "npm", + "script": "bundle-dev", + "group": "build", + "problemMatcher": "$esbuild", + "path": "client" + } ] -} \ No newline at end of file +} diff --git a/client/package.json b/client/package.json index 88c7153..d51460a 100644 --- a/client/package.json +++ b/client/package.json @@ -3,7 +3,7 @@ "description": "A language server for Verilog", "author": "chrehall68", "license": "MIT", - "version": "1.0.1", + "version": "1.0.2", "repository": { "type": "git", "url": "https://github.com/chrehall68/vls" @@ -19,7 +19,7 @@ "activationEvents": [ "onLanguage:verilog" ], - "main": "./dist/extension", + "main": "./dist/extension.js", "contributes": { "languages": [ { @@ -35,13 +35,14 @@ }, "scripts": { "clean": "rm -rf ./dist/* && rm -rf ./out/* && rm -rf ./bin/* && rm *.vsix", - "package": "cp ../README.md ./README.md && cp ../LICENSE ./LICENSE && npx vsce package --baseContentUrl https://github.com/golang/vscode-go/raw/HEAD --baseImagesUrl https://github.com/golang/vscode-go/raw/HEAD", + "package": "cp ../README.md ./README.md && cp ../LICENSE ./LICENSE && npx vsce package", "vscode:prepublish": "npm run compile", "bundle": "esbuild src/extension.ts --bundle --outdir=dist --external:vscode --format=cjs --platform=node", "bundle-dev": "npm run bundle -- --sourcemap", "bundle-watch": "npm run bundle -- --sourcemap --watch", + "test-compile": "tsc -p ./", "compile": "npm run bundle", - "watch": "tsc -b -w", + "watch": "tsc -watch -p ./", "lint": "eslint" }, "devDependencies": { diff --git a/client/src/extension.ts b/client/src/extension.ts index 22568ba..8a79a67 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -30,7 +30,7 @@ async function downloadToBin( } async function resolveServerExecutable(ctx: ExtensionContext): Promise { - const version = "1.0.1"; + const version = "1.0.2"; const platformDetails = { win32: { url: `https://github.com/chrehall68/vls/releases/download/${version}/vls-windows-amd64.exe`,