From 66b09a5a2f58e44d63421ba561ee1b966f17aac6 Mon Sep 17 00:00:00 2001 From: Florian Moser Date: Sun, 3 Mar 2024 14:04:43 +0100 Subject: [PATCH] release: Update extension --- CHANGELOG.md | 5 +++++ CONTRIBUTE.md | 8 +++++++- package-lock.json | 4 ++-- package.json | 2 +- server/package-lock.json | 4 ++-- server/package.json | 2 +- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0805a20..8550953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## v1.6.0 + +Add language configuration, TextMate grammar and semantic tokens. + + ## v1.5.0 Add hover. diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md index cf2d4b4..a2736a3 100644 --- a/CONTRIBUTE.md +++ b/CONTRIBUTE.md @@ -41,10 +41,16 @@ The architecture is inspired by an article series by [tomassetti](https://tomass The language server first lexes and parses the ProVerif code. Both the lexer as well as the parser are specified in Antl3r grammar, as this has good tool support to generate corresponding TypeScript code. The lexer is written by hand. The parser is transpiled from ProVerif's original `pitparser.mly` file using a python script called `pitparser-transpile-g4.py`. -Then, the language server builds up the symbol table. To do this, relevant grammar rules have to implemented manually. For most this should be done; some more obscure are however not done yet. As long as not all rules are implemented, navigation might fail or be wrong. +Then, the language server builds up the symbol table. To do this, relevant grammar rules have to implemented manually. For most rules this should be done; some more obscure rules are however not implemented. As long as not all rules are implemented, navigation might fail or be wrong. Lastly, the language server waits for the user to click on an identifier, and then picks the closest element in the symbol table. +## How it works: Syntax highlighting + +Syntax highlighting works primarily over the TextMate grammar in [./syntaxes/pv.tmLanguage.json](./syntaxes/pv.tmLanguage.json). As TextMate works quite differently to antlr, the rules are translated by hand. Details of the rules have been ommitted, to save on complexity. The primary task of the antlr grammar is to identify keywords, operators and types. + +While the TextMate grammar is fast, it is unable to precisely color. For example, some expressions allow both variables as well as functions to be referenced, which cannot be easily expressed in the grammar. For this, the language server implements semantic tokens: It scans the whole file, and returns a list of tokens it recognises as functions, variables and parameters. VSCode then adjusts the colors appropriately. + ## Publish Process: diff --git a/package-lock.json b/package-lock.json index 86e8a31..1ace7eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-proverif", - "version": "1.5.0", + "version": "1.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vscode-proverif", - "version": "1.5.0", + "version": "1.6.0", "hasInstallScript": true, "license": "MIT", "devDependencies": { diff --git a/package.json b/package.json index bf8fc38..1ec5f21 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "author": "ProVerif", "icon": "img/icon.png", "license": "MIT", - "version": "1.5.0", + "version": "1.6.0", "repository": { "type": "git", "url": "https://github.com/ProVerif/vscode-proverif-language-service" diff --git a/server/package-lock.json b/server/package-lock.json index 139547a..8b6551c 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-proverif-server", - "version": "1.5.0", + "version": "1.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vscode-proverif-server", - "version": "1.5.0", + "version": "1.6.0", "license": "MIT", "dependencies": { "antlr4-c3": "^3.1.1", diff --git a/server/package.json b/server/package.json index 13e102e..e2b9cd9 100644 --- a/server/package.json +++ b/server/package.json @@ -2,7 +2,7 @@ "name": "vscode-proverif-server", "description": "Language support for the ProVerif language - server", "author": "ProVerif", - "version": "1.5.0", + "version": "1.6.0", "license": "MIT", "engines": { "node": "*"