├── ghdl-ls └── tests │ ├── 007errprj │ ├── hdl-prj.json │ ├── testsuite.py │ ├── replies.json │ └── cmds.json │ ├── 008errnofile │ ├── hdl-prj.json │ ├── testsuite.py │ ├── replies.json │ └── cmds.json │ ├── 004errprj │ ├── hdl-prj.json │ ├── testsuite.py │ ├── replies.json │ └── cmds.json │ ├── 005opterr │ ├── hdl-prj.json │ ├── testsuite.py │ ├── replies.json │ └── cmds.json │ ├── 001simple │ ├── testsuite.py │ ├── replies.ref │ ├── replies.json │ └── cmds.json │ ├── 002coverage │ ├── testsuite.py │ ├── hdl-prj.json │ ├── vhdl-ls.trace.out │ ├── vhdl-ls.trace.in │ ├── cmds.lsp │ ├── cmds.json │ ├── replies.json │ └── replies.ref │ ├── 005create │ ├── testsuite.py │ ├── replies.json │ └── cmds.json │ ├── 003errors │ ├── tc.vhdl │ ├── testsuite.py │ ├── .gdb_history │ ├── replies.json │ ├── crash1.json │ ├── crash2.json │ └── cmds.json │ ├── files │ ├── hello.vhdl │ ├── heartbeat.vhdl │ ├── adder.vhdl │ └── adder_tb.vhdl │ ├── testenv.py │ └── testsuite.py ├── vscode-client ├── .gitignore ├── tslint.json ├── .vscodeignore ├── tsconfig.json ├── .vscode │ ├── launch.json │ └── tasks.json ├── webpack.config.js ├── language-configuration.json ├── snippets │ ├── snippets.vhdl.generate.json │ ├── snippets.vhdl.library.json │ ├── snippets.vhdl.interface.json │ ├── snippets.vhdl.logic.json │ └── snippets.vhdl.declaration.json ├── syntaxes │ └── syntaxes.vhdl.tmLanguage.json ├── package.json └── extension.ts ├── .github ├── dependabot.yml └── workflows │ └── vsix.yml ├── NOTES ├── LICENSE.txt ├── TODO ├── emacs-client └── README.org └── README.md /ghdl-ls/tests/007errprj/hdl-prj.json: -------------------------------------------------------------------------------- 1 | { "files": [ 2 | "../files/heartbeat.vhdl" 3 | ]} 4 | -------------------------------------------------------------------------------- /vscode-client/.gitignore: -------------------------------------------------------------------------------- 1 | *.js 2 | *.map 3 | out 4 | node_modules 5 | client/server 6 | .vscode-test -------------------------------------------------------------------------------- /ghdl-ls/tests/008errnofile/hdl-prj.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { "file": "nofile.vhdl", "language": "vhdl" } 4 | ]} 5 | -------------------------------------------------------------------------------- /vscode-client/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "indent": [true, "tabs"], 4 | "semicolon": [true, "always"] 5 | } 6 | } -------------------------------------------------------------------------------- /ghdl-ls/tests/004errprj/hdl-prj.json: -------------------------------------------------------------------------------- 1 | { files: [ 2 | { "file": "../files/heartbeat.vhdl", "language": "vhdl" }, 3 | ]} 4 | -------------------------------------------------------------------------------- /vscode-client/.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | node_modules 3 | out 4 | **/*.ts 5 | .gitignore 6 | .travis.yml 7 | tsconfig.json 8 | tslint.json 9 | webpack.config.js -------------------------------------------------------------------------------- /ghdl-ls/tests/005opterr/hdl-prj.json: -------------------------------------------------------------------------------- 1 | { "options": { "ghdl_analysis": [ "--unknown-option" ]}, 2 | "files": [ 3 | { "file": "../files/heartbeat.vhdl", "language": "vhdl" } 4 | ]} 5 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/vscode-client" 5 | schedule: 6 | interval: monthly 7 | open-pull-requests-limit: 99 8 | -------------------------------------------------------------------------------- /ghdl-ls/tests/001simple/testsuite.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | sys.path.extend(['..', '../..']) 4 | import testenv 5 | 6 | testenv.run_compare('cmds.json', 'replies.json') 7 | testenv.done() 8 | -------------------------------------------------------------------------------- /ghdl-ls/tests/002coverage/testsuite.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | sys.path.extend(['..', '../..']) 4 | import testenv 5 | 6 | testenv.run_compare('cmds.json', 'replies.json') 7 | testenv.done() 8 | -------------------------------------------------------------------------------- /ghdl-ls/tests/004errprj/testsuite.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | sys.path.extend(['..', '../..']) 4 | import testenv 5 | 6 | testenv.run_compare('cmds.json', 'replies.json') 7 | testenv.done() 8 | -------------------------------------------------------------------------------- /ghdl-ls/tests/005create/testsuite.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | sys.path.extend(['..', '../..']) 4 | import testenv 5 | 6 | testenv.run_compare('cmds.json', 'replies.json') 7 | testenv.done() 8 | -------------------------------------------------------------------------------- /ghdl-ls/tests/005opterr/testsuite.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | sys.path.extend(['..', '../..']) 4 | import testenv 5 | 6 | testenv.run_compare('cmds.json', 'replies.json') 7 | testenv.done() 8 | -------------------------------------------------------------------------------- /ghdl-ls/tests/007errprj/testsuite.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | sys.path.extend(['..', '../..']) 4 | import testenv 5 | 6 | testenv.run_compare('cmds.json', 'replies.json') 7 | testenv.done() 8 | -------------------------------------------------------------------------------- /ghdl-ls/tests/008errnofile/testsuite.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | sys.path.extend(['..', '../..']) 4 | import testenv 5 | 6 | testenv.run_compare('cmds.json', 'replies.json') 7 | testenv.done() 8 | -------------------------------------------------------------------------------- /vscode-client/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "lib": [ "es6" ], 6 | "sourceMap": true 7 | }, 8 | "files": [ "extension.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /ghdl-ls/tests/002coverage/hdl-prj.json: -------------------------------------------------------------------------------- 1 | { "files": [ 2 | { "file": "../files/adder.vhdl", "language": "vhdl" }, 3 | { "file": "../files/heartbeat.vhdl", "language": "vhdl" }, 4 | { "file": "../files/adder_tb.vhdl", "language": "vhdl" } 5 | ]} 6 | -------------------------------------------------------------------------------- /ghdl-ls/tests/003errors/tc.vhdl: -------------------------------------------------------------------------------- 1 | library ieee; 2 | use ieee.std_logic_1164.all; 3 | use ieee.std_logic_unsigned.all; 4 | 5 | entity tb is 6 | end tb; 7 | 8 | architecture behav of tb is 9 | signal s : std_logic_vector(7 downto 0); 10 | begin 11 | assert s /= x"73"; 12 | end behav; 13 | -------------------------------------------------------------------------------- /ghdl-ls/tests/003errors/testsuite.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | sys.path.extend(['..', '../..']) 4 | import testenv 5 | 6 | testenv.run_compare('crash1.json', None) 7 | testenv.run_compare('crash2.json', None) 8 | testenv.run_compare('cmds.json', 'replies.json') 9 | testenv.done() 10 | -------------------------------------------------------------------------------- /vscode-client/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "extensionHost", 6 | "request": "launch", 7 | "name": "Launch client", 8 | "runtimeExecutable": "${execPath}", 9 | "args": ["--extensionDevelopmentPath=${workspaceRoot}"], 10 | "preLaunchTask": "npm: watch" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /ghdl-ls/tests/files/hello.vhdl: -------------------------------------------------------------------------------- 1 | 2 | -- Hello world program 3 | use std.textio.all; -- Imports the standard textio package. 4 | 5 | -- Defines a design entity, without any ports. 6 | entity hello_world is 7 | end hello_world; 8 | 9 | architecture behaviour of hello_world is 10 | begin 11 | process 12 | variable l : line; 13 | begin 14 | write (l, String'("Hello world!")); 15 | writeline (output, l); 16 | wait; 17 | end process; 18 | end behaviour; 19 | 20 | -------------------------------------------------------------------------------- /ghdl-ls/tests/files/heartbeat.vhdl: -------------------------------------------------------------------------------- 1 | 2 | library ieee; 3 | use ieee.std_logic_1164.all; 4 | 5 | entity heartbeat is 6 | port ( clk: out std_logic); 7 | end heartbeat; 8 | 9 | architecture behaviour of heartbeat 10 | is 11 | constant clk_period : time := 10 ns; 12 | begin 13 | -- Clock process definition 14 | clk_process: process 15 | begin 16 | clk <= '0'; 17 | wait for clk_period/2; 18 | clk <= '1'; 19 | wait for clk_period/2; 20 | end process; 21 | end behaviour; 22 | 23 | -------------------------------------------------------------------------------- /ghdl-ls/tests/files/adder.vhdl: -------------------------------------------------------------------------------- 1 | 2 | entity adder is 3 | -- `i0`, `i1`, and the carry-in `ci` are inputs of the adder. 4 | -- `s` is the sum output, `co` is the carry-out. 5 | port (i0, i1 : in bit; ci : in bit; s : out bit; co : out bit); 6 | end adder; 7 | 8 | architecture rtl of adder is 9 | begin 10 | -- This full-adder architecture contains two concurrent assignments. 11 | -- Compute the sum. 12 | s <= i0 xor i1 xor ci; 13 | -- Compute the carry. 14 | co <= (i0 and i1) or (i0 and ci) or (i1 and ci); 15 | end rtl; 16 | 17 | -------------------------------------------------------------------------------- /ghdl-ls/tests/001simple/replies.ref: -------------------------------------------------------------------------------- 1 | Content-Length: 393 2 | 3 | {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{"includeText":true}},"hoverProvider":false,"definitionProvider":true,"referencesProvider":false,"documentHighlightProvider":false,"documentSymbolProvider":true,"codeActionProvider":false,"documentFormattingProvider":false,"documentRangeFormattingProvider":false,"renameProvider":false}}}Content-Length: 124 4 | 5 | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///../files/hello.vhdl","diagnostics":[]}} -------------------------------------------------------------------------------- /vscode-client/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "npm", 6 | "script": "compile", 7 | "group": "build", 8 | "presentation": { 9 | "panel": "dedicated", 10 | "reveal": "never" 11 | }, 12 | "problemMatcher": [ 13 | "$tsc" 14 | ] 15 | }, 16 | { 17 | "type": "npm", 18 | "script": "watch", 19 | "isBackground": true, 20 | "group": { 21 | "kind": "build", 22 | "isDefault": true 23 | }, 24 | "presentation": { 25 | "panel": "dedicated", 26 | "reveal": "never" 27 | }, 28 | "problemMatcher": [ 29 | "$tsc-watch" 30 | ] 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /NOTES: -------------------------------------------------------------------------------- 1 | Common options: 2 | 3 | "options": { "ghdl_analysis": [ "--ieee=synopsys" ] }, 4 | 5 | Converting from lsp to json (for writing tests): 6 | 7 | python3 -m vhdl_langserver.lsptools lsp2json < vhdl-ls.trace.in > cmds.json 8 | 9 | Creating a project from HDLMake: 10 | 11 | hdl-prj.json: Makefile 12 | echo "{ \"files\": [" > $@ 13 | comma=false; for f in $(SOURCES_VerilogFile); do \ 14 | if [ $$comma == "true" ]; then echo "," >> $@; else comma=true; fi; \ 15 | echo -n " { \"file\": \"$$f\", \"language\": \"verilog\"}" >> $@; \ 16 | done; \ 17 | for f in $(SOURCES_VHDLFile); do \ 18 | if [ $$comma == "true" ]; then echo "," >> $@; else comma=true; fi; \ 19 | echo -n " { \"file\": \"$$f\", \"language\": \"vhdl\"}" >> $@; \ 20 | done 21 | echo >> $@ 22 | echo "]}" >> $@ 23 | -------------------------------------------------------------------------------- /ghdl-ls/tests/005create/replies.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "result": { 6 | "capabilities": { 7 | "textDocumentSync": { 8 | "openClose": true, 9 | "change": 2, 10 | "save": { 11 | "includeText": true 12 | } 13 | }, 14 | "hoverProvider": false, 15 | "definitionProvider": true, 16 | "referencesProvider": false, 17 | "documentHighlightProvider": false, 18 | "documentSymbolProvider": true, 19 | "codeActionProvider": false, 20 | "documentFormattingProvider": false, 21 | "documentRangeFormattingProvider": true, 22 | "renameProvider": false 23 | } 24 | } 25 | }, 26 | { 27 | "jsonrpc": "2.0", 28 | "id": 7, 29 | "result": [] 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /ghdl-ls/tests/001simple/replies.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "result": { 6 | "capabilities": { 7 | "textDocumentSync": { 8 | "openClose": true, 9 | "change": 2, 10 | "save": { 11 | "includeText": true 12 | } 13 | }, 14 | "hoverProvider": false, 15 | "definitionProvider": true, 16 | "referencesProvider": false, 17 | "documentHighlightProvider": false, 18 | "documentSymbolProvider": true, 19 | "codeActionProvider": false, 20 | "documentFormattingProvider": false, 21 | "documentRangeFormattingProvider": true, 22 | "renameProvider": false 23 | } 24 | } 25 | }, 26 | { 27 | "jsonrpc": "2.0", 28 | "method": "textDocument/publishDiagnostics", 29 | "params": { 30 | "uri": "file:///../files/hello.vhdl", 31 | "diagnostics": [] 32 | } 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /ghdl-ls/tests/007errprj/replies.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "method": "window/showMessage", 5 | "params": { 6 | "type": 1, 7 | "message": "error in project file: an element of 'files' is not a dict" 8 | } 9 | }, 10 | { 11 | "jsonrpc": "2.0", 12 | "id": 0, 13 | "result": { 14 | "capabilities": { 15 | "textDocumentSync": { 16 | "openClose": true, 17 | "change": 2, 18 | "save": { 19 | "includeText": true 20 | } 21 | }, 22 | "hoverProvider": false, 23 | "definitionProvider": true, 24 | "referencesProvider": false, 25 | "documentHighlightProvider": false, 26 | "documentSymbolProvider": true, 27 | "codeActionProvider": false, 28 | "documentFormattingProvider": false, 29 | "documentRangeFormattingProvider": true, 30 | "renameProvider": false 31 | } 32 | } 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /ghdl-ls/tests/003errors/.gdb_history: -------------------------------------------------------------------------------- 1 | r 2 | catch exception 3 | r 4 | pt 5 | bt 6 | q 7 | r 8 | set lang ada 9 | break get_entity_identifier_of_architecture 10 | r 11 | c 12 | n 13 | print name 14 | n 15 | l 16 | c 17 | q 18 | break get_entity_identifier_of_architecture 19 | r 20 | break get_entity_identifier_of_architecture 21 | set lang ada 22 | break get_entity_identifier_of_architecture 23 | r 24 | c 25 | bt 26 | source ~/work/ghdl/.gdbinit 27 | l 28 | print arch 29 | pt1 arch 30 | pt1 842 31 | where 32 | break parse 33 | r 34 | c 35 | break parse_design_file 36 | delete 3 37 | i b 38 | disable 1 39 | r 40 | bt 41 | c 42 | n 43 | pt1 design 44 | n 45 | pt1 design 46 | pt1 840 47 | q 48 | r 49 | catch exception 50 | r 51 | print flags.flag_force_analysis 52 | q 53 | r 54 | catch exception 55 | watch flags__flag_force_analysis 56 | r 57 | i b 58 | disable 2 59 | break libghdl__analyze_init 60 | r 61 | c 62 | print flags.flag_force_analysis 63 | print &flags.flag_force_analysis 64 | x /8xb $2 65 | x /8xb $2+1 66 | x /8xb $2+2 67 | q 68 | -------------------------------------------------------------------------------- /ghdl-ls/tests/008errnofile/replies.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "method": "window/showMessage", 5 | "params": { 6 | "type": 1, 7 | "message": "cannot load nofile.vhdl: No such file or directory" 8 | } 9 | }, 10 | { 11 | "jsonrpc": "2.0", 12 | "id": 0, 13 | "result": { 14 | "capabilities": { 15 | "textDocumentSync": { 16 | "openClose": true, 17 | "change": 2, 18 | "save": { 19 | "includeText": true 20 | } 21 | }, 22 | "hoverProvider": false, 23 | "definitionProvider": true, 24 | "referencesProvider": false, 25 | "documentHighlightProvider": false, 26 | "documentSymbolProvider": true, 27 | "codeActionProvider": false, 28 | "documentFormattingProvider": false, 29 | "documentRangeFormattingProvider": true, 30 | "renameProvider": false 31 | } 32 | } 33 | }, 34 | { 35 | "jsonrpc": "2.0", 36 | "id": 2, 37 | "result": null 38 | } 39 | ] 40 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2022 Tristan Gingold 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. 8 | -------------------------------------------------------------------------------- /.github/workflows/vsix.yml: -------------------------------------------------------------------------------- 1 | name: 'vsix' 2 | 3 | on: 4 | push: 5 | pull_request: 6 | schedule: 7 | - cron: '0 15 * * 3' 8 | workflow_dispatch: 9 | 10 | jobs: 11 | 12 | build: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v3 16 | - name: build VSIX package 17 | run: | 18 | cd vscode-client 19 | sudo yarn global add vsce 20 | sudo chown -R $USER:$(id -gn $USER) $HOME/.config 21 | yarn 22 | cp ../LICENSE.txt ./ 23 | vsce package 24 | - uses: actions/upload-artifact@master 25 | with: 26 | name: vhdl-lsp-vsix 27 | path: vscode-client/vhdl-lsp-*.vsix 28 | - if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' 29 | run: | 30 | curl -X POST https://api.github.com/repos/ghdl/docker/dispatches \ 31 | -H "Content-Type: application/json" \ 32 | -H 'Accept: application/vnd.github.everest-preview+json' \ 33 | -H "Authorization: token ${{ secrets.GHDL_BOT }}" \ 34 | --data '{"event_type": "ext"}' -------------------------------------------------------------------------------- /vscode-client/webpack.config.js: -------------------------------------------------------------------------------- 1 | //@ts-check 2 | 3 | 'use strict'; 4 | 5 | const path = require('path'); 6 | 7 | /**@type {import('webpack').Configuration}*/ 8 | 9 | const config = { 10 | target: 'node', 11 | entry: './extension.ts', 12 | output: { 13 | path: __dirname, 14 | filename: 'extension.js', 15 | libraryTarget: "commonjs2", 16 | //devtoolModuleFilenameTemplate: "../[resource-path]", 17 | }, 18 | devtool: 'source-map', 19 | externals: { 20 | vscode: "commonjs vscode" 21 | }, 22 | resolve: { 23 | extensions: ['.ts', '.js'] 24 | }, 25 | module: { 26 | rules: [{ 27 | test: /\.ts$/, 28 | exclude: /node_modules/, 29 | use: [{ 30 | loader: 'ts-loader', 31 | /*options: { 32 | compilerOptions: { 33 | "module": "es6" // override `tsconfig.json` so that TypeScript emits native JavaScript modules. 34 | } 35 | }*/ 36 | }] 37 | }] 38 | }, 39 | } 40 | 41 | module.exports = config; -------------------------------------------------------------------------------- /vscode-client/language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | // symbol used for single line comment. Remove this entry if your language does not support line comments 4 | "lineComment": "--", 5 | // symbols used for start and end a block comment. Remove this entry if your language does not support block comments 6 | "blockComment": [ "/*", "*/" ] 7 | }, 8 | // symbols used as brackets 9 | "brackets": [ 10 | ["{", "}"], 11 | ["[", "]"], 12 | ["(", ")"] 13 | ], 14 | // symbols that are auto closed when typing 15 | "autoClosingPairs": [ 16 | ["{", "}"], 17 | ["[", "]"], 18 | ["(", ")"], 19 | ["\"", "\""], 20 | ["'", "'"] 21 | ], 22 | // symbols that that can be used to surround a selection 23 | "surroundingPairs": [ 24 | ["{", "}"], 25 | ["[", "]"], 26 | ["(", ")"], 27 | ["\"", "\""], 28 | ["'", "'"] 29 | ], 30 | "indentationRules": { 31 | "increaseIndentPattern": "^.*\\b(is|begin)$", 32 | "decreaseIndentPattern": "^\\s*end\\b" 33 | } 34 | } -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | Various ideas of improvements (in no specific order): 2 | 3 | * reformat: realign (per scope or per block) associations/declarations 4 | * parse after a timeout instead of after each edit (but what about testing?) 5 | * go to declaration/definition -> for components and subprograms 6 | * action: add instance: ghdl prefix, no generics if none. 7 | * action: reorder associations (using the declaration order) 8 | * action: convert from assoc by position to assoc by name 9 | * action: add missing associations (to open) 10 | * update messages for dependences ? 11 | * find references 12 | * manage memory: un-analyze, free old nodes... 13 | * verilog ? 14 | * Import projects from ISE, Vivado, quartus, HDLmake, ... 15 | * integration with other IDE (emacs, atom, ...) 16 | * Test on windows, MacOS 17 | * Watch/edit project file ? 18 | * Sanitize tests 19 | * add file into project 20 | * project: add library. 21 | * watch project file and reload. 22 | * add a signal or jump to declarations 23 | * style checker 24 | * vscode: add a option to enable logs. 25 | 26 | * crash: invalid character (S-zet) 27 | * crash: file in library doesn't exist anymore 28 | -------------------------------------------------------------------------------- /ghdl-ls/tests/004errprj/replies.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "method": "window/showMessage", 5 | "params": { 6 | "type": 1, 7 | "message": "json error in project file ./hdl-prj.json:1:3" 8 | } 9 | }, 10 | { 11 | "jsonrpc": "2.0", 12 | "id": 0, 13 | "result": { 14 | "capabilities": { 15 | "textDocumentSync": { 16 | "openClose": true, 17 | "change": 2, 18 | "save": { 19 | "includeText": true 20 | } 21 | }, 22 | "hoverProvider": false, 23 | "definitionProvider": true, 24 | "referencesProvider": false, 25 | "documentHighlightProvider": false, 26 | "documentSymbolProvider": true, 27 | "codeActionProvider": false, 28 | "documentFormattingProvider": false, 29 | "documentRangeFormattingProvider": true, 30 | "renameProvider": false 31 | } 32 | } 33 | }, 34 | { 35 | "jsonrpc": "2.0", 36 | "method": "textDocument/publishDiagnostics", 37 | "params": { 38 | "uri": "file:///../files/hello.vhdl", 39 | "diagnostics": [] 40 | } 41 | } 42 | ] 43 | -------------------------------------------------------------------------------- /vscode-client/snippets/snippets.vhdl.generate.json: -------------------------------------------------------------------------------- 1 | { 2 | "Generate If": { 3 | "prefix": "generate_if", 4 | "body": [ 5 | "gen_${1:generateName} : if ${2:expression} generate", 6 | "\t$0", 7 | "end generate;" 8 | ], 9 | "description": "if generate instantiation" 10 | }, 11 | "Generate For": { 12 | "prefix": "generate_for", 13 | "body": [ 14 | "gen_loop_${1:generateName} : for ${2:i} in ${3:range} generate", 15 | "\t$0", 16 | "end generate;" 17 | ], 18 | "description": "for generate loop instantiation (vhdl 2008)" 19 | }, 20 | "Generate Case 2008": { 21 | "prefix": "generate_case_2008", 22 | "body": [ 23 | "gen_${1:generateName} : case ${1:select} generate", 24 | "\twhen ${2:others} =>", 25 | "\t\t${3:null;}", 26 | "\t$0", 27 | "end generate;" 28 | ], 29 | "description": "case generate instantiation (vhdl 2008)" 30 | }, 31 | "Generate Elsif 2008": { 32 | "prefix": "generate_elsif_2008", 33 | "body": [ 34 | "elsif ${1:expression} generate", 35 | "\t$0" 36 | ], 37 | "description": "elsif generate instantiation (vhdl 2008)" 38 | }, 39 | "Generate Else 2008": { 40 | "prefix": "generate_else_2008", 41 | "body": [ 42 | "\telse generate", 43 | "\t\t$0" 44 | ], 45 | "description": "else generate instantiation (vhdl 2008)" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vscode-client/snippets/snippets.vhdl.library.json: -------------------------------------------------------------------------------- 1 | { 2 | "Library": { 3 | "prefix": "library", 4 | "body": [ 5 | "library ${1:ieee};", 6 | "$0" 7 | ], 8 | "description": "library declaration" 9 | }, 10 | "Library IEEE": { 11 | "prefix": "library_ieee", 12 | "body": [ 13 | "library ieee;", 14 | "use ieee.std_logic_1164.all;", 15 | "use ieee.numeric_std.all;", 16 | "use ieee.math_real.all;", 17 | "$0" 18 | ], 19 | "description": "common IEEE libraries declaration" 20 | }, 21 | "Library IEEE 2008": { 22 | "prefix": "library_ieee_2008", 23 | "body": [ 24 | "library ieee;", 25 | "context ieee.ieee_std_context;", 26 | "use ieee.math_real.all;", 27 | "$0" 28 | ], 29 | "description": "common IEEE libraries declaration with 2008 standard context (vhdl 2008)" 30 | }, 31 | "Library TextIO": { 32 | "prefix": "library_textio", 33 | "body": [ 34 | "library std;", 35 | "use std.textio.all;", 36 | "$0" 37 | ], 38 | "description": "TextIO library declaration" 39 | }, 40 | "Use": { 41 | "prefix": "use", 42 | "body": [ 43 | "use ${1:lib.pkg}.all;", 44 | "$0" 45 | ], 46 | "description": "use clause" 47 | }, 48 | "Use IEEE Package": { 49 | "prefix": "use_ieee", 50 | "body": [ 51 | "use ieee.${1|std_logic_1164,std_logic_textio,numeric_std,numeric_bit,math_real,math_complex|}.all;", 52 | "$0" 53 | ], 54 | "description": "use clause IEEE standard package (std_logic_1164,std_logic_textio,numeric_std,math_real,math_complex)" 55 | }, 56 | "Context 2008": { 57 | "prefix": "context_2008", 58 | "body": [ 59 | "context ${1:lib.context_name};", 60 | "$0" 61 | ], 62 | "description": "context clause (vhdl 2008)" 63 | }, 64 | "Context IEEE 2008": { 65 | "prefix": "context_ieee_2008", 66 | "body": [ 67 | "context ieee.${1|ieee_bit_context,ieee_std_context|};", 68 | "$0" 69 | ], 70 | "description": "context clause for IEEE standard contexts (ieee_bit_context,ieee_std_context) (vhdl 2008)" 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /ghdl-ls/tests/files/adder_tb.vhdl: -------------------------------------------------------------------------------- 1 | 2 | -- A testbench has no ports. 3 | entity adder_tb is 4 | end adder_tb; 5 | 6 | architecture behav of adder_tb is 7 | -- Declaration of the component that will be instantiated. 8 | component adder 9 | port (i0, i1 : in bit; ci : in bit; s : out bit; co : out bit); 10 | end component; 11 | 12 | -- Specifies which entity is bound with the component. 13 | for adder_0: adder use entity work.adder; 14 | signal i0, i1, ci, s, co : bit; 15 | begin 16 | -- Component instantiation. 17 | adder_0: adder port map (i0 => i0, i1 => i1, ci => ci, 18 | s => s, co => co); 19 | 20 | -- This process does the real job. 21 | process 22 | type pattern_type is record 23 | -- The inputs of the adder. 24 | i0, i1, ci : bit; 25 | -- The expected outputs of the adder. 26 | s, co : bit; 27 | end record; 28 | -- The patterns to apply. 29 | type pattern_array is array (natural range <>) of pattern_type; 30 | constant patterns : pattern_array := 31 | (('0', '0', '0', '0', '0'), 32 | ('0', '0', '1', '1', '0'), 33 | ('0', '1', '0', '1', '0'), 34 | ('0', '1', '1', '0', '1'), 35 | ('1', '0', '0', '1', '0'), 36 | ('1', '0', '1', '0', '1'), 37 | ('1', '1', '0', '0', '1'), 38 | ('1', '1', '1', '1', '1')); 39 | begin 40 | -- Check each pattern. 41 | for i in patterns'range loop 42 | -- Set the inputs. 43 | i0 <= patterns(i).i0; 44 | i1 <= patterns(i).i1; 45 | ci <= patterns(i).ci; 46 | -- Wait for the results. 47 | wait for 1 ns; 48 | -- Check the outputs. 49 | assert s = patterns(i).s 50 | report "bad sum value" severity error; 51 | assert co = patterns(i).co 52 | report "bad carry out value" severity error; 53 | end loop; 54 | assert false report "end of test" severity note; 55 | -- Wait forever; this will finish the simulation. 56 | wait; 57 | end process; 58 | end behav; 59 | 60 | 61 | -------------------------------------------------------------------------------- /vscode-client/syntaxes/syntaxes.vhdl.tmLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", 3 | "name": "VHDL", 4 | "patterns": [ 5 | { 6 | "name": "comment.line.double-dash.vhdl", 7 | "match": "--.*\\n" 8 | }, 9 | { 10 | "include": "#keywords" 11 | }, 12 | { 13 | "include": "#identifiers" 14 | }, 15 | { 16 | "include": "#strings" 17 | } 18 | ], 19 | "repository": { 20 | "keywords": { 21 | "patterns": [{ 22 | "name": "keyword.control.vhdl", 23 | "match": "(?i)\\b(assert|next|if|then|else|elsif|exit|loop|while|case|for|report|return|wait)\\b" 24 | }, 25 | { 26 | "name": "keyword.mode.vhdl", 27 | "match": "(?i)\\b(in|out|inout|buffer|linkage)\\b" 28 | }, 29 | { 30 | "name": "keyword.designunit.vhdl", 31 | "match": "(?i)\\b(entity|package|body|architecture|configuration)\\b" 32 | }, 33 | { 34 | "name": "keyword.concurrent.vhdl", 35 | "match": "(?i)\\b(process|generate|block|with|select)\\b" 36 | }, 37 | { 38 | "name": "keyword.type.vhdl", 39 | "match": "(?i)\\b(access|array|protected|range|record|units)\\b" 40 | }, 41 | { 42 | "name": "keyword.other.vhdl", 43 | "match": "(?i)\\b(context|parameter|postponed|disconnect|begin|end|is|of|others|all|use|to|downto|after|new|on|open|when|severity|until|map|bus|register|null)\\b" 44 | }, 45 | { 46 | "name": "keyword.operators.vhdl", 47 | "match": "(?i)\\b(abs|and|nand|not|nor|or|xnor|xor|mod|rem|sll|srl|sla|sra|rol|ror)\\b" 48 | }, 49 | { 50 | "name": "storage.type.vhdl", 51 | "match": "(?i)\\b(attribute|alias|group|signal|constant|variable|file|component|port|generic|procedure|function|pure|impure|shared|subtype|type|library)\\b" 52 | }, 53 | { 54 | "name": "keyword.assertions.vhdl", 55 | "match": "(?i)\\b(default|clock|always|eventually|abort|never)\\b" 56 | }] 57 | }, 58 | "identifiers": { 59 | "patterns": [{ 60 | "name": "entity.name.type.standard", 61 | "match": "(?i)\\b(natural|integer|boolean|character|string|real|bit|bit_vector|time)\\b" 62 | }, 63 | { 64 | "name": "entity.name.type.ieee", 65 | "match": "(?i)\\b(std_logic|std_logic_vector|std_ulogic|std_ulogic_vector|signed|unsigned)\\b" 66 | }, 67 | { 68 | "name": "identifier", 69 | "match": "\\b([a-zA-Z][a-zA-Z0-9_]*)\\b" 70 | }] 71 | }, 72 | "strings": { 73 | "name": "string.quoted.double.vhdl", 74 | "begin": "(? clk,}", 49 | "\t\t${5:reset => reset,}", 50 | "\t\t$0", 51 | "\t);" 52 | ], 53 | "description": "component instantiation" 54 | }, 55 | "Entity": { 56 | "prefix": "entity", 57 | "body": [ 58 | "entity ${1:$TM_FILENAME_BASE} is", 59 | "\tgeneric (", 60 | "\t\t${2:generics}", 61 | "\t);", 62 | "\tport (", 63 | "\t\t${3:clk : in std_logic;}", 64 | "\t\t${4:reset : in std_logic;}", 65 | "\t\t$0", 66 | "\t);", 67 | "end entity;" 68 | ], 69 | "description": "entity interface" 70 | }, 71 | "Generic": { 72 | "prefix": "generic", 73 | "body": [ 74 | "generic (", 75 | "\t${2:generics}", 76 | ");" 77 | ], 78 | "description": "generic interface" 79 | }, 80 | "Generic Map": { 81 | "prefix": "generic_map", 82 | "body": [ 83 | "generic map (", 84 | "\t${2:generics}", 85 | ")" 86 | ], 87 | "description": "generic map interface" 88 | }, 89 | "Package": { 90 | "prefix": "package", 91 | "body": [ 92 | "package ${1:$TM_FILENAME_BASE} is", 93 | "\t$0", 94 | "end package;" 95 | ], 96 | "description": "package interface" 97 | }, 98 | "Package Body": { 99 | "prefix": "package_body", 100 | "body": [ 101 | "package body ${1:$TM_FILENAME_BASE} is", 102 | "\t$0", 103 | "end package;" 104 | ], 105 | "description": "package body interface" 106 | }, 107 | "Port": { 108 | "prefix": "port", 109 | "body": [ 110 | "port (", 111 | "\t${2:ports}", 112 | ");" 113 | ], 114 | "description": "port interface" 115 | }, 116 | "Port Map": { 117 | "prefix": "port_map", 118 | "body": [ 119 | "port map (", 120 | "\t${2:ports}", 121 | ");" 122 | ], 123 | "description": "port map interface" 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /emacs-client/README.org: -------------------------------------------------------------------------------- 1 | #+AUTHOR: Cayetano Santos 2 | #+LANGUAGE: en 3 | #+DESCRIPTION: Example emacs configuration 4 | #+OPTIONS: H:3 num:nil toc:2 5 | 6 | * Table of Contents :TOC: 7 | :PROPERTIES: 8 | :VISIBILITY: all 9 | :END: 10 | 11 | - [[#usage][Usage]] 12 | - [[#example-configuration-file][Example configuration file]] 13 | - [[#variables][Variables]] 14 | - [[#ancillary-packages][Ancillary packages]] 15 | - [[#eglot][Eglot]] 16 | - [[#vhdl][Vhdl]] 17 | 18 | * Usage 19 | 20 | Within Emacs, run =M-x org-babel-tangle= to extract source code out of this file to =/$TMPDIR/emacs.d/init.el=. This example code may be used as Emacs [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html][init file]] when starting Emacs as 21 | 22 | #+begin_src sh :tangle no 23 | export TMPDIR=/tmp; emacs --init-directory=$TMPDIR/.emacsd.d 24 | #+end_src 25 | 26 | It assumes =/$TMPDIR/emacs.d/= as =user-emacs-directory= to avoid overwritting the default user directory. You may modify this location by temporary re declaring =$TMPDIR=. 27 | 28 | You may check =ghdl= capabilities as =lsp= with help of an example project: 29 | 30 | #+begin_src sh :tangle no 31 | git clone --depth=1 https://gitlab.com/csantosb/ip/alu alu 32 | #+end_src 33 | 34 | This example has been tested under GNU/Emacs 29.4. It assumes =ghdl-ls= is in your =PATH=, and privileges built-in Emacs packages. 35 | 36 | * Example configuration file 37 | :PROPERTIES: 38 | :header-args: :tangle (format "%s/%s" (getenv "TMPDIR") ".emacs.d/init.el") :mkdirp yes 39 | :END: 40 | 41 | ** Variables 42 | 43 | Setup necessary variables. 44 | 45 | #+begin_src emacs-lisp 46 | (setq use-package-always-defer t) 47 | #+end_src 48 | 49 | ** Ancillary packages 50 | 51 | *** Flymake 52 | 53 | Flymake is a modern on-the-fly syntax checking extension for GNU Emacs. 54 | 55 | #+begin_src emacs-lisp 56 | (use-package flymake 57 | :hook 58 | (prog-mode . flymake-mode)) 59 | #+end_src 60 | 61 | *** Eldoc 62 | 63 | #+begin_src emacs-lisp 64 | (use-package eldoc 65 | :custom 66 | (eldoc-echo-area-prefer-doc-buffer t) 67 | (eldoc-documentation-strategy 'eldoc-documentation-compose-eagerly)) 68 | #+end_src 69 | 70 | ** Eglot 71 | 72 | #+begin_src emacs-lisp 73 | (use-package eglot 74 | :config 75 | (push '(vhdl-mode "ghdl-ls") eglot-server-programs) 76 | :custom 77 | ;; activate Eglot in cross-referenced, non-project 78 | (eglot-extend-to-xref t)) 79 | #+end_src 80 | 81 | ** Vhdl 82 | 83 | #+begin_src emacs-lisp 84 | (use-package vhdl-mode 85 | :ensure nil ; built-in 86 | :mode (("\\.\\(vhd\\(?:l?\\)?\\)" . vhdl-mode)) 87 | :hook (vhdl-mode . (lambda() 88 | (when (and (executable-find "ghdl-ls") 89 | (locate-dominating-file 90 | default-directory "hdl-prj.json")) 91 | (eglot-ensure))))) 92 | #+end_src 93 | 94 | * Advanced 95 | 96 | For a more advanced example, see [[https://git.sr.ht/~csantosb/emacs.vhdl-ide][here]]. 97 | -------------------------------------------------------------------------------- /ghdl-ls/tests/002coverage/vhdl-ls.trace.out: -------------------------------------------------------------------------------- 1 | Content-Length: 393 2 | 3 | {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{"includeText":true}},"hoverProvider":false,"definitionProvider":true,"referencesProvider":false,"documentHighlightProvider":false,"documentSymbolProvider":true,"codeActionProvider":false,"documentFormattingProvider":false,"documentRangeFormattingProvider":false,"renameProvider":false}}}Content-Length: 167 4 | 5 | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","diagnostics":[]}}Content-Length: 2423 6 | 7 | {"jsonrpc":"2.0","id":1,"result":[{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}},{"kind":13,"name":"i0","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":8},"end":{"line":4,"character":10}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"i1","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":12},"end":{"line":4,"character":14}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"ci","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":25},"end":{"line":4,"character":27}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"s","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":38},"end":{"line":4,"character":39}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"co","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":51},"end":{"line":4,"character":53}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":2,"name":"rtl","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":7,"character":13},"end":{"line":7,"character":16}}}}]}Content-Length: 38 8 | 9 | {"jsonrpc":"2.0","id":2,"result":null} -------------------------------------------------------------------------------- /ghdl-ls/tests/003errors/replies.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "result": { 6 | "capabilities": { 7 | "textDocumentSync": { 8 | "openClose": true, 9 | "change": 2, 10 | "save": { 11 | "includeText": true 12 | } 13 | }, 14 | "hoverProvider": false, 15 | "definitionProvider": true, 16 | "referencesProvider": false, 17 | "documentHighlightProvider": false, 18 | "documentSymbolProvider": true, 19 | "codeActionProvider": false, 20 | "documentFormattingProvider": false, 21 | "documentRangeFormattingProvider": true, 22 | "renameProvider": false 23 | } 24 | } 25 | }, 26 | { 27 | "jsonrpc": "2.0", 28 | "method": "textDocument/publishDiagnostics", 29 | "params": { 30 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors/tc.vhdl", 31 | "diagnostics": [ 32 | { 33 | "source": "ghdl", 34 | "range": { 35 | "start": { 36 | "line": 2, 37 | "character": 9 38 | }, 39 | "end": { 40 | "line": 2, 41 | "character": 9 42 | } 43 | }, 44 | "message": "unit \"std_logic_unsigned\" not found in library \"ieee\"", 45 | "severity": 1 46 | }, 47 | { 48 | "source": "ghdl", 49 | "range": { 50 | "start": { 51 | "line": 2, 52 | "character": 9 53 | }, 54 | "end": { 55 | "line": 2, 56 | "character": 9 57 | } 58 | }, 59 | "message": " (use --ieee=synopsys for non-standard synopsys packages)", 60 | "severity": 1 61 | } 62 | ] 63 | } 64 | }, 65 | { 66 | "jsonrpc": "2.0", 67 | "id": 1, 68 | "result": [ 69 | { 70 | "kind": 2, 71 | "name": "tb", 72 | "location": { 73 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors/tc.vhdl", 74 | "range": { 75 | "start": { 76 | "line": 4, 77 | "character": 0 78 | }, 79 | "end": { 80 | "line": 5, 81 | "character": 0 82 | } 83 | } 84 | } 85 | }, 86 | { 87 | "kind": 2, 88 | "name": "behav", 89 | "location": { 90 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors/tc.vhdl", 91 | "range": { 92 | "start": { 93 | "line": 7, 94 | "character": 0 95 | }, 96 | "end": { 97 | "line": 11, 98 | "character": 0 99 | } 100 | } 101 | } 102 | } 103 | ] 104 | }, 105 | { 106 | "jsonrpc": "2.0", 107 | "id": 2, 108 | "result": null 109 | } 110 | ] 111 | -------------------------------------------------------------------------------- /ghdl-ls/tests/002coverage/vhdl-ls.trace.in: -------------------------------------------------------------------------------- 1 | Content-Length: 2167 2 | 3 | {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":22858,"rootPath":"/home/tgingold/work/vhdl-language-server/tests/002coverage","rootUri":"file:///home/tgingold/work/vhdl-language-server/tests/002coverage","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"]}},"definition":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"codeAction":{"dynamicRegistration":true},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true},"typeDefinition":{"dynamicRegistration":true},"implementation":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true}}},"trace":"off","workspaceFolders":[{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/002coverage","name":"002coverage"}]}}Content-Length: 52 4 | 5 | {"jsonrpc":"2.0","method":"initialized","params":{}}Content-Length: 665 6 | 7 | {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","languageId":"vhdl","version":1,"text":"\nentity adder is\n -- `i0`, `i1`, and the carry-in `ci` are inputs of the adder.\n -- `s` is the sum output, `co` is the carry-out.\n port (i0, i1 : in bit; ci : in bit; s : out bit; co : out bit);\nend adder;\n\narchitecture rtl of adder is\nbegin\n -- This full-adder architecture contains two concurrent assignments.\n -- Compute the sum.\n s <= i0 xor i1 xor ci;\n -- Compute the carry.\n co <= (i0 and i1) or (i0 and ci) or (i1 and ci);\nend rtl;\n\n"}}}Content-Length: 170 8 | 9 | {"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl"}}}Content-Length: 58 10 | 11 | {"jsonrpc":"2.0","id":2,"method":"shutdown","params":null} -------------------------------------------------------------------------------- /ghdl-ls/tests/testenv.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import io 4 | import json 5 | import vhdl_langserver.lsp as lsp 6 | import subprocess 7 | 8 | class StrConn: 9 | def __init__(self): 10 | self.res = '' 11 | 12 | def write(self, s): 13 | self.res += s 14 | 15 | 16 | def show_diffs(name, ref, res): 17 | if isinstance(ref, dict) and isinstance(res, dict): 18 | for k in ref: 19 | if k not in res: 20 | print('{}.{} not in the result'.format(name, k)) 21 | else: 22 | show_diffs('{}.{}'.format(name, k), ref[k], res[k]) 23 | for k in res: 24 | if k not in ref: 25 | print('{}.{} unexpected in the result'.format(name, k)) 26 | elif isinstance(ref, str) and isinstance(res, str): 27 | if res != ref: 28 | print('{}: mismatch (ref: {}, result: {})'.format(name, res, ref)) 29 | elif isinstance(ref, int) and isinstance(res, int): 30 | if res != ref: 31 | print('{}: mismatch (ref: {}, result: {})'.format(name, res, ref)) 32 | elif isinstance(ref, list) and isinstance(res, list): 33 | for i in range(min(len(ref), len(res))): 34 | show_diffs('{}[{}]'.format(name, i), ref[i], res[i]) 35 | if len(ref) > len(res): 36 | print('{}: missing elements'.format(name)) 37 | elif len(ref) < len(res): 38 | print('{}: extra elements'.format(name)) 39 | else: 40 | print('unhandle type {} in {}'.format(type(ref), name)) 41 | 42 | def run_compare(req_name, rep_name): 43 | # Convert the JSON input file to an LSP string. 44 | res = json.load(open(req_name, 'r')) 45 | conn = StrConn() 46 | ls = lsp.LanguageProtocolServer(None, conn) 47 | for req in res: 48 | ls.write_output(req) 49 | 50 | # Run 51 | p = subprocess.run([os.environ.get('GHDLLS', '../../ghdl-ls')], 52 | input=conn.res.encode('utf-8'), stdout=subprocess.PIPE) 53 | if p.returncode != 0: 54 | print('FAIL: exit != 0') 55 | sys.exit(1) 56 | 57 | if rep_name is None: 58 | return 59 | 60 | # Check output 61 | in_io = io.BytesIO(p.stdout) 62 | conn = lsp.LSPConn(in_io, None) 63 | ls = lsp.LanguageProtocolServer(None, conn) 64 | ref = json.load(open(rep_name, 'r')) 65 | errs = 0 66 | json_res = [] 67 | for r in ref: 68 | rep = ls.read_request() 69 | if rep is None: 70 | print('FAIL: number of reply does not match') 71 | errs += 1 72 | break 73 | rep = json.loads(rep) 74 | json_res.append(rep) 75 | if rep != r: 76 | print('FAIL: reply does not match for {}'.format(req_name)) 77 | print(rep) 78 | print(r) 79 | show_diffs('', r, rep) 80 | errs += 1 81 | rep = ls.read_request() 82 | if rep is not None: 83 | print('FAIL: too many replies') 84 | errs += 1 85 | if errs != 0: 86 | print('FAILURE between output and {} (for {})'.format(rep_name, req_name)) 87 | print('Writing result output to result.json') 88 | with open('result.json', 'w') as f: 89 | f.write(json.dumps(json_res, indent=2)) 90 | f.write('\n') 91 | sys.exit(1) 92 | 93 | def done(): 94 | print('PASS') 95 | sys.exit(0) 96 | -------------------------------------------------------------------------------- /ghdl-ls/tests/005opterr/replies.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "method": "window/showMessage", 5 | "params": { 6 | "type": 1, 7 | "message": "error with option: --unknown-option" 8 | } 9 | }, 10 | { 11 | "jsonrpc": "2.0", 12 | "id": 0, 13 | "result": { 14 | "capabilities": { 15 | "textDocumentSync": { 16 | "openClose": true, 17 | "change": 2, 18 | "save": { 19 | "includeText": true 20 | } 21 | }, 22 | "hoverProvider": false, 23 | "definitionProvider": true, 24 | "referencesProvider": false, 25 | "documentHighlightProvider": false, 26 | "documentSymbolProvider": true, 27 | "codeActionProvider": false, 28 | "documentFormattingProvider": false, 29 | "documentRangeFormattingProvider": true, 30 | "renameProvider": false 31 | } 32 | } 33 | }, 34 | { 35 | "jsonrpc": "2.0", 36 | "method": "textDocument/publishDiagnostics", 37 | "params": { 38 | "uri": "file:///home/tgingold/work/ghdl-language-server/ghdl-ls/tests/files/heartbeat.vhdl", 39 | "diagnostics": [] 40 | } 41 | }, 42 | { 43 | "jsonrpc": "2.0", 44 | "id": 1, 45 | "result": [ 46 | { 47 | "kind": 2, 48 | "name": "heartbeat", 49 | "location": { 50 | "uri": "file:///home/tgingold/work/ghdl-language-server/ghdl-ls/tests/files/heartbeat.vhdl", 51 | "range": { 52 | "start": { 53 | "line": 4, 54 | "character": 0 55 | }, 56 | "end": { 57 | "line": 6, 58 | "character": 0 59 | } 60 | } 61 | } 62 | }, 63 | { 64 | "kind": 2, 65 | "name": "behaviour", 66 | "location": { 67 | "uri": "file:///home/tgingold/work/ghdl-language-server/ghdl-ls/tests/files/heartbeat.vhdl", 68 | "range": { 69 | "start": { 70 | "line": 8, 71 | "character": 0 72 | }, 73 | "end": { 74 | "line": 20, 75 | "character": 0 76 | } 77 | } 78 | } 79 | }, 80 | { 81 | "kind": 6, 82 | "name": "clk_process", 83 | "location": { 84 | "uri": "file:///home/tgingold/work/ghdl-language-server/ghdl-ls/tests/files/heartbeat.vhdl", 85 | "range": { 86 | "start": { 87 | "line": 13, 88 | "character": 15 89 | }, 90 | "end": { 91 | "line": 19, 92 | "character": 2 93 | } 94 | } 95 | }, 96 | "containerName": { 97 | "kind": 2, 98 | "name": "behaviour", 99 | "location": { 100 | "uri": "file:///home/tgingold/work/ghdl-language-server/ghdl-ls/tests/files/heartbeat.vhdl", 101 | "range": { 102 | "start": { 103 | "line": 8, 104 | "character": 0 105 | }, 106 | "end": { 107 | "line": 20, 108 | "character": 0 109 | } 110 | } 111 | } 112 | } 113 | } 114 | ] 115 | } 116 | ] 117 | -------------------------------------------------------------------------------- /ghdl-ls/tests/testsuite.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | "Parallel tester" 4 | 5 | import argparse 6 | import glob 7 | import subprocess 8 | import select 9 | import os 10 | import os.path 11 | import time 12 | 13 | DIRS = ['[0-9]*'] 14 | NUMJOBS = 4 15 | 16 | class Job(object): 17 | def __init__(self, dirname, poll): 18 | self.dirname = dirname 19 | self.poll = poll 20 | self.out = '' 21 | self.p = None 22 | self.out_fd = None 23 | 24 | def start(self): 25 | self.p = subprocess.Popen( 26 | ['./testsuite.py'], 27 | stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True, 28 | cwd=self.dirname) 29 | self.out_fd = self.p.stdout 30 | self.poll.extend([self.out_fd]) 31 | 32 | def wait(self): 33 | self.poll.remove(self.out_fd) 34 | return self.p.wait() 35 | 36 | def run(keep): 37 | # List of tests to run 38 | tests = [] 39 | for d in DIRS: 40 | tests.extend(glob.glob(d)) 41 | 42 | start_time = time.time() 43 | jobs = [] 44 | poll = [] 45 | failures = [] 46 | nbr_tests = len(tests) 47 | nbr_run = 0 48 | nbr_err = 0 49 | while tests or jobs: 50 | # Start as many jobs as possible 51 | if len(tests) > 0 and len(jobs) < NUMJOBS: 52 | test = tests.pop(0) 53 | j = Job(test, poll) 54 | jobs.append(j) 55 | print('Starting {}'.format(test)) 56 | j.start() 57 | elif len(jobs) > 0: 58 | # Wait for output or end of job. 59 | assert len(poll) == NUMJOBS or len(tests) == 0 60 | res = select.select(poll, [], []) 61 | done = set() 62 | for fd in res[0]: 63 | d = os.read(fd.fileno(), 1024) 64 | if len(d) == 0: 65 | # EOF => end of job. 66 | for j in jobs: 67 | if fd == j.out_fd: 68 | done.add(j) 69 | break 70 | else: 71 | # Gather output 72 | for j in jobs: 73 | if fd == j.out_fd: 74 | j.out += d 75 | for j in done: 76 | print('Finish: {}'.format(j.dirname)) 77 | print(j.out) 78 | code = j.wait() 79 | if code != 0: 80 | print('############### Error for {}'.format(j.dirname)) 81 | nbr_err += 1 82 | failures.append(j.dirname) 83 | if not keep: 84 | tests = [] 85 | jobs.remove(j) 86 | nbr_run += 1 87 | end_time = time.time() 88 | 89 | print('{}/{} tests run in {} sec, {} failures'.format( 90 | nbr_run, nbr_tests, end_time - start_time, nbr_err)) 91 | if failures: 92 | print('Failure: {}'.format(failures)) 93 | 94 | 95 | if __name__ == '__main__': 96 | parser = argparse.ArgumentParser(description="parallel test driver") 97 | parser.add_argument("-k", "--keep", 98 | help="keep running", action='store_true') 99 | parser.add_argument("--jobs", "-j", type=int, default=4) 100 | args = parser.parse_args() 101 | NUMJOBS = args.jobs 102 | run(args.keep) 103 | -------------------------------------------------------------------------------- /vscode-client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vhdl-lsp", 3 | "description": "VHDL language server", 4 | "author": "Tristan Gingold", 5 | "license": "GPL-2.0-or-later", 6 | "version": "0.1.0-dev", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/ghdl/ghdl-language-server" 10 | }, 11 | "publisher": "tgingold", 12 | "categories": [ 13 | "Programming Languages", 14 | "Snippets" 15 | ], 16 | "keywords": [ 17 | "vhdl" 18 | ], 19 | "activationEvents": [ 20 | "onLanguage:vhdl" 21 | ], 22 | "main": "./extension", 23 | "contributes": { 24 | "languages": [ 25 | { 26 | "id": "vhdl", 27 | "aliases": [ 28 | "VHDL", 29 | "vhdl" 30 | ], 31 | "extensions": [ 32 | ".vhdl", 33 | ".vhd" 34 | ], 35 | "configuration": "./language-configuration.json" 36 | } 37 | ], 38 | "grammars": [ 39 | { 40 | "language": "vhdl", 41 | "scopeName": "source.vhdl", 42 | "path": "./syntaxes/syntaxes.vhdl.tmLanguage.json" 43 | } 44 | ], 45 | "snippets": [ 46 | { 47 | "language": "vhdl", 48 | "path": "./snippets/snippets.vhdl.declaration.json" 49 | }, 50 | { 51 | "language": "vhdl", 52 | "path": "./snippets/snippets.vhdl.generate.json" 53 | }, 54 | { 55 | "language": "vhdl", 56 | "path": "./snippets/snippets.vhdl.interface.json" 57 | }, 58 | { 59 | "language": "vhdl", 60 | "path": "./snippets/snippets.vhdl.library.json" 61 | }, 62 | { 63 | "language": "vhdl", 64 | "path": "./snippets/snippets.vhdl.logic.json" 65 | } 66 | ], 67 | "commands": [ 68 | { 69 | "command": "ghdl-ls.showallfiles", 70 | "title": "Show all source files" 71 | }, 72 | { 73 | "command": "ghdl-ls.instantiate-entity", 74 | "title": "vhdl: Instantiate an entity" 75 | }, 76 | { 77 | "command": "ghdl-ls.shownode", 78 | "title": "Show node info" 79 | } 80 | ], 81 | "menus": { 82 | "editor/context": [ 83 | { 84 | "command": "ghdl-ls.shownode", 85 | "when": "editorTextFocus && resourceLangId == vhdl" 86 | } 87 | ] 88 | }, 89 | "configurationDefaults": { 90 | "[vhdl]": { 91 | "files.encoding": "iso88591" 92 | } 93 | }, 94 | "configuration": { 95 | "title": "Vhdl", 96 | "properties": { 97 | "vhdl.maxNumberOfProblems": { 98 | "scope": "resource", 99 | "type": "number", 100 | "default": 100, 101 | "description": "Controls the maximum number of problems produced by the server." 102 | }, 103 | "vhdl.debugLSP": { 104 | "scope": "window", 105 | "type": "boolean", 106 | "default": false, 107 | "description": "Increase log verbosity and trace the communication between VS Code and the language server." 108 | } 109 | } 110 | } 111 | }, 112 | "scripts": { 113 | "vscode:prepublish": "webpack --mode production", 114 | "compile": "webpack --mode none", 115 | "watch": "webpack --mode none --watch", 116 | "test-compile": "tsc -p ./", 117 | "tsc-compile": "tsc -b", 118 | "tsc-watch": "tsc -b -w" 119 | }, 120 | "engines": { 121 | "vscode": "^1.79.1" 122 | }, 123 | "devDependencies": { 124 | "@types/node": "^20.3.3", 125 | "@types/vscode": "^1.79.1", 126 | "ts-loader": "^9.4.4", 127 | "tslint": "^6.1.3", 128 | "typescript": "^5.1.6", 129 | "webpack": "^5.88.1", 130 | "webpack-cli": "^5.1.4" 131 | }, 132 | "dependencies": { 133 | "vscode-languageclient": "^7.0.0" 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /vscode-client/snippets/snippets.vhdl.logic.json: -------------------------------------------------------------------------------- 1 | { 2 | "Assert": { 3 | "prefix": "assert", 4 | "body": [ 5 | "assert ${1:expression}", 6 | "\treport \"${2:string}\"", 7 | "\tseverity ${3|note,warning,error,failure|};", 8 | "$0" 9 | ], 10 | "description": "assert declaration" 11 | }, 12 | "Case": { 13 | "prefix": "case", 14 | "body": [ 15 | "case ${1:sel} is", 16 | "\twhen ${2:others} =>", 17 | "\t\t${3:null;}", 18 | "\t$0", 19 | "end case;" 20 | ], 21 | "description": "case block" 22 | }, 23 | "If": { 24 | "prefix": "if", 25 | "body": [ 26 | "if ${1:expression} then", 27 | "\t$0", 28 | "end if;" 29 | ], 30 | "description": "if block" 31 | }, 32 | "Elsif": { 33 | "prefix": "elsif", 34 | "body": [ 35 | "elsif ${1:expression} then", 36 | "\t$0" 37 | ], 38 | "description": "elsif block" 39 | }, 40 | "Else": { 41 | "prefix": "else", 42 | "body": [ 43 | "else", 44 | "\t$0" 45 | ], 46 | "description": "else block" 47 | }, 48 | "For": { 49 | "prefix": "for", 50 | "body": [ 51 | "for ${1:i} in ${2:range} loop", 52 | "\t$0", 53 | "end loop;" 54 | ], 55 | "description": "for loop block" 56 | }, 57 | "Process Asynchronous": { 58 | "prefix": "process_asynchronous", 59 | "body": [ 60 | "process (${1:clk}, ${2:reset})", 61 | "begin", 62 | "\tif $2 = ${3|'1','0'|} then", 63 | "\t\t$4", 64 | "\telsif rising_edge($1) then", 65 | "\t\t$0", 66 | "\tend if;", 67 | "end process;" 68 | ], 69 | "description": "asynchronous process block" 70 | }, 71 | "Process Synchronous": { 72 | "prefix": ["process_synchronous"], 73 | "body": [ 74 | "process (${1:clk})", 75 | "begin", 76 | "\tif rising_edge($1) then", 77 | "\t\tif ${2:reset} = ${3|'1','0'|} then", 78 | "\t\t\t$4", 79 | "\t\telse", 80 | "\t\t\t$0", 81 | "\t\tend if;", 82 | "\tend if;", 83 | "end process;" 84 | ], 85 | "description": "clocked process block" 86 | }, 87 | "Process Clocked": { 88 | "prefix": ["process_clocked"], 89 | "body": [ 90 | "process (${1:clk})", 91 | "begin", 92 | "\tif rising_edge($1) then", 93 | "\t\t$0", 94 | "\tend if;", 95 | "end process;" 96 | ], 97 | "description": "clocked process block" 98 | }, 99 | "Process Combinatorial": { 100 | "prefix": "process_combinatorial", 101 | "body": [ 102 | "process (${1:sensitivity_list})", 103 | "begin", 104 | "\t$0", 105 | "end process;" 106 | ], 107 | "description": "combinatorial process block" 108 | }, 109 | "Process Combinatorial 2008": { 110 | "prefix": "process_combinatorial_2008", 111 | "body": [ 112 | "process (all)", 113 | "begin", 114 | "\t$0", 115 | "end process;" 116 | ], 117 | "description": "combinatorial process block (vhdl 2008)" 118 | }, 119 | "When": { 120 | "prefix": "when", 121 | "body": [ 122 | "when ${1:others} =>", 123 | "\t$0" 124 | ], 125 | "description": "when declaration" 126 | }, 127 | "When Else": { 128 | "prefix": "when_else", 129 | "body": [ 130 | "${1:signal} <= ${2:first_value} when ${3:expression}", 131 | "\telse ${4:final_value};", 132 | "$0" 133 | ], 134 | "description": "concurrent when else declaration" 135 | }, 136 | "While": { 137 | "prefix": "while", 138 | "body": [ 139 | "while ${1:expression} loop", 140 | "\t$0", 141 | "end loop;" 142 | ], 143 | "description": "while loop block" 144 | }, 145 | "With Select": { 146 | "prefix": ["select", "with_select"], 147 | "body": [ 148 | "with ${1:sel} select", 149 | "\t${2:signal} <= ${3:first_value} when ${4:select_value},", 150 | "\t\t${5:last_value} when others;", 151 | "$0" 152 | ], 153 | "description": "concurrent with select declaration" 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /vscode-client/snippets/snippets.vhdl.declaration.json: -------------------------------------------------------------------------------- 1 | { 2 | // TODO: open VSC enhancement to allow for user selections ($x) within or (${1||}) selection 3 | // TODO: open VSC bug about or selection for doing nothing still requires the editor insert a space or character 4 | // TODO: figure out how to column align with snippets such that when new lines are made for things like when/else 5 | // or with select, cursor for next line is aligned with <= 6 | // TODO: all types from ieee fixed/floating point packages 7 | "Alias": { 8 | "prefix": "alias", 9 | "body": [ 10 | "alias ${1:alias_name} : ${2:alias_type} is ${3:object_name};", 11 | "$0" 12 | ], 13 | "description": "alias declaration" 14 | }, 15 | // ? are signal/variable/constant all valid for external names 16 | "Alias External Name 2008": { 17 | "prefix": "alias_external_name_2008", 18 | "body": [ 19 | "alias ${1:name} is", 20 | "\t<< ${2|signal,variable,constant|} ${3:path.to.signal.name} : ${4:type} >>;", 21 | "$0" 22 | ], 23 | "description": "hierarchical signal declaration (vhdl 2008). NOTE: for standard types (SLV, unsighed, signed, etc.), no range needs to be specified" 24 | }, 25 | "Array": { 26 | "prefix": "array", 27 | "body": [ 28 | "type ${1:type_name} is array (${2:natural range<>}) of ${3:element_type};", 29 | "$0" 30 | ], 31 | "description": "synthesizable attributes (high,low,left,right,range,reverse_range,length,event)" 32 | }, 33 | "Constant": { 34 | "prefix": "constant", 35 | "body": [ 36 | "constant ${1:name} : ${2:type} := ${3:default_value};", 37 | "$0" 38 | ], 39 | "description": "constant declaration" 40 | }, 41 | "Function": { 42 | "prefix": "function", 43 | "body": [ 44 | "function ${1:name} (${2:params}) return ${3:type} is", 45 | "begin", 46 | "\t$0", 47 | "end function;" 48 | ], 49 | "description": "function body declaration" 50 | }, 51 | "Natural Range": { 52 | "prefix": "natural_range", 53 | "body": [ "natural range<>" ], 54 | "description": "natural range declaration" 55 | }, 56 | "Others": { 57 | "prefix": ["others"], 58 | "body": [ "(others => ${1:})${2| ,;|}$0" ], 59 | "description": "others declaration" 60 | }, 61 | "Procedure": { 62 | "prefix": "procedure", 63 | "body": [ 64 | "procedure ${1:name} (${2:params}) is", 65 | "begin", 66 | "\t$0", 67 | "end procedure;" 68 | ], 69 | "description": "procedure body declaration" 70 | }, 71 | "Record": { 72 | "prefix": "record", 73 | "body": [ 74 | "type ${1:name} is record", 75 | "\t${2:signal_name} : ${3:type};", 76 | "\t$0", 77 | "end record;" 78 | ], 79 | "description": "record declaration" 80 | }, 81 | "Signal": { 82 | "prefix": "signal", 83 | "body": [ 84 | "signal ${1:name} : ${2:type} := ${3:default_value};", 85 | "$0" 86 | ], 87 | "description": "signal declaration" 88 | }, 89 | "Signed": { 90 | "prefix": "signed", 91 | "body": [ "signed($1 ${2|downto,to|} $3)${4| := ,;|}$0" ], 92 | "description": "signed declaration" 93 | }, 94 | "Standard Logic": { 95 | "prefix": ["std_logic", "sl"], 96 | "body": [ "std_logic${1| := ,;|}$0" ], 97 | "description": "std_logic declaration" 98 | }, 99 | "Standard ULogic": { 100 | "prefix": ["std_ulogic", "sul"], 101 | "body": [ "std_ulogic${1| := ,;|}$0" ], 102 | "description": "std_ulogic declaration" 103 | }, 104 | "Standard Logic Vector": { 105 | "prefix": ["std_logic_vector", "slv"], 106 | "body": [ "std_logic_vector($1 ${2|downto,to|} $3)${4| := ,;|}$0" ], 107 | "description": "std_logic_vector declaration" 108 | }, 109 | "Standard ULogic Vector": { 110 | "prefix": ["std_ulogic_vector", "sulv"], 111 | "body": [ "std_ulogic_vector($1 ${2|downto,to|} $3)${4| := ,;|}$0" ], 112 | "description": "std_ulogic_vector declaration" 113 | }, 114 | "Unsigned": { 115 | "prefix": "unsigned", 116 | "body": [ "unsigned(${1} ${2|downto,to|} ${3})${4| := ,;|}$0" ], 117 | "description": "unsigned declaration" 118 | }, 119 | "Variable": { 120 | "prefix": "variable", 121 | "body": [ 122 | "variable ${1:name} : ${2:type} := ${3:default_value};", 123 | "$0" 124 | ], 125 | "description": "variable declaration" 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /ghdl-ls/tests/007errprj/cmds.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "method": "initialize", 6 | "params": { 7 | "processId": 2, 8 | "rootPath": ".", 9 | "rootUri": "file://.", 10 | "capabilities": { 11 | "workspace": { 12 | "applyEdit": true, 13 | "workspaceEdit": { 14 | "documentChanges": true 15 | }, 16 | "symbol": { 17 | "symbolKind": { 18 | "valueSet": [ 19 | 1, 20 | 2, 21 | 3, 22 | 4, 23 | 5, 24 | 6, 25 | 7, 26 | 8, 27 | 9, 28 | 10, 29 | 11, 30 | 12, 31 | 13, 32 | 14, 33 | 15, 34 | 16, 35 | 17, 36 | 18, 37 | 19, 38 | 20, 39 | 21, 40 | 22, 41 | 23, 42 | 24, 43 | 25, 44 | 26 45 | ] 46 | } 47 | }, 48 | "configuration": true, 49 | "workspaceFolders": true 50 | }, 51 | "textDocument": { 52 | "publishDiagnostics": { 53 | "relatedInformation": true 54 | }, 55 | "synchronization": { 56 | "dynamicRegistration": true, 57 | "willSave": true, 58 | "willSaveWaitUntil": true, 59 | "didSave": true 60 | }, 61 | "completion": { 62 | "dynamicRegistration": true, 63 | "contextSupport": true, 64 | "completionItem": { 65 | "snippetSupport": true, 66 | "commitCharactersSupport": true, 67 | "documentationFormat": [ 68 | "markdown", 69 | "plaintext" 70 | ], 71 | "deprecatedSupport": true 72 | }, 73 | "completionItemKind": { 74 | "valueSet": [ 75 | 1, 76 | 2, 77 | 3, 78 | 4, 79 | 5, 80 | 6, 81 | 7, 82 | 8, 83 | 9, 84 | 10, 85 | 11, 86 | 12, 87 | 13, 88 | 14, 89 | 15, 90 | 16, 91 | 17, 92 | 18, 93 | 19, 94 | 20, 95 | 21, 96 | 22, 97 | 23, 98 | 24, 99 | 25 100 | ] 101 | } 102 | }, 103 | "hover": { 104 | "dynamicRegistration": true, 105 | "contentFormat": [ 106 | "markdown", 107 | "plaintext" 108 | ] 109 | }, 110 | "signatureHelp": { 111 | "dynamicRegistration": true, 112 | "signatureInformation": { 113 | "documentationFormat": [ 114 | "markdown", 115 | "plaintext" 116 | ] 117 | } 118 | }, 119 | "documentSymbol": { 120 | "dynamicRegistration": true, 121 | "symbolKind": { 122 | "valueSet": [ 123 | 1, 124 | 2, 125 | 3, 126 | 4, 127 | 5, 128 | 6, 129 | 7, 130 | 8, 131 | 9, 132 | 10, 133 | 11, 134 | 12, 135 | 13, 136 | 14, 137 | 15, 138 | 16, 139 | 17, 140 | 18, 141 | 19, 142 | 20, 143 | 21, 144 | 22, 145 | 23, 146 | 24, 147 | 25, 148 | 26 149 | ] 150 | } 151 | } 152 | } 153 | }, 154 | "trace": "off", 155 | "workspaceFolders": [ 156 | { 157 | "uri": "file:///.", 158 | "name": "workspacename" 159 | } 160 | ] 161 | } 162 | }, 163 | { 164 | "jsonrpc": "2.0", 165 | "method": "initialized", 166 | "params": {} 167 | } 168 | ] 169 | -------------------------------------------------------------------------------- /vscode-client/extension.ts: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------------------- 2 | * Copyright (c) Microsoft Corporation. All rights reserved. 3 | * Licensed under the MIT License. See License.txt in the project root for license information. 4 | * ------------------------------------------------------------------------------------------ */ 5 | 6 | import * as vscode from 'vscode'; 7 | 8 | import { 9 | LanguageClient, 10 | LanguageClientOptions, 11 | ServerOptions 12 | } from 'vscode-languageclient/node'; 13 | import * as vscodelc from 'vscode-languageclient'; 14 | 15 | namespace ExtraRequest { 16 | export const ShowAllFiles = 17 | new vscodelc.RequestType0('workspace/xShowAllFiles') 18 | export const GetAllEntities = 19 | new vscodelc.RequestType0<{name: string, library: string}[], void>('workspace/xGetAllEntities') 20 | export const GetEntityInterface = 21 | new vscodelc.RequestType<{name: string, library: string}, any, void>('workspace/xGetEntityInterface') 22 | } 23 | 24 | let client: LanguageClient; 25 | 26 | class EntityItem implements vscode.QuickPickItem { 27 | label: string 28 | description: string 29 | library: string 30 | 31 | constructor(name : string, library: string) { 32 | this.label = name 33 | this.description = library + '.' + name 34 | this.library = library 35 | } 36 | } 37 | 38 | async function instantiate_entity() { 39 | await client.sendRequest(ExtraRequest.GetAllEntities) 40 | .then(ent => { 41 | if (!ent) { 42 | return; 43 | } 44 | let res = ent.map(e => new EntityItem(e.name, e.library)) 45 | return vscode.window.showQuickPick(res) 46 | }) 47 | .then(res => { 48 | return client.sendRequest(ExtraRequest.GetEntityInterface, {name: res.label, library: res.library}) 49 | }) 50 | .then(res => { 51 | let textEditor = vscode.window.activeTextEditor 52 | if (!textEditor) 53 | return 54 | let snippet = '${1:my_inst}: ' + `entity ${res.library}.${res.entity}` 55 | let placeholder_pos = 2 56 | function gen_interfaces(name: string, inters: [{name: string}]): string { 57 | if (!inters.length) 58 | return '' 59 | let isfirst = true 60 | let r = `\n ${name} map (` 61 | for (let g of inters) { 62 | if (isfirst) 63 | isfirst = false 64 | else 65 | r += ',' 66 | r += `\n ${g.name} => \${${placeholder_pos}:${g.name}}` 67 | 68 | placeholder_pos += 1; 69 | } 70 | return r + '\n )' 71 | } 72 | snippet += gen_interfaces('generic', res.generics) 73 | snippet += gen_interfaces('port', res.ports) 74 | snippet += ';' 75 | return textEditor.insertSnippet(new vscode.SnippetString(snippet)) 76 | //textEditor.edit((edit) => { edit.insert(textEditor.selection.active, res.description) }) 77 | }) 78 | } 79 | 80 | export function activate(context: vscode.ExtensionContext) { 81 | let serverPath = "ghdl-ls"; 82 | 83 | // If the extension is launched in debug mode then the debug server options are used 84 | // Otherwise the run options are used 85 | let serverOptions: ServerOptions = { 86 | run: { 87 | command: serverPath, 88 | args: ['-v'] 89 | }, 90 | debug: { 91 | command: serverPath, 92 | args: ['-vvv', '--trace-file=vhdl-ls.trace'] 93 | } 94 | }; 95 | 96 | // Options to control the language client 97 | let clientOptions: LanguageClientOptions = { 98 | // Register the server for vhdl documents 99 | documentSelector: [{ scheme: 'file', language: 'vhdl' }], 100 | synchronize: { 101 | // Notify the server about file changes to '.clientrc files contained in the workspace 102 | fileEvents: vscode.workspace.createFileSystemWatcher('**/.clientrc') 103 | } 104 | }; 105 | 106 | // Force debugging 107 | let debug: boolean = vscode.workspace.getConfiguration().get('vhdl.debugLSP'); 108 | 109 | // Create the language client and start the client. 110 | client = new LanguageClient( 111 | 'vhdlLanguageServer', 112 | 'VHDL Language Server', 113 | serverOptions, 114 | clientOptions, 115 | debug 116 | ); 117 | 118 | // Start the client. This will also launch the server 119 | context.subscriptions.push(client.start()); 120 | 121 | context.subscriptions.push(vscode.commands.registerCommand( 122 | 'ghdl-ls.showallfiles', async () => { 123 | let oc = vscode.window.createOutputChannel('all-files'); 124 | oc.clear(); 125 | const files = await client.sendRequest(ExtraRequest.ShowAllFiles); 126 | if (!files) { 127 | return; 128 | } 129 | for (let f of files) { 130 | oc.append(`${f.fe}: name:${f.name}\n`); 131 | oc.append(` dir:${f.dir}\n`); 132 | if (f.uri) { 133 | oc.append(` uri: ${f.uri}\n`) 134 | } 135 | } 136 | oc.show(); 137 | } 138 | )) 139 | context.subscriptions.push(vscode.commands.registerCommand( 140 | 'ghdl-ls.instantiate-entity', instantiate_entity)) 141 | } 142 | 143 | export function deactivate(): Thenable | undefined { 144 | if (!client) { 145 | return undefined; 146 | } 147 | return client.stop(); 148 | } 149 | -------------------------------------------------------------------------------- /ghdl-ls/tests/004errprj/cmds.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "method": "initialize", 6 | "params": { 7 | "processId": 2, 8 | "rootPath": ".", 9 | "rootUri": "file://.", 10 | "capabilities": { 11 | "workspace": { 12 | "applyEdit": true, 13 | "workspaceEdit": { 14 | "documentChanges": true 15 | }, 16 | "symbol": { 17 | "symbolKind": { 18 | "valueSet": [ 19 | 1, 20 | 2, 21 | 3, 22 | 4, 23 | 5, 24 | 6, 25 | 7, 26 | 8, 27 | 9, 28 | 10, 29 | 11, 30 | 12, 31 | 13, 32 | 14, 33 | 15, 34 | 16, 35 | 17, 36 | 18, 37 | 19, 38 | 20, 39 | 21, 40 | 22, 41 | 23, 42 | 24, 43 | 25, 44 | 26 45 | ] 46 | } 47 | }, 48 | "configuration": true, 49 | "workspaceFolders": true 50 | }, 51 | "textDocument": { 52 | "publishDiagnostics": { 53 | "relatedInformation": true 54 | }, 55 | "synchronization": { 56 | "dynamicRegistration": true, 57 | "willSave": true, 58 | "willSaveWaitUntil": true, 59 | "didSave": true 60 | }, 61 | "completion": { 62 | "dynamicRegistration": true, 63 | "contextSupport": true, 64 | "completionItem": { 65 | "snippetSupport": true, 66 | "commitCharactersSupport": true, 67 | "documentationFormat": [ 68 | "markdown", 69 | "plaintext" 70 | ], 71 | "deprecatedSupport": true 72 | }, 73 | "completionItemKind": { 74 | "valueSet": [ 75 | 1, 76 | 2, 77 | 3, 78 | 4, 79 | 5, 80 | 6, 81 | 7, 82 | 8, 83 | 9, 84 | 10, 85 | 11, 86 | 12, 87 | 13, 88 | 14, 89 | 15, 90 | 16, 91 | 17, 92 | 18, 93 | 19, 94 | 20, 95 | 21, 96 | 22, 97 | 23, 98 | 24, 99 | 25 100 | ] 101 | } 102 | }, 103 | "hover": { 104 | "dynamicRegistration": true, 105 | "contentFormat": [ 106 | "markdown", 107 | "plaintext" 108 | ] 109 | }, 110 | "signatureHelp": { 111 | "dynamicRegistration": true, 112 | "signatureInformation": { 113 | "documentationFormat": [ 114 | "markdown", 115 | "plaintext" 116 | ] 117 | } 118 | }, 119 | "documentSymbol": { 120 | "dynamicRegistration": true, 121 | "symbolKind": { 122 | "valueSet": [ 123 | 1, 124 | 2, 125 | 3, 126 | 4, 127 | 5, 128 | 6, 129 | 7, 130 | 8, 131 | 9, 132 | 10, 133 | 11, 134 | 12, 135 | 13, 136 | 14, 137 | 15, 138 | 16, 139 | 17, 140 | 18, 141 | 19, 142 | 20, 143 | 21, 144 | 22, 145 | 23, 146 | 24, 147 | 25, 148 | 26 149 | ] 150 | } 151 | } 152 | } 153 | }, 154 | "trace": "off", 155 | "workspaceFolders": [ 156 | { 157 | "uri": "file:///.", 158 | "name": "workspacename" 159 | } 160 | ] 161 | } 162 | }, 163 | { 164 | "jsonrpc": "2.0", 165 | "method": "initialized", 166 | "params": {} 167 | }, 168 | { 169 | "jsonrpc": "2.0", 170 | "method": "textDocument/didOpen", 171 | "params": { 172 | "textDocument": { 173 | "uri": "file:///../files/hello.vhdl", 174 | "languageId": "vhdl", 175 | "version": 1, 176 | "text": "\n-- Hello world program\nuse std.textio.all; -- Imports the standard textio package.\n\n-- Defines a design entity, without any ports.\nentity hello_world is\nend hello_world;\n\narchitecture behaviour of hello_world is\nbegin\n process\n variable l : line;\n begin\n write (l, String'(\"Hello world!\"));\n writeline (output, l);\n wait;\n end process;\nend behaviour;\n\n" 177 | } 178 | } 179 | } 180 | ] 181 | -------------------------------------------------------------------------------- /ghdl-ls/tests/003errors/crash1.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "method": "initialize", 6 | "params": { 7 | "processId": 27805, 8 | "rootPath": "/home/tgingold/work/vhdl-language-server/tests/003errors", 9 | "rootUri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors", 10 | "capabilities": { 11 | "workspace": { 12 | "applyEdit": true, 13 | "workspaceEdit": { 14 | "documentChanges": true 15 | }, 16 | "didChangeConfiguration": { 17 | "dynamicRegistration": true 18 | }, 19 | "didChangeWatchedFiles": { 20 | "dynamicRegistration": true 21 | }, 22 | "symbol": { 23 | "dynamicRegistration": true, 24 | "symbolKind": { 25 | "valueSet": [ 26 | 1, 27 | 2, 28 | 3, 29 | 4, 30 | 5, 31 | 6, 32 | 7, 33 | 8, 34 | 9, 35 | 10, 36 | 11, 37 | 12, 38 | 13, 39 | 14, 40 | 15, 41 | 16, 42 | 17, 43 | 18, 44 | 19, 45 | 20, 46 | 21, 47 | 22, 48 | 23, 49 | 24, 50 | 25, 51 | 26 52 | ] 53 | } 54 | }, 55 | "executeCommand": { 56 | "dynamicRegistration": true 57 | }, 58 | "configuration": true, 59 | "workspaceFolders": true 60 | }, 61 | "textDocument": { 62 | "publishDiagnostics": { 63 | "relatedInformation": true 64 | }, 65 | "synchronization": { 66 | "dynamicRegistration": true, 67 | "willSave": true, 68 | "willSaveWaitUntil": true, 69 | "didSave": true 70 | }, 71 | "completion": { 72 | "dynamicRegistration": true, 73 | "contextSupport": true, 74 | "completionItem": { 75 | "snippetSupport": true, 76 | "commitCharactersSupport": true, 77 | "documentationFormat": [ 78 | "markdown", 79 | "plaintext" 80 | ], 81 | "deprecatedSupport": true 82 | }, 83 | "completionItemKind": { 84 | "valueSet": [ 85 | 1, 86 | 2, 87 | 3, 88 | 4, 89 | 5, 90 | 6, 91 | 7, 92 | 8, 93 | 9, 94 | 10, 95 | 11, 96 | 12, 97 | 13, 98 | 14, 99 | 15, 100 | 16, 101 | 17, 102 | 18, 103 | 19, 104 | 20, 105 | 21, 106 | 22, 107 | 23, 108 | 24, 109 | 25 110 | ] 111 | } 112 | }, 113 | "hover": { 114 | "dynamicRegistration": true, 115 | "contentFormat": [ 116 | "markdown", 117 | "plaintext" 118 | ] 119 | }, 120 | "signatureHelp": { 121 | "dynamicRegistration": true, 122 | "signatureInformation": { 123 | "documentationFormat": [ 124 | "markdown", 125 | "plaintext" 126 | ] 127 | } 128 | }, 129 | "definition": { 130 | "dynamicRegistration": true 131 | }, 132 | "references": { 133 | "dynamicRegistration": true 134 | }, 135 | "documentHighlight": { 136 | "dynamicRegistration": true 137 | }, 138 | "documentSymbol": { 139 | "dynamicRegistration": true, 140 | "symbolKind": { 141 | "valueSet": [ 142 | 1, 143 | 2, 144 | 3, 145 | 4, 146 | 5, 147 | 6, 148 | 7, 149 | 8, 150 | 9, 151 | 10, 152 | 11, 153 | 12, 154 | 13, 155 | 14, 156 | 15, 157 | 16, 158 | 17, 159 | 18, 160 | 19, 161 | 20, 162 | 21, 163 | 22, 164 | 23, 165 | 24, 166 | 25, 167 | 26 168 | ] 169 | } 170 | }, 171 | "codeAction": { 172 | "dynamicRegistration": true 173 | }, 174 | "codeLens": { 175 | "dynamicRegistration": true 176 | }, 177 | "formatting": { 178 | "dynamicRegistration": true 179 | }, 180 | "rangeFormatting": { 181 | "dynamicRegistration": true 182 | }, 183 | "onTypeFormatting": { 184 | "dynamicRegistration": true 185 | }, 186 | "rename": { 187 | "dynamicRegistration": true 188 | }, 189 | "documentLink": { 190 | "dynamicRegistration": true 191 | }, 192 | "typeDefinition": { 193 | "dynamicRegistration": true 194 | }, 195 | "implementation": { 196 | "dynamicRegistration": true 197 | }, 198 | "colorProvider": { 199 | "dynamicRegistration": true 200 | } 201 | } 202 | }, 203 | "trace": "off", 204 | "workspaceFolders": [ 205 | { 206 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors", 207 | "name": "003errors" 208 | } 209 | ] 210 | } 211 | }, 212 | { 213 | "jsonrpc": "2.0", 214 | "method": "initialized", 215 | "params": {} 216 | }, 217 | { 218 | "jsonrpc": "2.0", 219 | "method": "textDocument/didOpen", 220 | "params": { 221 | "textDocument": { 222 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors/tc.vhdl", 223 | "languageId": "vhdl", 224 | "version": 74, 225 | "text": "library ieee;\nuse ieee.std_logic_1164.all;\nuse ieee.std_logic_unsigned.all;\n\nentity \n" 226 | } 227 | } 228 | } 229 | ] 230 | -------------------------------------------------------------------------------- /ghdl-ls/tests/001simple/cmds.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "method": "initialize", 6 | "params": { 7 | "processId": 2, 8 | "rootPath": ".", 9 | "rootUri": "file:///.", 10 | "capabilities": { 11 | "workspace": { 12 | "applyEdit": true, 13 | "workspaceEdit": { 14 | "documentChanges": true 15 | }, 16 | "didChangeConfiguration": { 17 | "dynamicRegistration": true 18 | }, 19 | "didChangeWatchedFiles": { 20 | "dynamicRegistration": true 21 | }, 22 | "symbol": { 23 | "dynamicRegistration": true, 24 | "symbolKind": { 25 | "valueSet": [ 26 | 1, 27 | 2, 28 | 3, 29 | 4, 30 | 5, 31 | 6, 32 | 7, 33 | 8, 34 | 9, 35 | 10, 36 | 11, 37 | 12, 38 | 13, 39 | 14, 40 | 15, 41 | 16, 42 | 17, 43 | 18, 44 | 19, 45 | 20, 46 | 21, 47 | 22, 48 | 23, 49 | 24, 50 | 25, 51 | 26 52 | ] 53 | } 54 | }, 55 | "executeCommand": { 56 | "dynamicRegistration": true 57 | }, 58 | "configuration": true, 59 | "workspaceFolders": true 60 | }, 61 | "textDocument": { 62 | "publishDiagnostics": { 63 | "relatedInformation": true 64 | }, 65 | "synchronization": { 66 | "dynamicRegistration": true, 67 | "willSave": true, 68 | "willSaveWaitUntil": true, 69 | "didSave": true 70 | }, 71 | "completion": { 72 | "dynamicRegistration": true, 73 | "contextSupport": true, 74 | "completionItem": { 75 | "snippetSupport": true, 76 | "commitCharactersSupport": true, 77 | "documentationFormat": [ 78 | "markdown", 79 | "plaintext" 80 | ], 81 | "deprecatedSupport": true 82 | }, 83 | "completionItemKind": { 84 | "valueSet": [ 85 | 1, 86 | 2, 87 | 3, 88 | 4, 89 | 5, 90 | 6, 91 | 7, 92 | 8, 93 | 9, 94 | 10, 95 | 11, 96 | 12, 97 | 13, 98 | 14, 99 | 15, 100 | 16, 101 | 17, 102 | 18, 103 | 19, 104 | 20, 105 | 21, 106 | 22, 107 | 23, 108 | 24, 109 | 25 110 | ] 111 | } 112 | }, 113 | "hover": { 114 | "dynamicRegistration": true, 115 | "contentFormat": [ 116 | "markdown", 117 | "plaintext" 118 | ] 119 | }, 120 | "signatureHelp": { 121 | "dynamicRegistration": true, 122 | "signatureInformation": { 123 | "documentationFormat": [ 124 | "markdown", 125 | "plaintext" 126 | ] 127 | } 128 | }, 129 | "definition": { 130 | "dynamicRegistration": true 131 | }, 132 | "references": { 133 | "dynamicRegistration": true 134 | }, 135 | "documentHighlight": { 136 | "dynamicRegistration": true 137 | }, 138 | "documentSymbol": { 139 | "dynamicRegistration": true, 140 | "symbolKind": { 141 | "valueSet": [ 142 | 1, 143 | 2, 144 | 3, 145 | 4, 146 | 5, 147 | 6, 148 | 7, 149 | 8, 150 | 9, 151 | 10, 152 | 11, 153 | 12, 154 | 13, 155 | 14, 156 | 15, 157 | 16, 158 | 17, 159 | 18, 160 | 19, 161 | 20, 162 | 21, 163 | 22, 164 | 23, 165 | 24, 166 | 25, 167 | 26 168 | ] 169 | } 170 | }, 171 | "codeAction": { 172 | "dynamicRegistration": true 173 | }, 174 | "codeLens": { 175 | "dynamicRegistration": true 176 | }, 177 | "formatting": { 178 | "dynamicRegistration": true 179 | }, 180 | "rangeFormatting": { 181 | "dynamicRegistration": true 182 | }, 183 | "onTypeFormatting": { 184 | "dynamicRegistration": true 185 | }, 186 | "rename": { 187 | "dynamicRegistration": true 188 | }, 189 | "documentLink": { 190 | "dynamicRegistration": true 191 | }, 192 | "typeDefinition": { 193 | "dynamicRegistration": true 194 | }, 195 | "implementation": { 196 | "dynamicRegistration": true 197 | }, 198 | "colorProvider": { 199 | "dynamicRegistration": true 200 | } 201 | } 202 | }, 203 | "trace": "off", 204 | "workspaceFolders": [ 205 | { 206 | "uri": "file:///.", 207 | "name": "001simple" 208 | } 209 | ] 210 | } 211 | }, 212 | { 213 | "jsonrpc": "2.0", 214 | "method": "initialized", 215 | "params": {} 216 | }, 217 | { 218 | "jsonrpc": "2.0", 219 | "method": "textDocument/didOpen", 220 | "params": { 221 | "textDocument": { 222 | "uri": "file:///../files/hello.vhdl", 223 | "languageId": "vhdl", 224 | "version": 1, 225 | "text": "\n-- Hello world program\nuse std.textio.all; -- Imports the standard textio package.\n\n-- Defines a design entity, without any ports.\nentity hello_world is\nend hello_world;\n\narchitecture behaviour of hello_world is\nbegin\n process\n variable l : line;\n begin\n write (l, String'(\"Hello world!\"));\n writeline (output, l);\n wait;\n end process;\nend behaviour;\n\n" 226 | } 227 | } 228 | } 229 | ] 230 | -------------------------------------------------------------------------------- /ghdl-ls/tests/005create/cmds.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "method": "initialize", 6 | "params": { 7 | "processId": 6576, 8 | "rootPath": ".", 9 | "rootUri": "file://.", 10 | "capabilities": { 11 | "workspace": { 12 | "applyEdit": true, 13 | "workspaceEdit": { 14 | "documentChanges": true 15 | }, 16 | "didChangeConfiguration": { 17 | "dynamicRegistration": true 18 | }, 19 | "didChangeWatchedFiles": { 20 | "dynamicRegistration": true 21 | }, 22 | "symbol": { 23 | "dynamicRegistration": true, 24 | "symbolKind": { 25 | "valueSet": [ 26 | 1, 27 | 2, 28 | 3, 29 | 4, 30 | 5, 31 | 6, 32 | 7, 33 | 8, 34 | 9, 35 | 10, 36 | 11, 37 | 12, 38 | 13, 39 | 14, 40 | 15, 41 | 16, 42 | 17, 43 | 18, 44 | 19, 45 | 20, 46 | 21, 47 | 22, 48 | 23, 49 | 24, 50 | 25, 51 | 26 52 | ] 53 | } 54 | }, 55 | "executeCommand": { 56 | "dynamicRegistration": true 57 | }, 58 | "configuration": true, 59 | "workspaceFolders": true 60 | }, 61 | "textDocument": { 62 | "publishDiagnostics": { 63 | "relatedInformation": true 64 | }, 65 | "synchronization": { 66 | "dynamicRegistration": true, 67 | "willSave": true, 68 | "willSaveWaitUntil": true, 69 | "didSave": true 70 | }, 71 | "completion": { 72 | "dynamicRegistration": true, 73 | "contextSupport": true, 74 | "completionItem": { 75 | "snippetSupport": true, 76 | "commitCharactersSupport": true, 77 | "documentationFormat": [ 78 | "markdown", 79 | "plaintext" 80 | ], 81 | "deprecatedSupport": true, 82 | "preselectSupport": true 83 | }, 84 | "completionItemKind": { 85 | "valueSet": [ 86 | 1, 87 | 2, 88 | 3, 89 | 4, 90 | 5, 91 | 6, 92 | 7, 93 | 8, 94 | 9, 95 | 10, 96 | 11, 97 | 12, 98 | 13, 99 | 14, 100 | 15, 101 | 16, 102 | 17, 103 | 18, 104 | 19, 105 | 20, 106 | 21, 107 | 22, 108 | 23, 109 | 24, 110 | 25 111 | ] 112 | } 113 | }, 114 | "hover": { 115 | "dynamicRegistration": true, 116 | "contentFormat": [ 117 | "markdown", 118 | "plaintext" 119 | ] 120 | }, 121 | "signatureHelp": { 122 | "dynamicRegistration": true, 123 | "signatureInformation": { 124 | "documentationFormat": [ 125 | "markdown", 126 | "plaintext" 127 | ] 128 | } 129 | }, 130 | "definition": { 131 | "dynamicRegistration": true 132 | }, 133 | "references": { 134 | "dynamicRegistration": true 135 | }, 136 | "documentHighlight": { 137 | "dynamicRegistration": true 138 | }, 139 | "documentSymbol": { 140 | "dynamicRegistration": true, 141 | "symbolKind": { 142 | "valueSet": [ 143 | 1, 144 | 2, 145 | 3, 146 | 4, 147 | 5, 148 | 6, 149 | 7, 150 | 8, 151 | 9, 152 | 10, 153 | 11, 154 | 12, 155 | 13, 156 | 14, 157 | 15, 158 | 16, 159 | 17, 160 | 18, 161 | 19, 162 | 20, 163 | 21, 164 | 22, 165 | 23, 166 | 24, 167 | 25, 168 | 26 169 | ] 170 | }, 171 | "hierarchicalDocumentSymbolSupport": true 172 | }, 173 | "codeAction": { 174 | "dynamicRegistration": true, 175 | "codeActionLiteralSupport": { 176 | "codeActionKind": { 177 | "valueSet": [ 178 | "", 179 | "quickfix", 180 | "refactor", 181 | "refactor.extract", 182 | "refactor.inline", 183 | "refactor.rewrite", 184 | "source", 185 | "source.organizeImports" 186 | ] 187 | } 188 | } 189 | }, 190 | "codeLens": { 191 | "dynamicRegistration": true 192 | }, 193 | "formatting": { 194 | "dynamicRegistration": true 195 | }, 196 | "rangeFormatting": { 197 | "dynamicRegistration": true 198 | }, 199 | "onTypeFormatting": { 200 | "dynamicRegistration": true 201 | }, 202 | "rename": { 203 | "dynamicRegistration": true 204 | }, 205 | "documentLink": { 206 | "dynamicRegistration": true 207 | }, 208 | "typeDefinition": { 209 | "dynamicRegistration": true 210 | }, 211 | "implementation": { 212 | "dynamicRegistration": true 213 | }, 214 | "colorProvider": { 215 | "dynamicRegistration": true 216 | }, 217 | "foldingRange": { 218 | "dynamicRegistration": true, 219 | "rangeLimit": 5000, 220 | "lineFoldingOnly": true 221 | } 222 | } 223 | }, 224 | "trace": "off", 225 | "workspaceFolders": [ 226 | { 227 | "uri": "file://.", 228 | "name": "folder" 229 | } 230 | ] 231 | } 232 | }, 233 | { 234 | "jsonrpc": "2.0", 235 | "method": "initialized", 236 | "params": {} 237 | }, 238 | { 239 | "jsonrpc": "2.0", 240 | "id": 7, 241 | "method": "textDocument/documentSymbol", 242 | "params": { 243 | "textDocument": { 244 | "uri": "file://../files/hello.vhdl" 245 | } 246 | } 247 | } 248 | ] 249 | -------------------------------------------------------------------------------- /ghdl-ls/tests/008errnofile/cmds.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "method": "initialize", 6 | "params": { 7 | "processId": 19954, 8 | "rootPath": "/home/tgingold/work/ghdl-language-server/ghdl-ls/tests/008errnofile", 9 | "rootUri": "file:///home/tgingold/work/ghdl-language-server/ghdl-ls/tests/008errnofile", 10 | "capabilities": { 11 | "workspace": { 12 | "applyEdit": true, 13 | "workspaceEdit": { 14 | "documentChanges": true 15 | }, 16 | "didChangeConfiguration": { 17 | "dynamicRegistration": true 18 | }, 19 | "didChangeWatchedFiles": { 20 | "dynamicRegistration": true 21 | }, 22 | "symbol": { 23 | "dynamicRegistration": true, 24 | "symbolKind": { 25 | "valueSet": [ 26 | 1, 27 | 2, 28 | 3, 29 | 4, 30 | 5, 31 | 6, 32 | 7, 33 | 8, 34 | 9, 35 | 10, 36 | 11, 37 | 12, 38 | 13, 39 | 14, 40 | 15, 41 | 16, 42 | 17, 43 | 18, 44 | 19, 45 | 20, 46 | 21, 47 | 22, 48 | 23, 49 | 24, 50 | 25, 51 | 26 52 | ] 53 | } 54 | }, 55 | "executeCommand": { 56 | "dynamicRegistration": true 57 | }, 58 | "configuration": true, 59 | "workspaceFolders": true 60 | }, 61 | "textDocument": { 62 | "publishDiagnostics": { 63 | "relatedInformation": true 64 | }, 65 | "synchronization": { 66 | "dynamicRegistration": true, 67 | "willSave": true, 68 | "willSaveWaitUntil": true, 69 | "didSave": true 70 | }, 71 | "completion": { 72 | "dynamicRegistration": true, 73 | "contextSupport": true, 74 | "completionItem": { 75 | "snippetSupport": true, 76 | "commitCharactersSupport": true, 77 | "documentationFormat": [ 78 | "markdown", 79 | "plaintext" 80 | ], 81 | "deprecatedSupport": true, 82 | "preselectSupport": true 83 | }, 84 | "completionItemKind": { 85 | "valueSet": [ 86 | 1, 87 | 2, 88 | 3, 89 | 4, 90 | 5, 91 | 6, 92 | 7, 93 | 8, 94 | 9, 95 | 10, 96 | 11, 97 | 12, 98 | 13, 99 | 14, 100 | 15, 101 | 16, 102 | 17, 103 | 18, 104 | 19, 105 | 20, 106 | 21, 107 | 22, 108 | 23, 109 | 24, 110 | 25 111 | ] 112 | } 113 | }, 114 | "hover": { 115 | "dynamicRegistration": true, 116 | "contentFormat": [ 117 | "markdown", 118 | "plaintext" 119 | ] 120 | }, 121 | "signatureHelp": { 122 | "dynamicRegistration": true, 123 | "signatureInformation": { 124 | "documentationFormat": [ 125 | "markdown", 126 | "plaintext" 127 | ] 128 | } 129 | }, 130 | "definition": { 131 | "dynamicRegistration": true 132 | }, 133 | "references": { 134 | "dynamicRegistration": true 135 | }, 136 | "documentHighlight": { 137 | "dynamicRegistration": true 138 | }, 139 | "documentSymbol": { 140 | "dynamicRegistration": true, 141 | "symbolKind": { 142 | "valueSet": [ 143 | 1, 144 | 2, 145 | 3, 146 | 4, 147 | 5, 148 | 6, 149 | 7, 150 | 8, 151 | 9, 152 | 10, 153 | 11, 154 | 12, 155 | 13, 156 | 14, 157 | 15, 158 | 16, 159 | 17, 160 | 18, 161 | 19, 162 | 20, 163 | 21, 164 | 22, 165 | 23, 166 | 24, 167 | 25, 168 | 26 169 | ] 170 | }, 171 | "hierarchicalDocumentSymbolSupport": true 172 | }, 173 | "codeAction": { 174 | "dynamicRegistration": true, 175 | "codeActionLiteralSupport": { 176 | "codeActionKind": { 177 | "valueSet": [ 178 | "", 179 | "quickfix", 180 | "refactor", 181 | "refactor.extract", 182 | "refactor.inline", 183 | "refactor.rewrite", 184 | "source", 185 | "source.organizeImports" 186 | ] 187 | } 188 | } 189 | }, 190 | "codeLens": { 191 | "dynamicRegistration": true 192 | }, 193 | "formatting": { 194 | "dynamicRegistration": true 195 | }, 196 | "rangeFormatting": { 197 | "dynamicRegistration": true 198 | }, 199 | "onTypeFormatting": { 200 | "dynamicRegistration": true 201 | }, 202 | "rename": { 203 | "dynamicRegistration": true 204 | }, 205 | "documentLink": { 206 | "dynamicRegistration": true 207 | }, 208 | "typeDefinition": { 209 | "dynamicRegistration": true 210 | }, 211 | "implementation": { 212 | "dynamicRegistration": true 213 | }, 214 | "colorProvider": { 215 | "dynamicRegistration": true 216 | }, 217 | "foldingRange": { 218 | "dynamicRegistration": true, 219 | "rangeLimit": 5000, 220 | "lineFoldingOnly": true 221 | } 222 | } 223 | }, 224 | "trace": "off", 225 | "workspaceFolders": [ 226 | { 227 | "uri": "file://.", 228 | "name": "008errnofile" 229 | } 230 | ] 231 | } 232 | }, 233 | { 234 | "jsonrpc": "2.0", 235 | "method": "initialized", 236 | "params": {} 237 | }, 238 | { 239 | "jsonrpc": "2.0", 240 | "id": 2, 241 | "method": "shutdown", 242 | "params": null 243 | } 244 | ] 245 | -------------------------------------------------------------------------------- /ghdl-ls/tests/003errors/crash2.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "method": "initialize", 6 | "params": { 7 | "processId": 30387, 8 | "rootPath": "/home/tgingold/work/vhdl-language-server/tests/003errors", 9 | "rootUri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors", 10 | "capabilities": { 11 | "workspace": { 12 | "applyEdit": true, 13 | "workspaceEdit": { 14 | "documentChanges": true 15 | }, 16 | "didChangeConfiguration": { 17 | "dynamicRegistration": true 18 | }, 19 | "didChangeWatchedFiles": { 20 | "dynamicRegistration": true 21 | }, 22 | "symbol": { 23 | "dynamicRegistration": true, 24 | "symbolKind": { 25 | "valueSet": [ 26 | 1, 27 | 2, 28 | 3, 29 | 4, 30 | 5, 31 | 6, 32 | 7, 33 | 8, 34 | 9, 35 | 10, 36 | 11, 37 | 12, 38 | 13, 39 | 14, 40 | 15, 41 | 16, 42 | 17, 43 | 18, 44 | 19, 45 | 20, 46 | 21, 47 | 22, 48 | 23, 49 | 24, 50 | 25, 51 | 26 52 | ] 53 | } 54 | }, 55 | "executeCommand": { 56 | "dynamicRegistration": true 57 | }, 58 | "configuration": true, 59 | "workspaceFolders": true 60 | }, 61 | "textDocument": { 62 | "publishDiagnostics": { 63 | "relatedInformation": true 64 | }, 65 | "synchronization": { 66 | "dynamicRegistration": true, 67 | "willSave": true, 68 | "willSaveWaitUntil": true, 69 | "didSave": true 70 | }, 71 | "completion": { 72 | "dynamicRegistration": true, 73 | "contextSupport": true, 74 | "completionItem": { 75 | "snippetSupport": true, 76 | "commitCharactersSupport": true, 77 | "documentationFormat": [ 78 | "markdown", 79 | "plaintext" 80 | ], 81 | "deprecatedSupport": true 82 | }, 83 | "completionItemKind": { 84 | "valueSet": [ 85 | 1, 86 | 2, 87 | 3, 88 | 4, 89 | 5, 90 | 6, 91 | 7, 92 | 8, 93 | 9, 94 | 10, 95 | 11, 96 | 12, 97 | 13, 98 | 14, 99 | 15, 100 | 16, 101 | 17, 102 | 18, 103 | 19, 104 | 20, 105 | 21, 106 | 22, 107 | 23, 108 | 24, 109 | 25 110 | ] 111 | } 112 | }, 113 | "hover": { 114 | "dynamicRegistration": true, 115 | "contentFormat": [ 116 | "markdown", 117 | "plaintext" 118 | ] 119 | }, 120 | "signatureHelp": { 121 | "dynamicRegistration": true, 122 | "signatureInformation": { 123 | "documentationFormat": [ 124 | "markdown", 125 | "plaintext" 126 | ] 127 | } 128 | }, 129 | "definition": { 130 | "dynamicRegistration": true 131 | }, 132 | "references": { 133 | "dynamicRegistration": true 134 | }, 135 | "documentHighlight": { 136 | "dynamicRegistration": true 137 | }, 138 | "documentSymbol": { 139 | "dynamicRegistration": true, 140 | "symbolKind": { 141 | "valueSet": [ 142 | 1, 143 | 2, 144 | 3, 145 | 4, 146 | 5, 147 | 6, 148 | 7, 149 | 8, 150 | 9, 151 | 10, 152 | 11, 153 | 12, 154 | 13, 155 | 14, 156 | 15, 157 | 16, 158 | 17, 159 | 18, 160 | 19, 161 | 20, 162 | 21, 163 | 22, 164 | 23, 165 | 24, 166 | 25, 167 | 26 168 | ] 169 | } 170 | }, 171 | "codeAction": { 172 | "dynamicRegistration": true 173 | }, 174 | "codeLens": { 175 | "dynamicRegistration": true 176 | }, 177 | "formatting": { 178 | "dynamicRegistration": true 179 | }, 180 | "rangeFormatting": { 181 | "dynamicRegistration": true 182 | }, 183 | "onTypeFormatting": { 184 | "dynamicRegistration": true 185 | }, 186 | "rename": { 187 | "dynamicRegistration": true 188 | }, 189 | "documentLink": { 190 | "dynamicRegistration": true 191 | }, 192 | "typeDefinition": { 193 | "dynamicRegistration": true 194 | }, 195 | "implementation": { 196 | "dynamicRegistration": true 197 | }, 198 | "colorProvider": { 199 | "dynamicRegistration": true 200 | } 201 | } 202 | }, 203 | "trace": "off", 204 | "workspaceFolders": [ 205 | { 206 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors", 207 | "name": "003errors" 208 | } 209 | ] 210 | } 211 | }, 212 | { 213 | "jsonrpc": "2.0", 214 | "method": "initialized", 215 | "params": {} 216 | }, 217 | { 218 | "jsonrpc": "2.0", 219 | "method": "textDocument/didOpen", 220 | "params": { 221 | "textDocument": { 222 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors/tc.vhdl", 223 | "languageId": "vhdl", 224 | "version": 172, 225 | "text": "library ieee;\nuse ieee.std_logic_1164.all;\nuse ieee.std_logic_unsigned.all;\n\nentity tb is\nend tb;\n\narchitecture behav of tb is\n signal s : std_logic_vector(7 downto 0);\nbegin\n assert s != x\"73\";\n end process;\nend behav; \n" 226 | } 227 | } 228 | }, 229 | { 230 | "jsonrpc": "2.0", 231 | "id": 1, 232 | "method": "textDocument/documentSymbol", 233 | "params": { 234 | "textDocument": { 235 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors/tc.vhdl" 236 | } 237 | } 238 | } 239 | ] 240 | -------------------------------------------------------------------------------- /ghdl-ls/tests/003errors/cmds.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "method": "initialize", 6 | "params": { 7 | "processId": 5529, 8 | "rootPath": "/home/tgingold/work/vhdl-language-server/tests/003errors", 9 | "rootUri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors", 10 | "capabilities": { 11 | "workspace": { 12 | "applyEdit": true, 13 | "workspaceEdit": { 14 | "documentChanges": true 15 | }, 16 | "didChangeConfiguration": { 17 | "dynamicRegistration": true 18 | }, 19 | "didChangeWatchedFiles": { 20 | "dynamicRegistration": true 21 | }, 22 | "symbol": { 23 | "dynamicRegistration": true, 24 | "symbolKind": { 25 | "valueSet": [ 26 | 1, 27 | 2, 28 | 3, 29 | 4, 30 | 5, 31 | 6, 32 | 7, 33 | 8, 34 | 9, 35 | 10, 36 | 11, 37 | 12, 38 | 13, 39 | 14, 40 | 15, 41 | 16, 42 | 17, 43 | 18, 44 | 19, 45 | 20, 46 | 21, 47 | 22, 48 | 23, 49 | 24, 50 | 25, 51 | 26 52 | ] 53 | } 54 | }, 55 | "executeCommand": { 56 | "dynamicRegistration": true 57 | }, 58 | "configuration": true, 59 | "workspaceFolders": true 60 | }, 61 | "textDocument": { 62 | "publishDiagnostics": { 63 | "relatedInformation": true 64 | }, 65 | "synchronization": { 66 | "dynamicRegistration": true, 67 | "willSave": true, 68 | "willSaveWaitUntil": true, 69 | "didSave": true 70 | }, 71 | "completion": { 72 | "dynamicRegistration": true, 73 | "contextSupport": true, 74 | "completionItem": { 75 | "snippetSupport": true, 76 | "commitCharactersSupport": true, 77 | "documentationFormat": [ 78 | "markdown", 79 | "plaintext" 80 | ], 81 | "deprecatedSupport": true 82 | }, 83 | "completionItemKind": { 84 | "valueSet": [ 85 | 1, 86 | 2, 87 | 3, 88 | 4, 89 | 5, 90 | 6, 91 | 7, 92 | 8, 93 | 9, 94 | 10, 95 | 11, 96 | 12, 97 | 13, 98 | 14, 99 | 15, 100 | 16, 101 | 17, 102 | 18, 103 | 19, 104 | 20, 105 | 21, 106 | 22, 107 | 23, 108 | 24, 109 | 25 110 | ] 111 | } 112 | }, 113 | "hover": { 114 | "dynamicRegistration": true, 115 | "contentFormat": [ 116 | "markdown", 117 | "plaintext" 118 | ] 119 | }, 120 | "signatureHelp": { 121 | "dynamicRegistration": true, 122 | "signatureInformation": { 123 | "documentationFormat": [ 124 | "markdown", 125 | "plaintext" 126 | ] 127 | } 128 | }, 129 | "definition": { 130 | "dynamicRegistration": true 131 | }, 132 | "references": { 133 | "dynamicRegistration": true 134 | }, 135 | "documentHighlight": { 136 | "dynamicRegistration": true 137 | }, 138 | "documentSymbol": { 139 | "dynamicRegistration": true, 140 | "symbolKind": { 141 | "valueSet": [ 142 | 1, 143 | 2, 144 | 3, 145 | 4, 146 | 5, 147 | 6, 148 | 7, 149 | 8, 150 | 9, 151 | 10, 152 | 11, 153 | 12, 154 | 13, 155 | 14, 156 | 15, 157 | 16, 158 | 17, 159 | 18, 160 | 19, 161 | 20, 162 | 21, 163 | 22, 164 | 23, 165 | 24, 166 | 25, 167 | 26 168 | ] 169 | } 170 | }, 171 | "codeAction": { 172 | "dynamicRegistration": true 173 | }, 174 | "codeLens": { 175 | "dynamicRegistration": true 176 | }, 177 | "formatting": { 178 | "dynamicRegistration": true 179 | }, 180 | "rangeFormatting": { 181 | "dynamicRegistration": true 182 | }, 183 | "onTypeFormatting": { 184 | "dynamicRegistration": true 185 | }, 186 | "rename": { 187 | "dynamicRegistration": true 188 | }, 189 | "documentLink": { 190 | "dynamicRegistration": true 191 | }, 192 | "typeDefinition": { 193 | "dynamicRegistration": true 194 | }, 195 | "implementation": { 196 | "dynamicRegistration": true 197 | }, 198 | "colorProvider": { 199 | "dynamicRegistration": true 200 | } 201 | } 202 | }, 203 | "trace": "off", 204 | "workspaceFolders": [ 205 | { 206 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors", 207 | "name": "003errors" 208 | } 209 | ] 210 | } 211 | }, 212 | { 213 | "jsonrpc": "2.0", 214 | "method": "initialized", 215 | "params": {} 216 | }, 217 | { 218 | "jsonrpc": "2.0", 219 | "method": "textDocument/didOpen", 220 | "params": { 221 | "textDocument": { 222 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors/tc.vhdl", 223 | "languageId": "vhdl", 224 | "version": 1, 225 | "text": "library ieee;\nuse ieee.std_logic_1164.all;\nuse ieee.std_logic_unsigned.all;\n\nentity tb is\nend tb;\n\narchitecture behav of tb is\n signal s : std_logic_vector(7 downto 0);\nbegin\n assert s /= x\"73\";\nend behav; \n" 226 | } 227 | } 228 | }, 229 | { 230 | "jsonrpc": "2.0", 231 | "id": 1, 232 | "method": "textDocument/documentSymbol", 233 | "params": { 234 | "textDocument": { 235 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/003errors/tc.vhdl" 236 | } 237 | } 238 | }, 239 | { 240 | "jsonrpc": "2.0", 241 | "id": 2, 242 | "method": "shutdown", 243 | "params": null 244 | } 245 | ] 246 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | A [Language Server Protocol (LSP)](https://en.wikipedia.org/wiki/Language_Server_Protocol) server for VHDL based on [GHDL](https://github.com/ghdl/ghdl), and a client for Visual Studio Code (VSC). The LSP server can be integrated in other text editors or IDES, such as, Vim, Emacs, Atom or Theia. Contributions are welcome! 2 | 3 | ## Requirements 4 | 5 | - Build and install [GHDL](https://github.com/ghdl/ghdl). Build of the shared library `libghdl` is enabled by default. 6 | - Install `ghdl-ls` from GHDL. For example: 7 | 8 | ``` bash 9 | pip3 install . 10 | ``` 11 | 12 | > HINT: 13 | > - To install for development: `pip install -e .` 14 | > - Add `--user` to install in your home directory. 15 | 16 | ## Pre-built packages 17 | 18 | Some GNU/Linux distributions provide pre-built packages. 19 | 20 | - On [Guix](https://guix.gnu.org/), the [guix-science](https://codeberg.org/guix-science/guix-science) channel provides binaries for both ghdl and ghdl-lsp 21 | 22 | ```sh 23 | guix install ghdl-lsp # pulls ghdl-llvm 24 | 25 | ``` 26 | 27 | ## Usage 28 | 29 | The executable is named `ghdl-ls`. It uses stdin/stdout to communicate with 30 | its client. 31 | 32 | The language server will require a project file named `hdl-prj.json` which will provide all required options to run GHDL analysis : 33 | - All options to pass to `ghdl -a` (the analysis step) 34 | - Your project fileset 35 | 36 | An example of `hdl-prj.json` file could be : 37 | ```json 38 | { 39 | "options": { 40 | "ghdl_analysis": [ 41 | "--workdir=work", 42 | "--ieee=synopsys", 43 | "-fexplicit" 44 | ] 45 | }, 46 | "files": [ 47 | { "file": "rtl/core.vhd", "language": "vhdl" }, 48 | { "file": "assembly/core_fpga.vhd", "language": "vhdl" }, 49 | { "file": "sim/tb_core.vhd", "library" : "sim", "language": "vhdl" } 50 | ] 51 | } 52 | ``` 53 | 54 | A library can be specified for a file and the default is `work`. The 55 | only `language` supported is `vhdl` (which is the default), a file 56 | with a unknown language is simply ignored. 57 | 58 | The json file must be ASCII or UTF-8 encoded. 59 | 60 | You will find all valid options in the GHDL documentation in the [options to invoke GHDL](https://ghdl.readthedocs.io/en/latest/using/InvokingGHDL.html#options). 61 | 62 | # Visual Studio Code (VSC) Extension 63 | 64 | Subdir `vscode-client` contains the sources of a VSC Extension; a LSP client that allows to have ghdl-ls integrated in VSC. 65 | 66 | ## Build 67 | 68 | > HINT: On debian, installing `npm` from repositories (`sudo apt install npm`) will probably install an outdated version of npm with regard to Node.js version. This will make any npm install operation fail. 69 | > 70 | > Therefore, you will need to upgrade `npm` using `sudo npm install -g npm@latest` and restart your terminal before going further 71 | 72 | - Install `npm` or `yarn`. 73 | - Install `vsce` through `npm install -g vsce` or `yarn global add vsce`. 74 | - Get the sources of the `vscode-client`. For example: `curl -fsSL https://codeload.github.com/ghdl/ghdl-language-server/tar.gz/master | tar xzf - --strip-components=1 ghdl-language-server-master/vscode-client` 75 | - The first time, execute `npm install` or `yarn` to install package dependencies. 76 | - Execute `vsce package` or `vsce package --yarn`. 77 | - The output is a file named `vhdl-lsp-*.vsix`. 78 | 79 | ## Install 80 | 81 | - Through the command-line: `code --install-extension vhdl-lsp-*.vsix`. 82 | - Graphically through [Install from VSIX...](https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix). 83 | 84 | > HINT: 85 | > 86 | > If you are using [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview) you also need to install the extension on the VS Code server. As indicated in [VS Code Remote extension](https://code.visualstudio.com/api/advanced-topics/remote-extensions#installing-a-development-version-of-your-extension), you need to use the `Install from VSIX...` command available in the Extenion view `More actions (...)` menu (click on `...`). 87 | 88 | > HINT: 89 | > 90 | > VSIX files are actually ZIP files. Hence, it is possible to install an extension by extracting the content to a suitable location. This is useful in the context of the [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview) feature; which is a [NOT Open Source](https://code.visualstudio.com/docs/remote/faq#_why-arent-the-remote-development-extensions-or-their-components-open-source) component that is *"installed and updated automatically by VS Code when it connects to an endpoint"* and which cannot be used with any other client (see [Can VS Code Server be installed or used on its own?](https://code.visualstudio.com/docs/remote/faq#_can-vs-code-server-be-installed-or-used-on-its-own)). 91 | > 92 | > In order to pre-install a VSIX extension in a remote host or a docker image/container where VSC is not available, just extract it to `$HOME/.vscode-server/extensions`. For example: 93 | > 94 | > ``` bash 95 | > cd $(dirname $0) 96 | > vsix_file="$(ls vhdl-lsp-*.vsix)" 97 | > vsc_exts="$HOME/.vscode-server/extensions" 98 | > mkdir -p $vsc_exts 99 | > unzip "$vsix_file" 100 | > rm [Content_Types].xml 101 | > mv extension.vsixmanifest extension/.vsixmanifest 102 | > mv extension "$vsc_exts/tgingold.${vsix_file%.*}" 103 | > ``` 104 | 105 | ## Issues and bug reports 106 | 107 | In case of crash of ghdl-ls, you should set the `vhdl.debugLSP` setting to true. 108 | 109 | This makes `ghdl-ls` write logs (`vhdl-ls.log`, `vhdl-ls.trace.in` and `vhdl-ls.trace.out`) which should be attached to the issue. 110 | 111 | # Ready-to-use Docker images 112 | 113 | In the Continuous Integration (CI) pipeline of [ghdl/docker](https://github.com/ghdl/docker), some images are generated which include `ghdl-ls` and `vsce-client`. These are uploaded to [ghdl/ext:*](https://hub.docker.com/r/ghdl/ext/tags) at [hub.docker.com/u/ghdl](https://cloud.docker.com/u/ghdl/repository/list). 114 | 115 | - `ghdl/ext:ls-debian`: based on Debian Buster, it contains Python 3, GHDL, libghdl-py, ghdl-ls and vscode-client. 116 | - `ghdl/ext:latest`: based on `ls-debian`, it contains VUnit and GtkWave too. 117 | - `ghdl/ext:ls-ubuntu`: based on Ubuntu Bionic, it contains the same tools as `ls-debian`. 118 | 119 | All of these can be used with VSC's 'Remote - Containers' Extension as follows: 120 | 121 | - Start a container: `docker run --name ghdl-ls --rm -d ghdl/ext:latest bash -c "/opt/ghdl/install_vsix.sh && tail -f /dev/null"` 122 | - In VSC, go to `Remote-Containers: Attach to Running Container...` and select the container named `ghdl-ls`. 123 | - Alternatively, if you have the 'Docker' extension installed, just go to the list of running containers and right-click on it. 124 | - Wait until the new window is loaded and have fun! 125 | 126 | > HINT: 127 | > 128 | > - There are some example VHDL files in /tmp/files. 129 | > - All the terminals you open in VSC will be inside the container. 130 | > - In order to use gtkwave, the container must have access to some X server. [x11docker](https://github.com/mviereck/x11docker) and/or [runx](https://github.com/mviereck/runx) can be helpful in this context. 131 | 132 | # Emacs extension 133 | 134 | Subdir `emacs-client` contains instructions and an example configuration init file for use with emacs, including a LSP client that allows to have ghdl-ls integrated in Emacs. 135 | 136 | It can be also set up automatically by installing the package 137 | [`vhdl-ext`](https://github.com/gmlarumbe/vhdl-ext/) and adding the 138 | following snippet to your config: 139 | 140 | ```elisp 141 | (require 'vhdl-ext) 142 | (vhdl-ext-mode-setup) 143 | (vhdl-ext-eglot-set-server 've-ghdl-ls) ;`eglot' config 144 | (vhdl-ext-lsp-set-server 've-ghdl-ls) ; `lsp' config 145 | ``` 146 | 147 | -------------------------------------------------------------------------------- /ghdl-ls/tests/005opterr/cmds.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "method": "initialize", 6 | "params": { 7 | "processId": 14698, 8 | "rootPath": "/home/tgingold/work/ghdl-language-server/ghdl-ls/tests/005opterr", 9 | "rootUri": "file:///home/tgingold/work/ghdl-language-server/ghdl-ls/tests/005opterr", 10 | "capabilities": { 11 | "workspace": { 12 | "applyEdit": true, 13 | "workspaceEdit": { 14 | "documentChanges": true 15 | }, 16 | "didChangeConfiguration": { 17 | "dynamicRegistration": true 18 | }, 19 | "didChangeWatchedFiles": { 20 | "dynamicRegistration": true 21 | }, 22 | "symbol": { 23 | "dynamicRegistration": true, 24 | "symbolKind": { 25 | "valueSet": [ 26 | 1, 27 | 2, 28 | 3, 29 | 4, 30 | 5, 31 | 6, 32 | 7, 33 | 8, 34 | 9, 35 | 10, 36 | 11, 37 | 12, 38 | 13, 39 | 14, 40 | 15, 41 | 16, 42 | 17, 43 | 18, 44 | 19, 45 | 20, 46 | 21, 47 | 22, 48 | 23, 49 | 24, 50 | 25, 51 | 26 52 | ] 53 | } 54 | }, 55 | "executeCommand": { 56 | "dynamicRegistration": true 57 | }, 58 | "configuration": true, 59 | "workspaceFolders": true 60 | }, 61 | "textDocument": { 62 | "publishDiagnostics": { 63 | "relatedInformation": true 64 | }, 65 | "synchronization": { 66 | "dynamicRegistration": true, 67 | "willSave": true, 68 | "willSaveWaitUntil": true, 69 | "didSave": true 70 | }, 71 | "completion": { 72 | "dynamicRegistration": true, 73 | "contextSupport": true, 74 | "completionItem": { 75 | "snippetSupport": true, 76 | "commitCharactersSupport": true, 77 | "documentationFormat": [ 78 | "markdown", 79 | "plaintext" 80 | ], 81 | "deprecatedSupport": true, 82 | "preselectSupport": true 83 | }, 84 | "completionItemKind": { 85 | "valueSet": [ 86 | 1, 87 | 2, 88 | 3, 89 | 4, 90 | 5, 91 | 6, 92 | 7, 93 | 8, 94 | 9, 95 | 10, 96 | 11, 97 | 12, 98 | 13, 99 | 14, 100 | 15, 101 | 16, 102 | 17, 103 | 18, 104 | 19, 105 | 20, 106 | 21, 107 | 22, 108 | 23, 109 | 24, 110 | 25 111 | ] 112 | } 113 | }, 114 | "hover": { 115 | "dynamicRegistration": true, 116 | "contentFormat": [ 117 | "markdown", 118 | "plaintext" 119 | ] 120 | }, 121 | "signatureHelp": { 122 | "dynamicRegistration": true, 123 | "signatureInformation": { 124 | "documentationFormat": [ 125 | "markdown", 126 | "plaintext" 127 | ] 128 | } 129 | }, 130 | "definition": { 131 | "dynamicRegistration": true 132 | }, 133 | "references": { 134 | "dynamicRegistration": true 135 | }, 136 | "documentHighlight": { 137 | "dynamicRegistration": true 138 | }, 139 | "documentSymbol": { 140 | "dynamicRegistration": true, 141 | "symbolKind": { 142 | "valueSet": [ 143 | 1, 144 | 2, 145 | 3, 146 | 4, 147 | 5, 148 | 6, 149 | 7, 150 | 8, 151 | 9, 152 | 10, 153 | 11, 154 | 12, 155 | 13, 156 | 14, 157 | 15, 158 | 16, 159 | 17, 160 | 18, 161 | 19, 162 | 20, 163 | 21, 164 | 22, 165 | 23, 166 | 24, 167 | 25, 168 | 26 169 | ] 170 | }, 171 | "hierarchicalDocumentSymbolSupport": true 172 | }, 173 | "codeAction": { 174 | "dynamicRegistration": true, 175 | "codeActionLiteralSupport": { 176 | "codeActionKind": { 177 | "valueSet": [ 178 | "", 179 | "quickfix", 180 | "refactor", 181 | "refactor.extract", 182 | "refactor.inline", 183 | "refactor.rewrite", 184 | "source", 185 | "source.organizeImports" 186 | ] 187 | } 188 | } 189 | }, 190 | "codeLens": { 191 | "dynamicRegistration": true 192 | }, 193 | "formatting": { 194 | "dynamicRegistration": true 195 | }, 196 | "rangeFormatting": { 197 | "dynamicRegistration": true 198 | }, 199 | "onTypeFormatting": { 200 | "dynamicRegistration": true 201 | }, 202 | "rename": { 203 | "dynamicRegistration": true 204 | }, 205 | "documentLink": { 206 | "dynamicRegistration": true 207 | }, 208 | "typeDefinition": { 209 | "dynamicRegistration": true 210 | }, 211 | "implementation": { 212 | "dynamicRegistration": true 213 | }, 214 | "colorProvider": { 215 | "dynamicRegistration": true 216 | }, 217 | "foldingRange": { 218 | "dynamicRegistration": true, 219 | "rangeLimit": 5000, 220 | "lineFoldingOnly": true 221 | } 222 | } 223 | }, 224 | "trace": "off", 225 | "workspaceFolders": [ 226 | { 227 | "uri": "file:///home/tgingold/work/ghdl-language-server/ghdl-ls/tests/005opterr", 228 | "name": "005opterr" 229 | } 230 | ] 231 | } 232 | }, 233 | { 234 | "jsonrpc": "2.0", 235 | "method": "initialized", 236 | "params": {} 237 | }, 238 | { 239 | "jsonrpc": "2.0", 240 | "method": "textDocument/didOpen", 241 | "params": { 242 | "textDocument": { 243 | "uri": "file:///home/tgingold/work/ghdl-language-server/ghdl-ls/tests/files/heartbeat.vhdl", 244 | "languageId": "vhdl", 245 | "version": 1, 246 | "text": "\nlibrary ieee;\nuse ieee.std_logic_1164.all;\n\nentity heartbeat is\n port ( clk: out std_logic);\nend heartbeat;\n\narchitecture behaviour of heartbeat\nis\n constant clk_period : time := 10 ns;\nbegin\n -- Clock process definition\n clk_process: process\n begin\n clk <= '0';\n wait for clk_period/2;\n clk <= '1';\n wait for clk_period/2;\n end process;\nend behaviour;\n\n" 247 | } 248 | } 249 | }, 250 | { 251 | "jsonrpc": "2.0", 252 | "id": 1, 253 | "method": "textDocument/documentSymbol", 254 | "params": { 255 | "textDocument": { 256 | "uri": "file:///home/tgingold/work/ghdl-language-server/ghdl-ls/tests/files/heartbeat.vhdl" 257 | } 258 | } 259 | } 260 | ] 261 | -------------------------------------------------------------------------------- /ghdl-ls/tests/002coverage/cmds.lsp: -------------------------------------------------------------------------------- 1 | Content-Length: 2167 2 | 3 | {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":11082,"rootPath":"/home/tgingold/work/vhdl-language-server/tests/002coverage","rootUri":"file:///home/tgingold/work/vhdl-language-server/tests/002coverage","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"]}},"definition":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"codeAction":{"dynamicRegistration":true},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true},"typeDefinition":{"dynamicRegistration":true},"implementation":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true}}},"trace":"off","workspaceFolders":[{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/002coverage","name":"002coverage"}]}}Content-Length: 52 4 | 5 | {"jsonrpc":"2.0","method":"initialized","params":{}}Content-Length: 665 6 | 7 | {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","languageId":"vhdl","version":1,"text":"\nentity adder is\n -- `i0`, `i1`, and the carry-in `ci` are inputs of the adder.\n -- `s` is the sum output, `co` is the carry-out.\n port (i0, i1 : in bit; ci : in bit; s : out bit; co : out bit);\nend adder;\n\narchitecture rtl of adder is\nbegin\n -- This full-adder architecture contains two concurrent assignments.\n -- Compute the sum.\n s <= i0 xor i1 xor ci;\n -- Compute the carry.\n co <= (i0 and i1) or (i0 and ci) or (i1 and ci);\nend rtl;\n\n"}}}Content-Length: 170 8 | 9 | {"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl"}}}Content-Length: 2026 10 | 11 | {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","languageId":"vhdl","version":1,"text":"\n-- A testbench has no ports.\nentity adder_tb is\nend adder_tb;\n\narchitecture behav of adder_tb is\n -- Declaration of the component that will be instantiated.\n component adder\n port (i0, i1 : in bit; ci : in bit; s : out bit; co : out bit);\n end component;\n\n -- Specifies which entity is bound with the component.\n for adder_0: adder use entity work.adder;\n signal i0, i1, ci, s, co : bit;\nbegin\n -- Component instantiation.\n adder_0: adder port map (i0 => i0, i1 => i1, ci => ci,\n s => s, co => co);\n\n -- This process does the real job.\n process\n type pattern_type is record\n -- The inputs of the adder.\n i0, i1, ci : bit;\n -- The expected outputs of the adder.\n s, co : bit;\n end record;\n -- The patterns to apply.\n type pattern_array is array (natural range <>) of pattern_type;\n constant patterns : pattern_array :=\n (('0', '0', '0', '0', '0'),\n ('0', '0', '1', '1', '0'),\n ('0', '1', '0', '1', '0'),\n ('0', '1', '1', '0', '1'),\n ('1', '0', '0', '1', '0'),\n ('1', '0', '1', '0', '1'),\n ('1', '1', '0', '0', '1'),\n ('1', '1', '1', '1', '1'));\n begin\n -- Check each pattern.\n for i in patterns'range loop\n -- Set the inputs.\n i0 <= patterns(i).i0;\n i1 <= patterns(i).i1;\n ci <= patterns(i).ci;\n -- Wait for the results.\n wait for 1 ns;\n -- Check the outputs.\n assert s = patterns(i).s\n report \"bad sum value\" severity error;\n assert co = patterns(i).co\n report \"bad carry out value\" severity error;\n end loop;\n assert false report \"end of test\" severity note;\n -- Wait forever; this will finish the simulation.\n wait;\n end process;\nend behav;\n\n\n"}}}Content-Length: 173 12 | 13 | {"jsonrpc":"2.0","id":2,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl"}}}Content-Length: 207 14 | 15 | {"jsonrpc":"2.0","id":3,"method":"textDocument/definition","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl"},"position":{"line":12,"character":39}}}Content-Length: 299 16 | 17 | {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","version":2},"contentChanges":[{"range":{"start":{"line":11,"character":24},"end":{"line":11,"character":24}},"rangeLength":0,"text":"\n "}]}}Content-Length: 170 18 | 19 | {"jsonrpc":"2.0","id":4,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl"}}}Content-Length: 294 20 | 21 | {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","version":3},"contentChanges":[{"range":{"start":{"line":12,"character":2},"end":{"line":12,"character":2}},"rangeLength":0,"text":"e"}]}}Content-Length: 170 22 | 23 | {"jsonrpc":"2.0","id":5,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl"}}}Content-Length: 294 24 | 25 | {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","version":4},"contentChanges":[{"range":{"start":{"line":12,"character":3},"end":{"line":12,"character":3}},"rangeLength":0,"text":"r"}]}}Content-Length: 294 26 | 27 | {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","version":5},"contentChanges":[{"range":{"start":{"line":12,"character":4},"end":{"line":12,"character":4}},"rangeLength":0,"text":"r"}]}}Content-Length: 170 28 | 29 | {"jsonrpc":"2.0","id":6,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl"}}}Content-Length: 294 30 | 31 | {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","version":6},"contentChanges":[{"range":{"start":{"line":12,"character":5},"end":{"line":12,"character":5}},"rangeLength":0,"text":";"}]}}Content-Length: 170 32 | 33 | {"jsonrpc":"2.0","id":7,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl"}}}Content-Length: 293 34 | 35 | {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","version":7},"contentChanges":[{"range":{"start":{"line":12,"character":2},"end":{"line":13,"character":2}},"rangeLength":7,"text":""}]}} -------------------------------------------------------------------------------- /ghdl-ls/tests/002coverage/cmds.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "method": "initialize", 6 | "params": { 7 | "processId": 11082, 8 | "rootPath": "/home/tgingold/work/vhdl-language-server/tests/002coverage", 9 | "rootUri": "file:///home/tgingold/work/vhdl-language-server/tests/002coverage", 10 | "capabilities": { 11 | "workspace": { 12 | "applyEdit": true, 13 | "workspaceEdit": { 14 | "documentChanges": true 15 | }, 16 | "didChangeConfiguration": { 17 | "dynamicRegistration": true 18 | }, 19 | "didChangeWatchedFiles": { 20 | "dynamicRegistration": true 21 | }, 22 | "symbol": { 23 | "dynamicRegistration": true, 24 | "symbolKind": { 25 | "valueSet": [ 26 | 1, 27 | 2, 28 | 3, 29 | 4, 30 | 5, 31 | 6, 32 | 7, 33 | 8, 34 | 9, 35 | 10, 36 | 11, 37 | 12, 38 | 13, 39 | 14, 40 | 15, 41 | 16, 42 | 17, 43 | 18, 44 | 19, 45 | 20, 46 | 21, 47 | 22, 48 | 23, 49 | 24, 50 | 25, 51 | 26 52 | ] 53 | } 54 | }, 55 | "executeCommand": { 56 | "dynamicRegistration": true 57 | }, 58 | "configuration": true, 59 | "workspaceFolders": true 60 | }, 61 | "textDocument": { 62 | "publishDiagnostics": { 63 | "relatedInformation": true 64 | }, 65 | "synchronization": { 66 | "dynamicRegistration": true, 67 | "willSave": true, 68 | "willSaveWaitUntil": true, 69 | "didSave": true 70 | }, 71 | "completion": { 72 | "dynamicRegistration": true, 73 | "contextSupport": true, 74 | "completionItem": { 75 | "snippetSupport": true, 76 | "commitCharactersSupport": true, 77 | "documentationFormat": [ 78 | "markdown", 79 | "plaintext" 80 | ], 81 | "deprecatedSupport": true 82 | }, 83 | "completionItemKind": { 84 | "valueSet": [ 85 | 1, 86 | 2, 87 | 3, 88 | 4, 89 | 5, 90 | 6, 91 | 7, 92 | 8, 93 | 9, 94 | 10, 95 | 11, 96 | 12, 97 | 13, 98 | 14, 99 | 15, 100 | 16, 101 | 17, 102 | 18, 103 | 19, 104 | 20, 105 | 21, 106 | 22, 107 | 23, 108 | 24, 109 | 25 110 | ] 111 | } 112 | }, 113 | "hover": { 114 | "dynamicRegistration": true, 115 | "contentFormat": [ 116 | "markdown", 117 | "plaintext" 118 | ] 119 | }, 120 | "signatureHelp": { 121 | "dynamicRegistration": true, 122 | "signatureInformation": { 123 | "documentationFormat": [ 124 | "markdown", 125 | "plaintext" 126 | ] 127 | } 128 | }, 129 | "definition": { 130 | "dynamicRegistration": true 131 | }, 132 | "references": { 133 | "dynamicRegistration": true 134 | }, 135 | "documentHighlight": { 136 | "dynamicRegistration": true 137 | }, 138 | "documentSymbol": { 139 | "dynamicRegistration": true, 140 | "symbolKind": { 141 | "valueSet": [ 142 | 1, 143 | 2, 144 | 3, 145 | 4, 146 | 5, 147 | 6, 148 | 7, 149 | 8, 150 | 9, 151 | 10, 152 | 11, 153 | 12, 154 | 13, 155 | 14, 156 | 15, 157 | 16, 158 | 17, 159 | 18, 160 | 19, 161 | 20, 162 | 21, 163 | 22, 164 | 23, 165 | 24, 166 | 25, 167 | 26 168 | ] 169 | } 170 | }, 171 | "codeAction": { 172 | "dynamicRegistration": true 173 | }, 174 | "codeLens": { 175 | "dynamicRegistration": true 176 | }, 177 | "formatting": { 178 | "dynamicRegistration": true 179 | }, 180 | "rangeFormatting": { 181 | "dynamicRegistration": true 182 | }, 183 | "onTypeFormatting": { 184 | "dynamicRegistration": true 185 | }, 186 | "rename": { 187 | "dynamicRegistration": true 188 | }, 189 | "documentLink": { 190 | "dynamicRegistration": true 191 | }, 192 | "typeDefinition": { 193 | "dynamicRegistration": true 194 | }, 195 | "implementation": { 196 | "dynamicRegistration": true 197 | }, 198 | "colorProvider": { 199 | "dynamicRegistration": true 200 | } 201 | } 202 | }, 203 | "trace": "off", 204 | "workspaceFolders": [ 205 | { 206 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/002coverage", 207 | "name": "002coverage" 208 | } 209 | ] 210 | } 211 | }, 212 | { 213 | "jsonrpc": "2.0", 214 | "method": "initialized", 215 | "params": {} 216 | }, 217 | { 218 | "jsonrpc": "2.0", 219 | "method": "textDocument/didOpen", 220 | "params": { 221 | "textDocument": { 222 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 223 | "languageId": "vhdl", 224 | "version": 1, 225 | "text": "\nentity adder is\n -- `i0`, `i1`, and the carry-in `ci` are inputs of the adder.\n -- `s` is the sum output, `co` is the carry-out.\n port (i0, i1 : in bit; ci : in bit; s : out bit; co : out bit);\nend adder;\n\narchitecture rtl of adder is\nbegin\n -- This full-adder architecture contains two concurrent assignments.\n -- Compute the sum.\n s <= i0 xor i1 xor ci;\n -- Compute the carry.\n co <= (i0 and i1) or (i0 and ci) or (i1 and ci);\nend rtl;\n\n" 226 | } 227 | } 228 | }, 229 | { 230 | "jsonrpc": "2.0", 231 | "id": 1, 232 | "method": "textDocument/documentSymbol", 233 | "params": { 234 | "textDocument": { 235 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl" 236 | } 237 | } 238 | }, 239 | { 240 | "jsonrpc": "2.0", 241 | "method": "textDocument/didOpen", 242 | "params": { 243 | "textDocument": { 244 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl", 245 | "languageId": "vhdl", 246 | "version": 1, 247 | "text": "\n-- A testbench has no ports.\nentity adder_tb is\nend adder_tb;\n\narchitecture behav of adder_tb is\n -- Declaration of the component that will be instantiated.\n component adder\n port (i0, i1 : in bit; ci : in bit; s : out bit; co : out bit);\n end component;\n\n -- Specifies which entity is bound with the component.\n for adder_0: adder use entity work.adder;\n signal i0, i1, ci, s, co : bit;\nbegin\n -- Component instantiation.\n adder_0: adder port map (i0 => i0, i1 => i1, ci => ci,\n s => s, co => co);\n\n -- This process does the real job.\n process\n type pattern_type is record\n -- The inputs of the adder.\n i0, i1, ci : bit;\n -- The expected outputs of the adder.\n s, co : bit;\n end record;\n -- The patterns to apply.\n type pattern_array is array (natural range <>) of pattern_type;\n constant patterns : pattern_array :=\n (('0', '0', '0', '0', '0'),\n ('0', '0', '1', '1', '0'),\n ('0', '1', '0', '1', '0'),\n ('0', '1', '1', '0', '1'),\n ('1', '0', '0', '1', '0'),\n ('1', '0', '1', '0', '1'),\n ('1', '1', '0', '0', '1'),\n ('1', '1', '1', '1', '1'));\n begin\n -- Check each pattern.\n for i in patterns'range loop\n -- Set the inputs.\n i0 <= patterns(i).i0;\n i1 <= patterns(i).i1;\n ci <= patterns(i).ci;\n -- Wait for the results.\n wait for 1 ns;\n -- Check the outputs.\n assert s = patterns(i).s\n report \"bad sum value\" severity error;\n assert co = patterns(i).co\n report \"bad carry out value\" severity error;\n end loop;\n assert false report \"end of test\" severity note;\n -- Wait forever; this will finish the simulation.\n wait;\n end process;\nend behav;\n\n\n" 248 | } 249 | } 250 | }, 251 | { 252 | "jsonrpc": "2.0", 253 | "id": 2, 254 | "method": "textDocument/documentSymbol", 255 | "params": { 256 | "textDocument": { 257 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl" 258 | } 259 | } 260 | }, 261 | { 262 | "jsonrpc": "2.0", 263 | "id": 3, 264 | "method": "textDocument/definition", 265 | "params": { 266 | "textDocument": { 267 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl" 268 | }, 269 | "position": { 270 | "line": 12, 271 | "character": 39 272 | } 273 | } 274 | }, 275 | { 276 | "jsonrpc": "2.0", 277 | "method": "textDocument/didChange", 278 | "params": { 279 | "textDocument": { 280 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 281 | "version": 2 282 | }, 283 | "contentChanges": [ 284 | { 285 | "range": { 286 | "start": { 287 | "line": 11, 288 | "character": 24 289 | }, 290 | "end": { 291 | "line": 11, 292 | "character": 24 293 | } 294 | }, 295 | "rangeLength": 0, 296 | "text": "\n " 297 | } 298 | ] 299 | } 300 | }, 301 | { 302 | "jsonrpc": "2.0", 303 | "id": 4, 304 | "method": "textDocument/documentSymbol", 305 | "params": { 306 | "textDocument": { 307 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl" 308 | } 309 | } 310 | }, 311 | { 312 | "jsonrpc": "2.0", 313 | "method": "textDocument/didChange", 314 | "params": { 315 | "textDocument": { 316 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 317 | "version": 3 318 | }, 319 | "contentChanges": [ 320 | { 321 | "range": { 322 | "start": { 323 | "line": 12, 324 | "character": 2 325 | }, 326 | "end": { 327 | "line": 12, 328 | "character": 2 329 | } 330 | }, 331 | "rangeLength": 0, 332 | "text": "e" 333 | } 334 | ] 335 | } 336 | }, 337 | { 338 | "jsonrpc": "2.0", 339 | "id": 5, 340 | "method": "textDocument/documentSymbol", 341 | "params": { 342 | "textDocument": { 343 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl" 344 | } 345 | } 346 | }, 347 | { 348 | "jsonrpc": "2.0", 349 | "method": "textDocument/didChange", 350 | "params": { 351 | "textDocument": { 352 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 353 | "version": 4 354 | }, 355 | "contentChanges": [ 356 | { 357 | "range": { 358 | "start": { 359 | "line": 12, 360 | "character": 3 361 | }, 362 | "end": { 363 | "line": 12, 364 | "character": 3 365 | } 366 | }, 367 | "rangeLength": 0, 368 | "text": "r" 369 | } 370 | ] 371 | } 372 | }, 373 | { 374 | "jsonrpc": "2.0", 375 | "method": "textDocument/didChange", 376 | "params": { 377 | "textDocument": { 378 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 379 | "version": 5 380 | }, 381 | "contentChanges": [ 382 | { 383 | "range": { 384 | "start": { 385 | "line": 12, 386 | "character": 4 387 | }, 388 | "end": { 389 | "line": 12, 390 | "character": 4 391 | } 392 | }, 393 | "rangeLength": 0, 394 | "text": "r" 395 | } 396 | ] 397 | } 398 | }, 399 | { 400 | "jsonrpc": "2.0", 401 | "id": 6, 402 | "method": "textDocument/documentSymbol", 403 | "params": { 404 | "textDocument": { 405 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl" 406 | } 407 | } 408 | }, 409 | { 410 | "jsonrpc": "2.0", 411 | "method": "textDocument/didChange", 412 | "params": { 413 | "textDocument": { 414 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 415 | "version": 6 416 | }, 417 | "contentChanges": [ 418 | { 419 | "range": { 420 | "start": { 421 | "line": 12, 422 | "character": 5 423 | }, 424 | "end": { 425 | "line": 12, 426 | "character": 5 427 | } 428 | }, 429 | "rangeLength": 0, 430 | "text": ";" 431 | } 432 | ] 433 | } 434 | }, 435 | { 436 | "jsonrpc": "2.0", 437 | "id": 7, 438 | "method": "textDocument/documentSymbol", 439 | "params": { 440 | "textDocument": { 441 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl" 442 | } 443 | } 444 | }, 445 | { 446 | "jsonrpc": "2.0", 447 | "method": "textDocument/didChange", 448 | "params": { 449 | "textDocument": { 450 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 451 | "version": 7 452 | }, 453 | "contentChanges": [ 454 | { 455 | "range": { 456 | "start": { 457 | "line": 12, 458 | "character": 2 459 | }, 460 | "end": { 461 | "line": 13, 462 | "character": 2 463 | } 464 | }, 465 | "rangeLength": 7, 466 | "text": "" 467 | } 468 | ] 469 | } 470 | } 471 | ] 472 | -------------------------------------------------------------------------------- /ghdl-ls/tests/002coverage/replies.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "jsonrpc": "2.0", 4 | "id": 0, 5 | "result": { 6 | "capabilities": { 7 | "textDocumentSync": { 8 | "openClose": true, 9 | "change": 2, 10 | "save": { 11 | "includeText": true 12 | } 13 | }, 14 | "hoverProvider": false, 15 | "definitionProvider": true, 16 | "referencesProvider": false, 17 | "documentHighlightProvider": false, 18 | "documentSymbolProvider": true, 19 | "codeActionProvider": false, 20 | "documentFormattingProvider": false, 21 | "documentRangeFormattingProvider": true, 22 | "renameProvider": false 23 | } 24 | } 25 | }, 26 | { 27 | "jsonrpc": "2.0", 28 | "method": "textDocument/publishDiagnostics", 29 | "params": { 30 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 31 | "diagnostics": [] 32 | } 33 | }, 34 | { 35 | "jsonrpc": "2.0", 36 | "id": 1, 37 | "result": [ 38 | { 39 | "kind": 2, 40 | "name": "adder", 41 | "location": { 42 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 43 | "range": { 44 | "start": { 45 | "line": 1, 46 | "character": 0 47 | }, 48 | "end": { 49 | "line": 5, 50 | "character": 0 51 | } 52 | } 53 | } 54 | }, 55 | { 56 | "kind": 2, 57 | "name": "rtl", 58 | "location": { 59 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 60 | "range": { 61 | "start": { 62 | "line": 7, 63 | "character": 0 64 | }, 65 | "end": { 66 | "line": 14, 67 | "character": 0 68 | } 69 | } 70 | } 71 | } 72 | ] 73 | }, 74 | { 75 | "jsonrpc": "2.0", 76 | "method": "textDocument/publishDiagnostics", 77 | "params": { 78 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl", 79 | "diagnostics": [] 80 | } 81 | }, 82 | { 83 | "jsonrpc": "2.0", 84 | "id": 2, 85 | "result": [ 86 | { 87 | "kind": 2, 88 | "name": "adder_tb", 89 | "location": { 90 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl", 91 | "range": { 92 | "start": { 93 | "line": 2, 94 | "character": 0 95 | }, 96 | "end": { 97 | "line": 3, 98 | "character": 0 99 | } 100 | } 101 | } 102 | }, 103 | { 104 | "kind": 2, 105 | "name": "behav", 106 | "location": { 107 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl", 108 | "range": { 109 | "start": { 110 | "line": 5, 111 | "character": 0 112 | }, 113 | "end": { 114 | "line": 57, 115 | "character": 0 116 | } 117 | } 118 | } 119 | }, 120 | { 121 | "kind": 6, 122 | "name": "adder_0", 123 | "location": { 124 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl", 125 | "range": { 126 | "start": { 127 | "line": 16, 128 | "character": 2 129 | }, 130 | "end": { 131 | "line": 16, 132 | "character": 9 133 | } 134 | } 135 | }, 136 | "containerName": { 137 | "kind": 2, 138 | "name": "behav", 139 | "location": { 140 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl", 141 | "range": { 142 | "start": { 143 | "line": 5, 144 | "character": 0 145 | }, 146 | "end": { 147 | "line": 57, 148 | "character": 0 149 | } 150 | } 151 | } 152 | } 153 | } 154 | ] 155 | }, 156 | { 157 | "jsonrpc": "2.0", 158 | "id": 3, 159 | "result": [ 160 | { 161 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 162 | "range": { 163 | "start": { 164 | "line": 1, 165 | "character": 7 166 | }, 167 | "end": { 168 | "line": 1, 169 | "character": 12 170 | } 171 | } 172 | } 173 | ] 174 | }, 175 | { 176 | "jsonrpc": "2.0", 177 | "method": "textDocument/publishDiagnostics", 178 | "params": { 179 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 180 | "diagnostics": [] 181 | } 182 | }, 183 | { 184 | "jsonrpc": "2.0", 185 | "id": 4, 186 | "result": [ 187 | { 188 | "kind": 2, 189 | "name": "adder", 190 | "location": { 191 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 192 | "range": { 193 | "start": { 194 | "line": 1, 195 | "character": 0 196 | }, 197 | "end": { 198 | "line": 5, 199 | "character": 0 200 | } 201 | } 202 | } 203 | }, 204 | { 205 | "kind": 2, 206 | "name": "rtl", 207 | "location": { 208 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 209 | "range": { 210 | "start": { 211 | "line": 7, 212 | "character": 0 213 | }, 214 | "end": { 215 | "line": 15, 216 | "character": 0 217 | } 218 | } 219 | } 220 | } 221 | ] 222 | }, 223 | { 224 | "jsonrpc": "2.0", 225 | "method": "textDocument/publishDiagnostics", 226 | "params": { 227 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 228 | "diagnostics": [ 229 | { 230 | "source": "ghdl", 231 | "range": { 232 | "start": { 233 | "line": 14, 234 | "character": 2 235 | }, 236 | "end": { 237 | "line": 14, 238 | "character": 2 239 | } 240 | }, 241 | "message": "'<=' is expected instead of \"co\"", 242 | "severity": 1 243 | }, 244 | { 245 | "source": "ghdl", 246 | "range": { 247 | "start": { 248 | "line": 12, 249 | "character": 2 250 | }, 251 | "end": { 252 | "line": 12, 253 | "character": 2 254 | } 255 | }, 256 | "message": "no declaration for \"e\"", 257 | "severity": 1 258 | }, 259 | { 260 | "source": "ghdl", 261 | "range": { 262 | "start": { 263 | "line": 12, 264 | "character": 2 265 | }, 266 | "end": { 267 | "line": 12, 268 | "character": 2 269 | } 270 | }, 271 | "message": "target is not a signal name", 272 | "severity": 1 273 | }, 274 | { 275 | "source": "ghdl", 276 | "range": { 277 | "start": { 278 | "line": 14, 279 | "character": 2 280 | }, 281 | "end": { 282 | "line": 14, 283 | "character": 2 284 | } 285 | }, 286 | "message": "port \"co\" cannot be read", 287 | "severity": 1 288 | }, 289 | { 290 | "source": "ghdl", 291 | "range": { 292 | "start": { 293 | "line": 14, 294 | "character": 20 295 | }, 296 | "end": { 297 | "line": 14, 298 | "character": 20 299 | } 300 | }, 301 | "message": "no function declarations for operator \"or\"", 302 | "severity": 1 303 | } 304 | ] 305 | } 306 | }, 307 | { 308 | "jsonrpc": "2.0", 309 | "id": 5, 310 | "result": [ 311 | { 312 | "kind": 2, 313 | "name": "adder", 314 | "location": { 315 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 316 | "range": { 317 | "start": { 318 | "line": 1, 319 | "character": 0 320 | }, 321 | "end": { 322 | "line": 5, 323 | "character": 0 324 | } 325 | } 326 | } 327 | }, 328 | { 329 | "kind": 2, 330 | "name": "rtl", 331 | "location": { 332 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 333 | "range": { 334 | "start": { 335 | "line": 7, 336 | "character": 0 337 | }, 338 | "end": { 339 | "line": 15, 340 | "character": 0 341 | } 342 | } 343 | } 344 | } 345 | ] 346 | }, 347 | { 348 | "jsonrpc": "2.0", 349 | "method": "textDocument/publishDiagnostics", 350 | "params": { 351 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 352 | "diagnostics": [ 353 | { 354 | "source": "ghdl", 355 | "range": { 356 | "start": { 357 | "line": 14, 358 | "character": 2 359 | }, 360 | "end": { 361 | "line": 14, 362 | "character": 2 363 | } 364 | }, 365 | "message": "'<=' is expected instead of \"co\"", 366 | "severity": 1 367 | }, 368 | { 369 | "source": "ghdl", 370 | "range": { 371 | "start": { 372 | "line": 12, 373 | "character": 2 374 | }, 375 | "end": { 376 | "line": 12, 377 | "character": 2 378 | } 379 | }, 380 | "message": "no declaration for \"er\"", 381 | "severity": 1 382 | }, 383 | { 384 | "source": "ghdl", 385 | "range": { 386 | "start": { 387 | "line": 12, 388 | "character": 2 389 | }, 390 | "end": { 391 | "line": 12, 392 | "character": 2 393 | } 394 | }, 395 | "message": "target is not a signal name", 396 | "severity": 1 397 | }, 398 | { 399 | "source": "ghdl", 400 | "range": { 401 | "start": { 402 | "line": 14, 403 | "character": 2 404 | }, 405 | "end": { 406 | "line": 14, 407 | "character": 2 408 | } 409 | }, 410 | "message": "port \"co\" cannot be read", 411 | "severity": 1 412 | }, 413 | { 414 | "source": "ghdl", 415 | "range": { 416 | "start": { 417 | "line": 14, 418 | "character": 20 419 | }, 420 | "end": { 421 | "line": 14, 422 | "character": 20 423 | } 424 | }, 425 | "message": "no function declarations for operator \"or\"", 426 | "severity": 1 427 | } 428 | ] 429 | } 430 | }, 431 | { 432 | "jsonrpc": "2.0", 433 | "method": "textDocument/publishDiagnostics", 434 | "params": { 435 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 436 | "diagnostics": [ 437 | { 438 | "source": "ghdl", 439 | "range": { 440 | "start": { 441 | "line": 14, 442 | "character": 2 443 | }, 444 | "end": { 445 | "line": 14, 446 | "character": 2 447 | } 448 | }, 449 | "message": "'<=' is expected instead of \"co\"", 450 | "severity": 1 451 | }, 452 | { 453 | "source": "ghdl", 454 | "range": { 455 | "start": { 456 | "line": 12, 457 | "character": 2 458 | }, 459 | "end": { 460 | "line": 12, 461 | "character": 2 462 | } 463 | }, 464 | "message": "no declaration for \"err\"", 465 | "severity": 1 466 | }, 467 | { 468 | "source": "ghdl", 469 | "range": { 470 | "start": { 471 | "line": 12, 472 | "character": 2 473 | }, 474 | "end": { 475 | "line": 12, 476 | "character": 2 477 | } 478 | }, 479 | "message": "target is not a signal name", 480 | "severity": 1 481 | }, 482 | { 483 | "source": "ghdl", 484 | "range": { 485 | "start": { 486 | "line": 14, 487 | "character": 2 488 | }, 489 | "end": { 490 | "line": 14, 491 | "character": 2 492 | } 493 | }, 494 | "message": "port \"co\" cannot be read", 495 | "severity": 1 496 | }, 497 | { 498 | "source": "ghdl", 499 | "range": { 500 | "start": { 501 | "line": 14, 502 | "character": 20 503 | }, 504 | "end": { 505 | "line": 14, 506 | "character": 20 507 | } 508 | }, 509 | "message": "no function declarations for operator \"or\"", 510 | "severity": 1 511 | } 512 | ] 513 | } 514 | }, 515 | { 516 | "jsonrpc": "2.0", 517 | "id": 6, 518 | "result": [ 519 | { 520 | "kind": 2, 521 | "name": "adder", 522 | "location": { 523 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 524 | "range": { 525 | "start": { 526 | "line": 1, 527 | "character": 0 528 | }, 529 | "end": { 530 | "line": 5, 531 | "character": 0 532 | } 533 | } 534 | } 535 | }, 536 | { 537 | "kind": 2, 538 | "name": "rtl", 539 | "location": { 540 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 541 | "range": { 542 | "start": { 543 | "line": 7, 544 | "character": 0 545 | }, 546 | "end": { 547 | "line": 15, 548 | "character": 0 549 | } 550 | } 551 | } 552 | } 553 | ] 554 | }, 555 | { 556 | "jsonrpc": "2.0", 557 | "method": "textDocument/publishDiagnostics", 558 | "params": { 559 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 560 | "diagnostics": [ 561 | { 562 | "source": "ghdl", 563 | "range": { 564 | "start": { 565 | "line": 12, 566 | "character": 2 567 | }, 568 | "end": { 569 | "line": 12, 570 | "character": 2 571 | } 572 | }, 573 | "message": "no declaration for \"err\"", 574 | "severity": 1 575 | } 576 | ] 577 | } 578 | }, 579 | { 580 | "jsonrpc": "2.0", 581 | "id": 7, 582 | "result": [ 583 | { 584 | "kind": 2, 585 | "name": "adder", 586 | "location": { 587 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 588 | "range": { 589 | "start": { 590 | "line": 1, 591 | "character": 0 592 | }, 593 | "end": { 594 | "line": 5, 595 | "character": 0 596 | } 597 | } 598 | } 599 | }, 600 | { 601 | "kind": 2, 602 | "name": "rtl", 603 | "location": { 604 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 605 | "range": { 606 | "start": { 607 | "line": 7, 608 | "character": 0 609 | }, 610 | "end": { 611 | "line": 15, 612 | "character": 0 613 | } 614 | } 615 | } 616 | } 617 | ] 618 | }, 619 | { 620 | "jsonrpc": "2.0", 621 | "method": "textDocument/publishDiagnostics", 622 | "params": { 623 | "uri": "file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl", 624 | "diagnostics": [] 625 | } 626 | } 627 | ] 628 | -------------------------------------------------------------------------------- /ghdl-ls/tests/002coverage/replies.ref: -------------------------------------------------------------------------------- 1 | Content-Length: 393 2 | 3 | {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{"includeText":true}},"hoverProvider":false,"definitionProvider":true,"referencesProvider":false,"documentHighlightProvider":false,"documentSymbolProvider":true,"codeActionProvider":false,"documentFormattingProvider":false,"documentRangeFormattingProvider":false,"renameProvider":false}}}Content-Length: 167 4 | 5 | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","diagnostics":[]}}Content-Length: 2423 6 | 7 | {"jsonrpc":"2.0","id":1,"result":[{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}},{"kind":13,"name":"i0","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":8},"end":{"line":4,"character":10}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"i1","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":12},"end":{"line":4,"character":14}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"ci","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":25},"end":{"line":4,"character":27}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"s","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":38},"end":{"line":4,"character":39}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"co","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":51},"end":{"line":4,"character":53}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":2,"name":"rtl","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":7,"character":13},"end":{"line":7,"character":16}}}}]}Content-Length: 170 8 | 9 | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","diagnostics":[]}}Content-Length: 6405 10 | 11 | {"jsonrpc":"2.0","id":2,"result":[{"kind":2,"name":"adder_tb","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":2,"character":7},"end":{"line":2,"character":15}}}},{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}},{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":7,"character":12},"end":{"line":7,"character":17}}},"containerName":{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}}},{"kind":13,"name":"i0","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":8,"character":10},"end":{"line":8,"character":12}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":7,"character":12},"end":{"line":7,"character":17}}},"containerName":{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}}}},{"kind":13,"name":"i1","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":8,"character":14},"end":{"line":8,"character":16}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":7,"character":12},"end":{"line":7,"character":17}}},"containerName":{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}}}},{"kind":13,"name":"ci","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":8,"character":27},"end":{"line":8,"character":29}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":7,"character":12},"end":{"line":7,"character":17}}},"containerName":{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}}}},{"kind":13,"name":"s","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":8,"character":40},"end":{"line":8,"character":41}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":7,"character":12},"end":{"line":7,"character":17}}},"containerName":{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}}}},{"kind":13,"name":"co","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":8,"character":53},"end":{"line":8,"character":55}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":7,"character":12},"end":{"line":7,"character":17}}},"containerName":{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}}}},{"kind":13,"name":"i0","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":13,"character":9},"end":{"line":13,"character":11}}},"containerName":{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}}},{"kind":13,"name":"i1","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":13,"character":13},"end":{"line":13,"character":15}}},"containerName":{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}}},{"kind":13,"name":"ci","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":13,"character":17},"end":{"line":13,"character":19}}},"containerName":{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}}},{"kind":13,"name":"s","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":13,"character":21},"end":{"line":13,"character":22}}},"containerName":{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}}},{"kind":13,"name":"co","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":13,"character":24},"end":{"line":13,"character":26}}},"containerName":{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}}},{"kind":6,"name":"adder_0","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":16,"character":2},"end":{"line":16,"character":9}}},"containerName":{"kind":2,"name":"behav","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder_tb.vhdl","range":{"start":{"line":5,"character":13},"end":{"line":5,"character":18}}}}}]}Content-Length: 191 12 | 13 | {"jsonrpc":"2.0","id":3,"result":[{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}]}Content-Length: 167 14 | 15 | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","diagnostics":[]}}Content-Length: 2423 16 | 17 | {"jsonrpc":"2.0","id":4,"result":[{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}},{"kind":13,"name":"i0","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":8},"end":{"line":4,"character":10}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"i1","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":12},"end":{"line":4,"character":14}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"ci","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":25},"end":{"line":4,"character":27}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"s","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":38},"end":{"line":4,"character":39}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"co","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":51},"end":{"line":4,"character":53}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":2,"name":"rtl","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":7,"character":13},"end":{"line":7,"character":16}}}}]}Content-Length: 923 18 | 19 | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","diagnostics":[{"source":"ghdl","range":{"start":{"line":14,"character":2},"end":{"line":14,"character":2}},"message":"'<=' is expected instead of \"co\"","severity":1},{"source":"ghdl","range":{"start":{"line":12,"character":2},"end":{"line":12,"character":2}},"message":"no declaration for \"e\"","severity":1},{"source":"ghdl","range":{"start":{"line":12,"character":2},"end":{"line":12,"character":2}},"message":"target is not a signal name","severity":1},{"source":"ghdl","range":{"start":{"line":14,"character":2},"end":{"line":14,"character":2}},"message":"port \"co\" cannot be read","severity":1},{"source":"ghdl","range":{"start":{"line":14,"character":20},"end":{"line":14,"character":20}},"message":"no function declarations for operator \"or\"","severity":1}]}}Content-Length: 2423 20 | 21 | {"jsonrpc":"2.0","id":5,"result":[{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}},{"kind":13,"name":"i0","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":8},"end":{"line":4,"character":10}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"i1","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":12},"end":{"line":4,"character":14}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"ci","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":25},"end":{"line":4,"character":27}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"s","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":38},"end":{"line":4,"character":39}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"co","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":51},"end":{"line":4,"character":53}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":2,"name":"rtl","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":7,"character":13},"end":{"line":7,"character":16}}}}]}Content-Length: 924 22 | 23 | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","diagnostics":[{"source":"ghdl","range":{"start":{"line":14,"character":2},"end":{"line":14,"character":2}},"message":"'<=' is expected instead of \"co\"","severity":1},{"source":"ghdl","range":{"start":{"line":12,"character":2},"end":{"line":12,"character":2}},"message":"no declaration for \"er\"","severity":1},{"source":"ghdl","range":{"start":{"line":12,"character":2},"end":{"line":12,"character":2}},"message":"target is not a signal name","severity":1},{"source":"ghdl","range":{"start":{"line":14,"character":2},"end":{"line":14,"character":2}},"message":"port \"co\" cannot be read","severity":1},{"source":"ghdl","range":{"start":{"line":14,"character":20},"end":{"line":14,"character":20}},"message":"no function declarations for operator \"or\"","severity":1}]}}Content-Length: 925 24 | 25 | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","diagnostics":[{"source":"ghdl","range":{"start":{"line":14,"character":2},"end":{"line":14,"character":2}},"message":"'<=' is expected instead of \"co\"","severity":1},{"source":"ghdl","range":{"start":{"line":12,"character":2},"end":{"line":12,"character":2}},"message":"no declaration for \"err\"","severity":1},{"source":"ghdl","range":{"start":{"line":12,"character":2},"end":{"line":12,"character":2}},"message":"target is not a signal name","severity":1},{"source":"ghdl","range":{"start":{"line":14,"character":2},"end":{"line":14,"character":2}},"message":"port \"co\" cannot be read","severity":1},{"source":"ghdl","range":{"start":{"line":14,"character":20},"end":{"line":14,"character":20}},"message":"no function declarations for operator \"or\"","severity":1}]}}Content-Length: 2423 26 | 27 | {"jsonrpc":"2.0","id":6,"result":[{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}},{"kind":13,"name":"i0","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":8},"end":{"line":4,"character":10}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"i1","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":12},"end":{"line":4,"character":14}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"ci","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":25},"end":{"line":4,"character":27}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"s","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":38},"end":{"line":4,"character":39}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"co","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":51},"end":{"line":4,"character":53}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":2,"name":"rtl","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":7,"character":13},"end":{"line":7,"character":16}}}}]}Content-Length: 312 28 | 29 | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","diagnostics":[{"source":"ghdl","range":{"start":{"line":12,"character":2},"end":{"line":12,"character":2}},"message":"no declaration for \"err\"","severity":1}]}}Content-Length: 2423 30 | 31 | {"jsonrpc":"2.0","id":7,"result":[{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}},{"kind":13,"name":"i0","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":8},"end":{"line":4,"character":10}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"i1","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":12},"end":{"line":4,"character":14}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"ci","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":25},"end":{"line":4,"character":27}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"s","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":38},"end":{"line":4,"character":39}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":13,"name":"co","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":4,"character":51},"end":{"line":4,"character":53}}},"containerName":{"kind":2,"name":"adder","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":1,"character":7},"end":{"line":1,"character":12}}}}},{"kind":2,"name":"rtl","location":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","range":{"start":{"line":7,"character":13},"end":{"line":7,"character":16}}}}]}Content-Length: 167 32 | 33 | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/tgingold/work/vhdl-language-server/tests/files/adder.vhdl","diagnostics":[]}} --------------------------------------------------------------------------------