Skip to content

Commit

Permalink
Merge pull request #11 from chrehall68/10-improve-error-diagnostics
Browse files Browse the repository at this point in the history
[Improve] Add error diagnostics
  • Loading branch information
chrehall68 authored Nov 12, 2024
2 parents ec8ff36 + c717ce0 commit a19957a
Show file tree
Hide file tree
Showing 8 changed files with 242 additions and 174 deletions.
25 changes: 12 additions & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.2.0",
"configurations": [
Expand All @@ -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": [
{
Expand All @@ -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"],
}
]
}
}
70 changes: 53 additions & 17 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
}
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,30 @@

Inspired by the lack of editor support in existing Verilog extensions for VSCode, this repository contains a powerful, hand-written Verilog language server and an extension to use it with VSCode.

To use the extension, simply open the workspace containing your Verilog project. Assuming the project is opened in Trusted mode, the extension should be able to instantly provide feedback.

## Functionality

This Language Server works for Verilog files.

Current Features:

- Completions
- Go To Definition
- Go To Definition for modules
- Token Highlighting
- Warning Diagnostics
- Error Diagnostics

Roadmap Features:

- Error Diagnostics
- Go To Definition for variables
- Find all References
- Error-tolerant parser
- Improved Completions

## Run in Development Environment
## Contributing

If you want to contribute, you can get started by following the below steps:

- Clone this repository
- Run `npm install` in `client/`. This installs all necessary npm modules.
Expand Down
9 changes: 5 additions & 4 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -19,7 +19,7 @@
"activationEvents": [
"onLanguage:verilog"
],
"main": "./dist/extension",
"main": "./dist/extension.js",
"contributes": {
"languages": [
{
Expand All @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function downloadToBin(
}

async function resolveServerExecutable(ctx: ExtensionContext): Promise<string> {
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`,
Expand Down
Loading

0 comments on commit a19957a

Please sign in to comment.