From 3348128a6ce408a0e54ab22f650c248ae642c226 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Tue, 17 Aug 2021 19:09:18 -0700 Subject: [PATCH 1/4] v1.2.0 (#3) --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e38aac..6dfb1df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "solidity-lang", - "version": "1.1.0", + "version": "1.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4f74e24..3c30658 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "publisher": "ContractShark", "icon": "assets/icon.png", "license": "MIT", - "repository": "https://github.com/contractshark/vscode-solidity-extenstion.git", - "version": "1.1.0", + "repository": "https://github.com/contractshark/vscode-extenstion.git", + "version": "1.2.1", "engines": { "vscode": "^1.55.0" }, From ca0a266683afc37c8390668e61487653ba34d4ca Mon Sep 17 00:00:00 2001 From: sam bacha Date: Fri, 1 Oct 2021 21:35:04 -0700 Subject: [PATCH 2/4] v1.3.0 (#5) --- .github/workflows/nodejs-ci.yml | 6 +- .gitignore | 2 + .prettierrc.json | 6 +- .vscode/extensions.json | 5 + .vscode/launch.json | 22 +- .vscode/settings.json | 4 +- CHANGELOG.md | 47 +- DEVELOPMENT.md | 29 - README.md | 47 +- index.js | 93 - index.mjs | 8 - language-configuration.json | 47 +- language/.vscode/launch.json | 17 - language/.vscodeignore | 4 - language/CHANGELOG.md | 9 - language/README.md | 65 - language/language-configuration.json | 25 - language/package-lock.json | 5 - language/package.json | 40 - language/syntaxes/solidity.tmLanguage.json | 669 ------- package-lock.json | 662 ------- package.json | 128 +- parser.js | 171 -- parserHelper.js | 51 - settings.js | 18 - syntaxes/legacy.solidity.tmLanguage.json | 1268 ++++++++++++ syntaxes/solidity.tmLanguage.json | 2057 +++++++++----------- tests/ref.schema.json | 2 +- tests/tmLanguage.schema.json | 363 ++-- themes/solidity-lang-theme.json | 28 +- 30 files changed, 2605 insertions(+), 3293 deletions(-) create mode 100644 .vscode/extensions.json delete mode 100644 DEVELOPMENT.md delete mode 100644 index.js delete mode 100644 index.mjs delete mode 100644 language/.vscode/launch.json delete mode 100644 language/.vscodeignore delete mode 100644 language/CHANGELOG.md delete mode 100644 language/README.md delete mode 100644 language/language-configuration.json delete mode 100644 language/package-lock.json delete mode 100644 language/package.json delete mode 100644 language/syntaxes/solidity.tmLanguage.json delete mode 100644 package-lock.json delete mode 100644 parser.js delete mode 100644 parserHelper.js delete mode 100644 settings.js create mode 100644 syntaxes/legacy.solidity.tmLanguage.json diff --git a/.github/workflows/nodejs-ci.yml b/.github/workflows/nodejs-ci.yml index 924ef46..4563d2d 100644 --- a/.github/workflows/nodejs-ci.yml +++ b/.github/workflows/nodejs-ci.yml @@ -2,7 +2,7 @@ name: nodejs on: push: - paths: + paths: - "**/**" - "!**/*.md/**" @@ -18,8 +18,8 @@ jobs: strategy: fail-fast: false matrix: - node: ['14'] - os: ['ubuntu-latest'] + node: ["14"] + os: ["ubuntu-latest"] steps: - name: Clone repository diff --git a/.gitignore b/.gitignore index df90fee..9f7a197 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ cache .cache/ *.log *-error. +solidity-lang-*.zip + diff --git a/.prettierrc.json b/.prettierrc.json index 550f298..83d11ad 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -4,12 +4,12 @@ "bracketSpacing": true, "jsxBracketSameLine": false, "jsxSingleQuote": false, - "printWidth": 80, + "printWidth": 100, "proseWrap": "always", "quoteProps": "as-needed", "semi": true, - "singleQuote": true, + "singleQuote": false, "tabWidth": 2, - "trailingComma": "all", + "trailingComma": "es5", "useTabs": false } diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..bf2261d --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "leodevbro.blockman" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 0e191b5..4058e69 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -3,15 +3,13 @@ // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 { - "version": "0.2.0", - "configurations": [ - { - "name": "Extension", - "type": "extensionHost", - "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}" - ] - } - ] -} \ No newline at end of file + "version": "0.2.0", + "configurations": [ + { + "name": "Extension", + "type": "extensionHost", + "request": "launch", + "args": ["--extensionDevelopmentPath=${workspaceFolder}"] + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 901fbf1..c54c957 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { - "files.trimTrailingWhitespace": true, - "gitlens.advanced.blame.customArguments": ["--ignore-revs-file", ".gitignore-revs"], + "files.trimTrailingWhitespace": true, + "gitlens.advanced.blame.customArguments": ["--ignore-revs-file", ".gitignore-revs"] } diff --git a/CHANGELOG.md b/CHANGELOG.md index e0af372..ab7ac2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,17 +2,50 @@ All notable changes to this project will be documented in this file. Dates are displayed in UTC. -## [1.1.0](https://github.com/contractshark/vscode-extenstion/compare/v1.0.1...v1.1.0) (2021-07-31) +Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v1.3.0](https://github.com/contractshark/vscode-solidity-extenstion/compare/v1.2.1...v1.3.0) -### Features +> 1 October 2021 -* **release:** v1.1.0 ([efbb953](https://github.com/contractshark/vscode-extenstion/commit/efbb9534d220bbe9efc94a3f296376a88e65bfb5)) -* **vscode:** inital theme overlay ([d11ba45](https://github.com/contractshark/vscode-extenstion/commit/d11ba45b0382e88e3f8c5f38f96242095f1c178b)) +- v1.2.0 [`#3`](https://github.com/contractshark/vscode-solidity-extenstion/pull/3) +- v1.1.0 [`#2`](https://github.com/contractshark/vscode-solidity-extenstion/pull/2) +- bug/vscode [`#1`](https://github.com/contractshark/vscode-solidity-extenstion/pull/1) +- feat(vscode): release v1.3.0 [`3f15e3c`](https://github.com/contractshark/vscode-solidity-extenstion/commit/3f15e3c4b014db649c219756b1669dd8743adc5d) +- Release 1.2.1 [`020ef3b`](https://github.com/contractshark/vscode-solidity-extenstion/commit/020ef3bb5fdf77966db1ce3e9b12016bb8d7f21c) +- chore(package): pin dependencies, fix git url [`86a55c8`](https://github.com/contractshark/vscode-solidity-extenstion/commit/86a55c8b74248c25f7d6524ad49bd60b50133d8c) +#### [v1.2.1](https://github.com/contractshark/vscode-solidity-extenstion/compare/v1.2.0...v1.2.1) -### Bug Fixes +> 17 August 2021 -* **marketplace:** info update ([e8dfa60](https://github.com/contractshark/vscode-extenstion/commit/e8dfa6083390c3d35c56535ac4546f4190bd398a)) +#### [v1.2.0](https://github.com/contractshark/vscode-solidity-extenstion/compare/v1.1.0...v1.2.0) -### [1.0.1](https://github.com/contractshark/vscode-extenstion/compare/v1.0.0...v1.0.1) (2021-04-15) +> 17 August 2021 + +- feat(release): EIP1559 support [`4353981`](https://github.com/contractshark/vscode-solidity-extenstion/commit/43539818462f5b6d5c0b3a6cb3bd0ac992020387) +- Release 1.2.1 [`16f05e8`](https://github.com/contractshark/vscode-solidity-extenstion/commit/16f05e8020e8bd8581e67853ab6327879cb12eba) + +#### [v1.1.0](https://github.com/contractshark/vscode-solidity-extenstion/compare/v1.0.1...v1.1.0) + +> 30 July 2021 + +- feat(release): v1.1.0 [`efbb953`](https://github.com/contractshark/vscode-solidity-extenstion/commit/efbb9534d220bbe9efc94a3f296376a88e65bfb5) +- feat(vscode): inital theme overlay [`d11ba45`](https://github.com/contractshark/vscode-solidity-extenstion/commit/d11ba45b0382e88e3f8c5f38f96242095f1c178b) +- docs(readme): v1.0.0 [`60295d7`](https://github.com/contractshark/vscode-solidity-extenstion/commit/60295d7b5fc3cdc54f9c5595e5c1e55d01b07e93) + +### [v1.0.1](https://github.com/contractshark/vscode-solidity-extenstion/compare/v0.0.2...v1.0.1) + +> 15 April 2021 + +- test(validate): validate grammar [`d7b281a`](https://github.com/contractshark/vscode-solidity-extenstion/commit/d7b281a6b1b570cf8afc1b1eae0f1c253de2b6d8) +- fix(ext): url update and CI [`bc29fe5`](https://github.com/contractshark/vscode-solidity-extenstion/commit/bc29fe53de67ade1058c62285194d691ed488d7f) +- docs(readme): vscode ext [`33d1c37`](https://github.com/contractshark/vscode-solidity-extenstion/commit/33d1c3731c4f02419a7a9b4cd60d13723e63eaf6) + +#### v0.0.2 + +> 14 April 2021 + +- release [`06906dc`](https://github.com/contractshark/vscode-solidity-extenstion/commit/06906dc5dffabb815395d29c9643bf9ff5c86f9e) +- chore(release): 0.0.2 [`c8c2741`](https://github.com/contractshark/vscode-solidity-extenstion/commit/c8c274182f95fa7d9a9d544857ac4aa58405dc9e) +- build(vsce): package [`aec374a`](https://github.com/contractshark/vscode-solidity-extenstion/commit/aec374ac38ab110046f018e914fb4b39bb7931e5) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md deleted file mode 100644 index c156c41..0000000 --- a/DEVELOPMENT.md +++ /dev/null @@ -1,29 +0,0 @@ -# Welcome to your VS Code Extension - -## What's in the folder - -* This folder contains all of the files necessary for your extension. -* `package.json` - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension. -* `syntaxes/solidity.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization. -* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets. - -## Get up and running straight away - -* Make sure the language configuration settings in `language-configuration.json` are accurate. -* Press `F5` to open a new window with your extension loaded. -* Create a new file with a file name suffix matching your language. -* Verify that syntax highlighting works and that the language configuration settings are working. - -## Make changes - -* You can relaunch the extension from the debug toolbar after making changes to the files listed above. -* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. - -## Add more language features - -* To add features such as intellisense, hovers and validators check out the VS Code extenders documentation at https://code.visualstudio.com/docs - -## Install your extension - -* To start using your extension with Visual Studio Code copy it into the `/.vscode/extensions` folder and restart Code. -* To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension. diff --git a/README.md b/README.md index 8729708..13016c5 100644 --- a/README.md +++ b/README.md @@ -1,61 +1,56 @@ -

solidity-lang

-

visual studio code syntax highlight

+

VSCode Solidity Semantic Syntax Highlighting

-------------- +--- +
+[![vscode marketplace](https://badgen.net/vs-marketplace/v/contractshark.solidity-lang)](https://marketplace.visualstudio.com/items?itemName=ContractShark.solidity-lang) -![](https://badgen.net/vs-marketplace/v/contractshark.solidity-lang) -[![solidity - v0.6.12](https://img.shields.io/badge/solidity-v0.9.0-2ea44f?logo=solidity)](https://github.com/manifoldfinance) +[![solidity - <0.9.0](https://img.shields.io/badge/solidity-v0.9.0-2ea44f?logo=solidity)](https://github.com/manifoldfinance) ## Motivation -Every Solidity extenstion on Visual Studio Code's Marketplacce contain multiple plugins. This can lead -to an inconssistent developer environment, or worse create conflicting configurations that, under the -pretense of `helping` you, do things in the background to your files wihtout your explicit knowledge. +Every Solidity extension on Visual Studio Code's Marketplace contain multiple plugins. This can +lead to an inconsistent developer environment, or worse create conflicting configurations that, +under the pretense of `helping` you, do things in the background to your files without your explicit +knowledge. -Hence why this extenstion exists: only to provide syntax highlighting so that you can decided what to add without -having to give up basic functionality. +Hence why this extension exists: only to provide syntax highlighting so that you can decided what +to add without having to give up basic functionality. ## Features -- Solidity Syntax Highlight -- No other plugins, configurations, etc: just syntax highlighting +- Solidity Syntax Highlighting + +- Semantic Syntax Support + +- Remote Container / Container support + +- NatSpec Supported Highlighting - Support ^0.5.0 to <0.9.0 +- No other plugins, configurations, etc: just syntax highlighting + - see the additional `.vscode/settings` for better git workspace environment - [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=ContractShark.solidity-lang) - ## Extension Settings This extension contributes the following settings: -* `solidity-lang.enable`: enable/disable this extension - - -## Development - -## What's in the folder - -* This folder contains all of the files necessary for your extension. -* `package.json` - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension. -* `syntaxes/solidity.tmLanguage.json` - this is the Text mate grammar file that is used for tokenization. -* `language-configuration.json` - this is the language configuration, defining the tokens that are used for comments and brackets. - +- `solidity-lang.enable`: enable/disable this extension ## Issues / Support [github.com/contractshark](https://github.com/contractshark) - ## License SPDX-License-Identifier: MIT diff --git a/index.js b/index.js deleted file mode 100644 index 149be94..0000000 --- a/index.js +++ /dev/null @@ -1,93 +0,0 @@ -// SPDX-License-Identifier: MIT -'use strict'; -const vscode = require("vscode"); - -//const mod_deco = require("./features/deco.js"); -//const mod_signatures = require("./features/signatures.js"); -//const mod_hover = require("./features/hover/hover.js"); -//const mod_compile = require("./features/compile.js"); -const settings = require("./settings"); -/** global vars */ -var activeEditor; - - -/** event funcs */ -async function onDidSave(document) { - if (document.languageId != settings.LANGUAGE_ID) { - console.log("warning ~ LanguageId mismatch"); - return; - } - - //always run on save - if (settings.extensionConfig().compile.onSave) { - mod_compile.compileContractCommand(document); - } -} - - -function onInitModules(context, type) { - mod_hover.init(context, type); - mod_compile.init(context, type); -} - -function onActivate(context) { - - const active = vscode.window.activeTextEditor; - activeEditor = active; - - registerDocType(settings.LANGUAGE_ID); - - function registerDocType(type) { - context.subscriptions.push( - vscode.languages.reg - ); - - // src: https://github.com/Microsoft/vscode/blob/master/extensions/python/src/pythonMain.ts - // autoindent while typing - vscode.languages.setLanguageConfiguration(type, { - onEnterRules: [ - { - beforeText: /^\s*(?:struct|def|class|for|if|elif|else|while|try|with|finally|except|async).*?:\s*$/, - action: { indentAction: vscode.IndentAction.Indent } - } - ] - }); - - /** module init */ - onInitModules(context, type); - onDidChange(); - onDidSave(active.document); - - /** @event setup */ - /** @event onChange */ - vscode.window.onDidChangeActiveTextEditor(editor => { - activeEditor = editor; - if (editor) { - onDidChange(); - } - }, null, context.subscriptions); - - /** @event onChange */ - vscode.workspace.onDidChangeTextDocument(event => { - if (activeEditor && event.document === activeEditor.document) { - onDidChange(event); - } - }, null, context.subscriptions); - - /** @event onDidSaveTextDocument */ - vscode.workspace.onDidSaveTextDocument(document => { - onDidSave(document); - }, null, context.subscriptions); - - - /** @event onDidOpenTextDocument */ - vscode.workspace.onDidOpenTextDocument(document => { - onDidSave(document); - }, null, context.subscriptions); - - - } -} - -/* exports */ -exports.activate = onActivate; diff --git a/index.mjs b/index.mjs deleted file mode 100644 index 34743d3..0000000 --- a/index.mjs +++ /dev/null @@ -1,8 +0,0 @@ -import Ajv from 'ajv'; -import * as data from './syntaxes/solidity.tmLangauge.json'; - -var ajv = new Ajv(); -var valid = ajv.addSchema(defaultExport.schema, 'mySchema').validate('mySchema', data.default); -if (!valid) { - throw new Error(ajv.errorsText()); -} diff --git a/language-configuration.json b/language-configuration.json index 1bc026d..512da4c 100644 --- a/language-configuration.json +++ b/language-configuration.json @@ -1,25 +1,26 @@ { - "comments": { - "lineComment": ["///", "//"], - "blockComment": [ "/**", "*/" ] - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - "autoClosingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"] - ], - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"] - ] + "comments": { + "lineComment": "//", + "blockComment": ["/*", "*/"] + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + { "open": "{", "close": "}" }, + { "open": "[", "close": "]" }, + { "open": "(", "close": ")" }, + { "open": "/**", "close": " */", "notIn": ["string"] } + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "indentationRules": { + "increaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$", + "decreaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\)\\}\\]].*$" + } } diff --git a/language/.vscode/launch.json b/language/.vscode/launch.json deleted file mode 100644 index 0e191b5..0000000 --- a/language/.vscode/launch.json +++ /dev/null @@ -1,17 +0,0 @@ -// A launch configuration that launches the extension inside a new window -// Use IntelliSense to learn about possible attributes. -// Hover to view descriptions of existing attributes. -// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Extension", - "type": "extensionHost", - "request": "launch", - "args": [ - "--extensionDevelopmentPath=${workspaceFolder}" - ] - } - ] -} \ No newline at end of file diff --git a/language/.vscodeignore b/language/.vscodeignore deleted file mode 100644 index f369b5e..0000000 --- a/language/.vscodeignore +++ /dev/null @@ -1,4 +0,0 @@ -.vscode/** -.vscode-test/** -.gitignore -vsc-extension-quickstart.md diff --git a/language/CHANGELOG.md b/language/CHANGELOG.md deleted file mode 100644 index fcb8dc3..0000000 --- a/language/CHANGELOG.md +++ /dev/null @@ -1,9 +0,0 @@ -# Change Log - -All notable changes to the "language" extension will be documented in this file. - -Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. - -## [Unreleased] - -- Initial release \ No newline at end of file diff --git a/language/README.md b/language/README.md deleted file mode 100644 index c3cda75..0000000 --- a/language/README.md +++ /dev/null @@ -1,65 +0,0 @@ -# language README - -This is the README for your extension "language". After writing up a brief description, we recommend including the following sections. - -## Features - -Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file. - -For example if there is an image subfolder under your extension project workspace: - -\!\[feature X\]\(images/feature-x.png\) - -> Tip: Many popular extensions utilize animations. This is an excellent way to show off your extension! We recommend short, focused animations that are easy to follow. - -## Requirements - -If you have any requirements or dependencies, add a section describing those and how to install and configure them. - -## Extension Settings - -Include if your extension adds any VS Code settings through the `contributes.configuration` extension point. - -For example: - -This extension contributes the following settings: - -* `myExtension.enable`: enable/disable this extension -* `myExtension.thing`: set to `blah` to do something - -## Known Issues - -Calling out known issues can help limit users opening duplicate issues against your extension. - -## Release Notes - -Users appreciate release notes as you update your extension. - -### 1.0.0 - -Initial release of ... - -### 1.0.1 - -Fixed issue #. - -### 1.1.0 - -Added features X, Y, and Z. - ------------------------------------------------------------------------------------------------------------ - -## Working with Markdown - -**Note:** You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts: - -* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux) -* Toggle preview (`Shift+CMD+V` on macOS or `Shift+Ctrl+V` on Windows and Linux) -* Press `Ctrl+Space` (Windows, Linux) or `Cmd+Space` (macOS) to see a list of Markdown snippets - -### For more information - -* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown) -* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/) - -**Enjoy!** diff --git a/language/language-configuration.json b/language/language-configuration.json deleted file mode 100644 index d43e282..0000000 --- a/language/language-configuration.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "comments": { - "lineComment": "//", - "blockComment": [ "/*", "*/" ] - }, - "brackets": [ - ["{", "}"], - ["[", "]"], - ["(", ")"] - ], - "autoClosingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"] - ], - "surroundingPairs": [ - ["{", "}"], - ["[", "]"], - ["(", ")"], - ["\"", "\""], - ["'", "'"] - ] -} \ No newline at end of file diff --git a/language/package-lock.json b/language/package-lock.json deleted file mode 100644 index 5e750e4..0000000 --- a/language/package-lock.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "language", - "version": "0.0.1", - "lockfileVersion": 1 -} diff --git a/language/package.json b/language/package.json deleted file mode 100644 index 691f743..0000000 --- a/language/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "solidity-language", - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "https://github.com/contractshark/vscode-solidity-extenstion.git", - "directory": "language/" - }, - "displayName": "solidity language highlighting", - "description": "solidity language support for visual studio code", - "version": "1.1.0", - "engines": { - "vscode": "^1.58.0" - }, - "categories": [ - "Programming Languages" - ], - "contributes": { - "languages": [ - { - "id": "sol", - "aliases": [ - "solidity", - "sol" - ], - "extensions": [ - ".sol" - ], - "configuration": "./language-configuration.json" - } - ], - "grammars": [ - { - "language": "sol", - "scopeName": "source.solidity", - "path": "./syntaxes/solidity.tmLanguage.json" - } - ] - } -} diff --git a/language/syntaxes/solidity.tmLanguage.json b/language/syntaxes/solidity.tmLanguage.json deleted file mode 100644 index 0045174..0000000 --- a/language/syntaxes/solidity.tmLanguage.json +++ /dev/null @@ -1,669 +0,0 @@ -{ - "fileTypes": [ - "sol" - ], - "name": "solidity", - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "patterns": [ - { - "include": "#natspec" - }, - { - "include": "#comment" - }, - { - "include": "#operator" - }, - { - "include": "#control" - }, - { - "include": "#constant" - }, - { - "include": "#number" - }, - { - "include": "#string" - }, - { - "include": "#type" - }, - { - "include": "#global" - }, - { - "include": "#declaration" - }, - { - "include": "#function-call" - }, - { - "include": "#assembly" - }, - { - "include": "#punctuation" - } - ], - "repository": { - "natspec": { - "patterns": [ - { - "begin": "/\\*\\*", - "end": "\\*/", - "name": "comment.block.documentation.solidity", - "patterns": [ - { - "include": "#natspec-tags" - } - ] - }, - { - "begin": "///", - "end": "$", - "name": "comment.block.documentation.solidity", - "patterns": [ - { - "include": "#natspec-tags" - } - ] - } - ] - }, - "natspec-tags": { - "patterns": [ - { "include": "#comment-todo"}, - { - "include": "#natspec-tag-title" - }, - { - "include": "#natspec-tag-author" - }, - { - "include": "#natspec-tag-notice" - }, - { - "include": "#natspec-tag-dev" - }, - { - "include": "#natspec-tag-param" - }, - { - "include": "#natspec-tag-return" - } - ] - }, - "natspec-tag-title": { - "match": "(@title)\\b", - "name": "storage.type.title.natspec" - }, - "natspec-tag-author": { - "match": "(@author)\\b", - "name": "storage.type.author.natspec" - }, - "natspec-tag-notice": { - "match": "(@notice)\\b", - "name": "storage.type.dev.natspec" - }, - "natspec-tag-dev": { - "match": "(@dev)\\b", - "name": "storage.type.dev.natspec" - }, - "natspec-tag-param": { - "match": "(@param)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.param.natspec" - }, - "3": { - "name": "variable.other.natspec" - } - } - }, - "natspec-tag-return": { - "match": "(@return)\\b", - "name": "storage.type.return.natspec" - }, - "comment": { - "patterns": [ - { - "include": "#comment-line" - }, - { - "include": "#comment-block" - } - ] - }, - "comment-line": { - - "begin": "(?(?!>)|>=|\\&\\&|\\|\\||\\:(?!=)|\\?)", - "name": "keyword.operator.logic.solidity" - }, - "operator-mapping": { - "match": "(=>)", - "name": "keyword.operator.mapping.solidity" - }, - "operator-arithmetic": { - "match": "(\\+|\\-|\\/|\\*)", - "name": "keyword.operator.arithmetic.solidity" - }, - "operator-binary": { - "match": "(\\^|\\&|\\||<<|>>)", - "name": "keyword.operator.binary.solidity" - }, - "operator-assignment": { - "match": "(\\:?=)", - "name": "keyword.operator.assignment.solidity" - }, - "control": { - "patterns": [ - { - "include": "#control-flow" - }, - { - "include": "#control-using" - }, - { - "include": "#control-import" - }, - { - "include": "#control-pragma" - }, - { - "include": "#control-underscore" - }, - { - "include": "#control-other" - } - ] - }, - "control-flow": { - "match": "\\b(if|else|for|while|do|break|continue|throw|returns?)\\b", - "name": "keyword.control.flow.solidity" - }, - "control-using": { - "match": "\\b(using)\\b", - "name": "keyword.control.using.solidity" - }, - "control-import": { - "match": "\\b(import)\\b", - "name": "keyword.control.import.solidity" - }, - "control-pragma": { - "match": "\\b(pragma)(?:\\s+([A-Za-z_]\\w+)\\s+([^\\s]+))?\\b", - "captures": { - "1": { - "name": "keyword.control.pragma.solidity" - }, - "2": { - "name": "entity.name.tag.pragma.solidity" - }, - "3": { - "name": "constant.other.pragma.solidity" - } - } - }, - "control-underscore": { - "match": "\\b(_)\\b", - "name": "constant.other.underscore.solidity" - }, - "control-other": { - "match": "\\b(new|delete|emit)\\b", - "name": "keyword.control.solidity" - }, - "constant": { - "patterns": [ - { - "include": "#constant-boolean" - }, - { - "include": "#constant-time" - }, - { - "include": "#constant-currency" - }, - { - "include": "#constant-ucase" - } - ] - }, - "constant-boolean": { - "match": "\\b(true|false)\\b", - "name": "constant.language.boolean.solidity" - }, - "constant-time": { - "match": "\\b(seconds|minutes|hours|days|weeks|years)\\b", - "name": "constant.language.time.solidity" - }, - "constant-currency": { - "match": "\\b(ether|wei|finney|szabo)\\b", - "name": "constant.language.currency.solidity" - }, - "constant-ucase": { - "match": "\\b([A-Z09_]+)\\b", - "name": "constant.language.ucase.solidity" - }, - "number": { - "patterns": [ - { - "include": "#number-decimal" - }, - { - "include": "#number-hex" - } - ] - }, - "number-decimal": { - "match": "\\b(\\d+(\\.\\d+)?)\\b", - "name": "constant.numeric.decimal.solidity" - }, - "number-hex": { - "match": "\\b(0[xX][a-fA-F0-9]+)\\b", - "name": "constant.numeric.hexadecimal.solidity" - }, - "string": { - "patterns": [ - { - "match": "\\\".*?\\\"", - "name": "string.quoted.double.solidity" - }, - { - "match": "\\'.*?\\'", - "name": "string.quoted.single.solidity" - } - ] - }, - "type": { - "patterns": [ - { - "include": "#type-primitive" - } - ] - }, - "type-primitive": { - "match": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*|var)\\b", - "name": "support.type.primitive.solidity" - }, - "global": { - "patterns": [ - { - "include": "#global-variables" - }, - { - "include": "#global-functions" - } - ] - }, - "global-variables": { - "patterns": [ - - { - "match": "\\b(this)\\b", - "name": "variable.language.this.solidity" - }, - { - "match": "\\b(super)\\b", - "name": "variable.language.super.solidity" - }, - { - "match": "\\b(abi)\\b", - "name": "variable.language.builtin.abi.solidity" - }, - { - "match": "\\b(tx\\.origin|tx\\.gasprice|msg\\.data|msg\\.sig|msg\\.value)\\b", - "name": "variable.language.transaction.security.solidity" - }, - { - "match": "\\b(msg\\.sender|msg|block|tx|now)\\b", - "name": "variable.language.transaction.solidity" - } - ] - }, - "global-functions": { - "patterns": [ - { - "match": "\\b(require|assert|revert)\\b", - "name": "keyword.control.exceptions.solidity" - }, - { - "match": "\\b(selfdestruct|suicide)\\b", - "name": "keyword.control.contract.solidity" - }, - { - "match": "\\b(addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\\b", - "name": "support.function.math.solidity" - }, - { - "match": "\\b(blockhash|gasleft)\\b", - "name": "variable.language.transaction.solidity" - }, - { - "match": "\\b(type)\\b", - "name": "variable.language.type.solidity" - }, - { - "match": "\\b\\.(send|call|delegatecall|staticcall|callcode|creationCode|runtimeCode)\\b", - "name": "support.function.transaction.security.solidity" - }, - { - "match": "\\b\\.(transfer)\\b", - "name": "support.function.transaction.solidity" - } - ] - }, - "declaration": { - "patterns": [ - { - "include": "#declaration-contract" - }, - { - "include": "#declaration-interface" - }, - { - "include": "#declaration-library" - }, - { "include": "#declaration-visibility"}, - { - "include": "#declaration-struct" - }, - { - "include": "#declaration-event" - }, - { - "include": "#declaration-enum" - }, - { - "include": "#declaration-function-fallback" - }, - { - "include": "#declaration-function" - }, - - { - "include": "#declaration-constructor" - }, - { - "include": "#declaration-modifier" - }, - { - "include": "#declaration-mapping" - } - ] - }, - "declaration-contract": { - "patterns": [ - { - "match": "\\b(contract)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.contract.solidity" - }, - "3": { - "name": "entity.name.type.contract.solidity" - } - } - }, - { - "match": "\\b(is)\\b", - "name": "storage.modifier.is.solidity" - } - ] - }, - "declaration-interface": { - "match": "\\b(interface)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.interface.solidity" - }, - "3": { - "name": "entity.name.type.interface.solidity" - } - } - }, - "declaration-library": { - "match": "\\b(library)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.library.solidity" - }, - "3": { - "name": "entity.name.type.library.solidity" - } - } - }, - "declaration-struct": { - "match": "\\b(struct)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.struct.solidity" - }, - "3": { - "name": "entity.name.type.struct.solidity" - } - } - }, - "declaration-event": { - "match": "\\b(event)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.event.solidity" - }, - "3": { - "name": "entity.name.type.event.solidity" - } - } - }, - "declaration-enum": { - "match": "\\b(enum)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.enum.solidity" - }, - "3": { - "name": "entity.name.type.enum.solidity" - } - } - }, - "declaration-constructor": { - "begin": "\\b(constructor)\\s*\\b", - "beginCaptures": { - "1": { - "name": "storage.type.constructor.solidity" - } - }, - "end": "({)", - "endCaptures": { - "1": { - "name": "punctuation.block.solidity" - } - }, - "patterns": [ - { - "include": "#method-head" - } - - ] - }, - "declaration-function-fallback": { - "match": "\\b(function)\\s*\\(\\s*\\)", - "name": "storage.type.function.fallback.solidity" - }, - "declaration-function": { - "begin": "\\b(function)\\s+([A-Za-z_]\\w*)\\b", - "beginCaptures": { - "1": { - "name": "storage.type.function.solidity" - }, - "2": { - "name": "entity.name.function.solidity" - } - }, - "end": "({)", - "endCaptures": { - "1": { - "name": "punctuation.block.solidity" - } - }, - "patterns": [ - { - "include": "#method-head" - } - - ] - }, - "declaration-modifier": { - "match": "\\b(modifier)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.modifier.solidity" - }, - "3": { - "name": "entity.name.function.solidity" - } - } - }, - "declaration-visibility": { - "patterns": [ - { - "match": "\\b(private|internal|constant|pure|view|nonpayable|indexed)\\b", - "name": "storage.type.modifier.keyword.solidity" - }, - { - "match": "\\b(public|external|payable|inherited|storage|memory|calldata)\\b", - "name": "storage.type.modifier.keyword.extendedscope.solidity" - } - ] - }, - "declaration-mapping": { - "match": "\\b(mapping)\\b", - "name": "storage.type.mapping.solidity" - }, - "method-head": { - "patterns": [ - { - "include": "#punctuation" - }, - { - "include": "#comment" - }, - { - "include": "#control" - }, - { - "include": "#constant" - }, - { - "include": "#number" - }, - { - "include": "#string" - }, - { - "include": "#type" - }, - { - "include": "#global" - }, - { - "include": "#declaration" - }, - { - "include": "#modifier-call" - } - ] - }, - "function-call": { - "match": "\\b([A-Za-z_]\\w*)\\s*\\(", - "captures": { - "1": { - "name": "entity.name.function.solidity" - } - } - }, - "modifier-call": { - "match": "\\b([A-Za-z_]\\w*)\\s*\\(", - "captures": { - "1": { - "name": "entity.name.modifier.solidity" - } - } - }, - "assembly": { - "patterns": [ - { - "match": "\\b(assembly)\\b", - "name": "keyword.control.assembly.solidity" - }, - { - "match": "\\b(let)\\b", - "name": "storage.type.assembly.solidity" - } - ] - }, - "punctuation": { - "patterns": [ - { - "match": ";", - "name": "punctuation.terminator.statement.solidity" - }, - { - "match": "\\.", - "name": "punctuation.accessor.solidity" - }, - { - "match": ",", - "name": "punctuation.separator.solidity" - }, - { - "match": "({|})", - "name": "punctuation.block.solidity" - } - ] - }, - "comment-todo": { - "match": "(?i)\\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|COMBAK|TEMP|SUPPRESS|LINT|\\w+-disable|\\w+-suppress)\\b(?-i)", - "name": "keyword.comment.todo.solidity" - } - }, - "scopeName": "source.solidity.security", - "uuid": "ad87d2cd-8575-4afe-984e-9421a3788933" -} diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 6dfb1df..0000000 --- a/package-lock.json +++ /dev/null @@ -1,662 +0,0 @@ -{ - "name": "solidity-lang", - "version": "1.2.1", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "azure-devops-node-api": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-11.0.1.tgz", - "integrity": "sha512-YMdjAw9l5p/6leiyIloxj3k7VIvYThKjvqgiQn88r3nhT93ENwsoDS3A83CyJ4uTWzCZ5f5jCi6c27rTU5Pz+A==", - "dev": true, - "requires": { - "tunnel": "0.0.6", - "typed-rest-client": "^1.8.4" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", - "dev": true - }, - "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "cheerio": { - "version": "1.0.0-rc.10", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.10.tgz", - "integrity": "sha512-g0J0q/O6mW8z5zxQ3A8E8J1hUgp4SMOvEoW/x84OwyHKe/Zccz83PVT4y5Crcr530FV6NgmKI1qvGTKVl9XXVw==", - "dev": true, - "requires": { - "cheerio-select": "^1.5.0", - "dom-serializer": "^1.3.2", - "domhandler": "^4.2.0", - "htmlparser2": "^6.1.0", - "parse5": "^6.0.1", - "parse5-htmlparser2-tree-adapter": "^6.0.1", - "tslib": "^2.2.0" - } - }, - "cheerio-select": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-1.5.0.tgz", - "integrity": "sha512-qocaHPv5ypefh6YNxvnbABM07KMxExbtbfuJoIie3iZXX1ERwYmJcIiRrr9H05ucQP1k28dav8rpdDgjQd8drg==", - "dev": true, - "requires": { - "css-select": "^4.1.3", - "css-what": "^5.0.1", - "domelementtype": "^2.2.0", - "domhandler": "^4.2.0", - "domutils": "^2.7.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "css-select": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.1.3.tgz", - "integrity": "sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA==", - "dev": true, - "requires": { - "boolbase": "^1.0.0", - "css-what": "^5.0.0", - "domhandler": "^4.2.0", - "domutils": "^2.6.0", - "nth-check": "^2.0.0" - } - }, - "css-what": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-5.0.1.tgz", - "integrity": "sha512-FYDTSHb/7KXsWICVsxdmiExPjCfRC4qRFBdVwv7Ax9hMnvMmEjP9RfxTEZ3qPZGmADDn2vAKSo9UcN1jKVYscg==", - "dev": true - }, - "denodeify": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/denodeify/-/denodeify-1.2.1.tgz", - "integrity": "sha1-OjYof1A05pnnV3kBBSwubJQlFjE=", - "dev": true - }, - "dom-serializer": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", - "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1", - "domhandler": "^4.2.0", - "entities": "^2.0.0" - } - }, - "domelementtype": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", - "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==", - "dev": true - }, - "domhandler": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz", - "integrity": "sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==", - "dev": true, - "requires": { - "domelementtype": "^2.2.0" - } - }, - "domutils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.7.0.tgz", - "integrity": "sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg==", - "dev": true, - "requires": { - "dom-serializer": "^1.0.1", - "domelementtype": "^2.2.0", - "domhandler": "^4.2.0" - } - }, - "entities": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", - "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", - "dev": true, - "requires": { - "pend": "~1.2.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "dev": true, - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - } - }, - "glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbols": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", - "dev": true - }, - "htmlparser2": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", - "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==", - "dev": true, - "requires": { - "domelementtype": "^2.0.1", - "domhandler": "^4.0.0", - "domutils": "^2.5.2", - "entities": "^2.0.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", - "dev": true - }, - "linkify-it": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", - "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", - "dev": true, - "requires": { - "uc.micro": "^1.0.1" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "markdown-it": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", - "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "entities": "~2.0.0", - "linkify-it": "^2.0.0", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - }, - "dependencies": { - "entities": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", - "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==", - "dev": true - } - } - }, - "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", - "dev": true - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true - }, - "nth-check": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz", - "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==", - "dev": true, - "requires": { - "boolbase": "^1.0.0" - } - }, - "object-inspect": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", - "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "parse-semver": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/parse-semver/-/parse-semver-1.1.1.tgz", - "integrity": "sha1-mkr9bfBj3Egm+T+6SpnPIj9mbLg=", - "dev": true, - "requires": { - "semver": "^5.1.0" - } - }, - "parse5": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", - "dev": true - }, - "parse5-htmlparser2-tree-adapter": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", - "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", - "dev": true, - "requires": { - "parse5": "^6.0.1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", - "dev": true - }, - "prettier": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", - "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", - "dev": true - }, - "qs": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", - "integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==", - "dev": true, - "requires": { - "side-channel": "^1.0.4" - } - }, - "read": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", - "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", - "dev": true, - "requires": { - "mute-stream": "~0.0.4" - } - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - }, - "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dev": true, - "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, - "requires": { - "rimraf": "^3.0.0" - } - }, - "tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==", - "dev": true - }, - "tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", - "dev": true - }, - "typed-rest-client": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.4.tgz", - "integrity": "sha512-MyfKKYzk3I6/QQp6e1T50py4qg+c+9BzOEl2rBmQIpStwNUoqQ73An+Tkfy9YuV7O+o2mpVVJpe+fH//POZkbg==", - "dev": true, - "requires": { - "qs": "^6.9.1", - "tunnel": "0.0.6", - "underscore": "^1.12.1" - } - }, - "uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true - }, - "underscore": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.1.tgz", - "integrity": "sha512-hzSoAVtJF+3ZtiFX0VgfFPHEDRm7Y/QPjGyNo4TVdnDTdft3tr8hEkD25a1jC+TjTuE7tkHGKkhwCgs9dgBB2g==", - "dev": true - }, - "url-join": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz", - "integrity": "sha1-dBxsL0WWxIMNZxhGCSDQySIC3Hg=", - "dev": true - }, - "vsce": { - "version": "1.96.1", - "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.96.1.tgz", - "integrity": "sha512-KnEVqjfc1dXrpZsbJ8J7B9VQ7GAAx8o5RqBNk42Srv1KF9+e2/aXchQHe9QZxeUs/FiliHoMGpGvnHTXwKIT2A==", - "dev": true, - "requires": { - "azure-devops-node-api": "^11.0.1", - "chalk": "^2.4.2", - "cheerio": "^1.0.0-rc.9", - "commander": "^6.1.0", - "denodeify": "^1.2.1", - "glob": "^7.0.6", - "leven": "^3.1.0", - "lodash": "^4.17.15", - "markdown-it": "^10.0.0", - "mime": "^1.3.4", - "minimatch": "^3.0.3", - "osenv": "^0.1.3", - "parse-semver": "^1.1.1", - "read": "^1.0.7", - "semver": "^5.1.0", - "tmp": "^0.2.1", - "typed-rest-client": "^1.8.4", - "url-join": "^1.1.0", - "yauzl": "^2.3.1", - "yazl": "^2.2.2" - } - }, - "url-join": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz", - "integrity": "sha1-dBxsL0WWxIMNZxhGCSDQySIC3Hg=", - "dev": true - }, - "vsce": { - "version": "1.96.1", - "resolved": "https://registry.npmjs.org/vsce/-/vsce-1.96.1.tgz", - "integrity": "sha512-KnEVqjfc1dXrpZsbJ8J7B9VQ7GAAx8o5RqBNk42Srv1KF9+e2/aXchQHe9QZxeUs/FiliHoMGpGvnHTXwKIT2A==", - "dev": true, - "requires": { - "azure-devops-node-api": "^11.0.1", - "chalk": "^2.4.2", - "cheerio": "^1.0.0-rc.9", - "commander": "^6.1.0", - "denodeify": "^1.2.1", - "glob": "^7.0.6", - "leven": "^3.1.0", - "lodash": "^4.17.15", - "markdown-it": "^10.0.0", - "mime": "^1.3.4", - "minimatch": "^3.0.3", - "osenv": "^0.1.3", - "parse-semver": "^1.1.1", - "read": "^1.0.7", - "semver": "^5.1.0", - "tmp": "^0.2.1", - "typed-rest-client": "^1.8.4", - "url-join": "^1.1.0", - "yauzl": "^2.3.1", - "yazl": "^2.2.2" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", - "dev": true, - "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" - } - }, - "yazl": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", - "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", - "dev": true, - "requires": { - "buffer-crc32": "~0.2.3" - } - } - } -} diff --git a/package.json b/package.json index 3c30658..14075e1 100644 --- a/package.json +++ b/package.json @@ -1,54 +1,82 @@ { - "name": "solidity-lang", - "displayName": "solidity-syntax", - "description": "solidity syntax highlighting, thats it", - "publisher": "ContractShark", - "icon": "assets/icon.png", - "license": "MIT", - "repository": "https://github.com/contractshark/vscode-extenstion.git", - "version": "1.2.1", - "engines": { - "vscode": "^1.55.0" - }, - "scripts": { - "ci": "npm i -g vsce && npm run build", - "build": "npx vsce package", - "test": "npx ajv-cli test -s tests/tmLanguage.schema.json -d syntaxes/solidity.tmLanguage.json --valid" - }, - "categories": [ - "Programming Languages" - ], - "activationEvents": [ - "onLanguage:solidity" - ], - "main": "./extension", - "contributes": { - "languages": [ - { - "id": "solidity", - "aliases": [ - "Solidity", - "solidity" - ], - "extensions": [ - ".sol", - ".solidity" - ], - "configuration": "./language-configuration.json" - } + "name": "solidity-lang", + "displayName": "solidity-syntax", + "description": "solidity syntax highlighting, thats it", + "publisher": "ContractShark", + "icon": "assets/icon.png", + "license": "MIT", + "version": "1.3.0", + "engines": { + "vscode": "^1.55.0" + }, + "keywords": [ + "solidity", + "ethereum", + "blockchain", + "security", + "audit", + "review", + "developer", + "solidity security", + "solidity audit", + "language", + "theme" + ], + "extensionKind": [ + "ui", + "workspace" + ], + "scripts": { + "ci": "npm i -g vsce && npm run build", + "build": "npx vsce package", + "test": "npx ajv-cli test -s tests/tmLanguage.schema.json -d syntaxes/solidity.tmLanguage.json --valid" + }, + "bugs": { + "url": "https://github.com/contractshark/scode-extenstion/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/contractshark/vscode-extenstion.git" + }, + "categories": [ + "Programming Languages" + ], + "configurationDefaults": { + "solidity": { + "editor.semanticHighlighting.enabled": true + } + }, + "contributes": { + "languages": [ + { + "id": "solidity", + "aliases": [ + "Solidity", + "solidity" ], - "grammars": [ - { - "language": "solidity", - "scopeName": "source.solidity", - "path": "./syntaxes/solidity.tmLanguage.json" - } + "extensions": [ + ".sol", + ".solidity" + ], + "configuration": "./language-configuration.json" + } + ], + "grammars": [ + { + "language": "solidity", + "scopeName": "source.solidity", + "path": "./syntaxes/solidity.tmLanguage.json", + "injectTo": [ + "source.solidity" ] - }, - "devDependencies": { - "ajv": "8.1.0", - "ajv-cli": "5.0.0", - "prettier": "2.3.2", - "vsce": "^1.96.1" - } + } + ] + }, + "devDependencies": { + "@vscode/test-web": "^0.0.15", + "ajv": "8.1.0", + "ajv-cli": "5.0.0", + "prettier": "2.3.2", + "vsce": "^1.96.1" + } } diff --git a/parser.js b/parser.js deleted file mode 100644 index e1eda0d..0000000 --- a/parser.js +++ /dev/null @@ -1,171 +0,0 @@ -"use strict"; - -const BUILTINS = [ - 'gasleft', 'require', 'assert', 'revert', 'addmod', 'mulmod', 'keccak256', - 'sha256', 'sha3', 'ripemd160', 'ecrecover', -]; - -function isLowerCase(str) { - return str === str.toLowerCase(); -} - -const parserHelpers = { - isRegularFunctionCall: (node, contractNames, eventNames, structNames) => { - const expr = node.expression; - return expr && expr.type === 'Identifier' - && !contractNames.includes(expr.name) - && !eventNames.includes(expr.name) - && !structNames.includes(expr.name) - && !BUILTINS.includes(expr.name); - }, - - isMemberAccess: node => { - const expr = node.expression; - return expr.type === 'MemberAccess' && !['push', 'pop', 'encode', 'encodePacked', 'encodeWithSelector', 'encodeWithSignature', 'decode'].includes(expr.memberName); - }, - - isIndexAccess: node => { - const expr = node.expression; - return expr.type === 'IndexAccess'; - }, - - isMemberAccessOfAddress: node => { - const expr = node.expression.expression; - return expr.type === 'FunctionCall' - && expr.expression.hasOwnProperty('typeName') - && expr.expression.typeName.name === 'address'; - }, - - isAContractTypecast: (node, contractNames) => { - const expr = node.expression.expression; - // @TODO: replace lowercase for better filtering - return expr.type === 'FunctionCall' - && expr.expression.hasOwnProperty('name') - && contractNames.includes(expr.expression.name[0]); - }, - - isUserDefinedDeclaration: node => { - return node.hasOwnProperty('typeName')&& node.typeName.type === 'UserDefinedTypeName'; - }, - - isElementaryTypeDeclaration: node => { - return node.hasOwnProperty('typeName')&& node.typeName.type === 'ElementaryTypeName'; - }, - - isArrayDeclaration: node => { - return node.hasOwnProperty('typeName')&& node.typeName.type === 'ArrayTypeName'; - }, - - isMappingDeclaration: node => { - return node.hasOwnProperty('typeName')&& node.typeName.type === 'Mapping'; - }, - - isAddressDeclaration: node => { - return node.hasOwnProperty('typeName') - && node.typeName.type === 'ElementaryTypeName' - && node.typeName.name === 'address'; - }, - - isElementaryTypecast: node => { - return node.hasOwnProperty('type') - && node.type === 'FunctionCall' - && node.hasOwnProperty('expression') - && node.expression.type === 'TypeNameExpression' - && node.expression.typeName.type === 'ElementaryTypeName'; - }, - - isSpecialVariable: node => { - // now (same as block.timestamp) - if( - node.hasOwnProperty('type') - && node.type === 'Identifier' - && node.name === 'now' - ) { - return true; - // any block. special variable - } else if( - node.hasOwnProperty('type') - && node.type === 'MemberAccess' - && node.hasOwnProperty('expression') - && node.expression.type === 'Identifier' - && node.expression.name === 'block' - ) { - return true; - // any msg. special variable - } else if( - node.hasOwnProperty('type') - && node.type === 'MemberAccess' - && node.hasOwnProperty('expression') - && node.expression.type === 'Identifier' - && node.expression.name === 'msg' - ) { - return true; - // any tx. special variable - } else if( - node.hasOwnProperty('type') - && node.type === 'MemberAccess' - && node.hasOwnProperty('expression') - && node.expression.type === 'Identifier' - && node.expression.name === 'tx' - ) { - return true; - // if not then... return false - } else { - return false; - } - }, - - getSpecialVariableType: node => { - // now (same as block.timestamp) - if( - node.hasOwnProperty('type') - && node.type === 'Identifier' - && node.name === 'now' - ) { - return 'uint256'; - - } else if( - node.hasOwnProperty('type') - && node.type === 'MemberAccess' - && node.hasOwnProperty('expression') - && node.expression.hasOwnProperty('type') - && node.expression.type === 'Identifier' - ) { - // in case it is block. special variable - if(node.expression.name === 'block') { - if(node.memberName === 'coinbase') { - return 'address'; - } else { - return 'uint256'; - } - } - - // or msg. special variable - else if(node.expression.name === 'msg') { - if(node.memberName === 'data') { - return 'bytes'; - } else if(node.memberName === 'sender') { - return 'address'; - } else if(node.memberName === 'sig') { - return 'bytes4'; - } else if(node.memberName === 'value') { - return 'uint256'; - } - } - - // or tx. special variable - else if(node.expression.name === 'tx') { - if(node.memberName === 'origin') { - return 'address'; - } else if(node.memberName === 'gasprice') { - return 'uint256'; - } - } - } else { - // if not a special variable, return false - return null; - } - }, -}; - -module.exports = parserHelpers; \ No newline at end of file diff --git a/parserHelper.js b/parserHelper.js deleted file mode 100644 index 7c135df..0000000 --- a/parserHelper.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -const BUILTINS = [ - 'gasleft', 'require', 'assert', 'revert', 'addmod', 'mulmod', 'keccak256', - 'sha256', 'sha3', 'ripemd160', 'ecrecover', -]; - -function isLowerCase(str) { - return str === str.toLowerCase(); -} - -const parserHelpers = { - isRegularFunctionCall: node => { - const expr = node.expression; - // @TODO: replace lowercase for better filtering - return expr.type === 'Identifier' && isLowerCase(expr.name[0]) && !BUILTINS.includes(expr.name); - }, - - isMemberAccess: node => { - const expr = node.expression; - return expr.type === 'MemberAccess' && !['push', 'pop'].includes(expr.memberName); - }, - - isMemberAccessOfAddress: node => { - const expr = node.expression.expression; - return expr.type === 'FunctionCall' - && expr.expression.hasOwnProperty('typeName') - && expr.expression.typeName.name === 'address'; - }, - - isAContractTypecast: node => { - const expr = node.expression.expression; - // @TODO: replace lowercase for better filtering - return expr.type === 'FunctionCall' - && expr.expression.hasOwnProperty('name') - && !isLowerCase(expr.expression.name[0]); - }, - - isUserDefinedDeclaration: node => { - return node.hasOwnProperty('typeName') && node.typeName.hasOwnProperty('type') && node.typeName.type === 'UserDefinedTypeName'; - }, - - isAddressDeclaration: node => { - return node.hasOwnProperty('typeName') - && node.typeName.hasOwnProperty('type') - && node.typeName.type === 'ElementaryTypeName' - && node.typeName.name === 'address'; - }, -}; - -module.exports = parserHelpers; \ No newline at end of file diff --git a/settings.js b/settings.js deleted file mode 100644 index 5208df0..0000000 --- a/settings.js +++ /dev/null @@ -1,18 +0,0 @@ -/** -* @configuration Solidity -* @exports LANGUAGE_ID -*/ - -'use strict'; -const vscode = require('vscode'); - -const LANGUAGE_ID = "solidity"; - -function extensionConfig() { - return vscode.workspace.getConfiguration(LANGUAGE_ID); -} - -module.exports = { - LANGUAGE_ID: LANGUAGE_ID, - extensionConfig: extensionConfig -}; diff --git a/syntaxes/legacy.solidity.tmLanguage.json b/syntaxes/legacy.solidity.tmLanguage.json new file mode 100644 index 0000000..44a6aa0 --- /dev/null +++ b/syntaxes/legacy.solidity.tmLanguage.json @@ -0,0 +1,1268 @@ +{ + "fileTypes": ["sol"], + "name": "solidity", + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "patterns": [ + { + "include": "#natspec" + }, + { + "include": "#comment" + }, + { + "include": "#operator" + }, + { + "include": "#global" + }, + { + "include": "#control" + }, + { + "include": "#constant" + }, + { + "include": "#primitive" + }, + { + "include": "#type-primitive" + }, + { + "include": "#type-modifier-extended-scope" + }, + { + "include": "#declaration" + }, + { + "include": "#function-call" + }, + { + "include": "#assembly" + }, + { + "include": "#punctuation" + } + ], + "repository": { + "natspec": { + "patterns": [ + { + "begin": "/\\*\\*", + "end": "\\*/", + "name": "comment.block.documentation", + "patterns": [ + { + "include": "#natspec-tags" + } + ] + }, + { + "begin": "///", + "end": "$", + "name": "comment.block.documentation", + "patterns": [ + { + "include": "#natspec-tags" + } + ] + } + ] + }, + "natspec-tags": { + "patterns": [ + { + "include": "#comment-todo" + }, + { + "include": "#natspec-tag-title" + }, + { + "include": "#natspec-tag-author" + }, + { + "include": "#natspec-tag-notice" + }, + { + "include": "#natspec-tag-dev" + }, + { + "include": "#natspec-tag-param" + }, + { + "include": "#natspec-tag-return" + } + ] + }, + "natspec-tag-title": { + "match": "(@title)\\b", + "name": "storage.type.title.natspec" + }, + "natspec-tag-author": { + "match": "(@author)\\b", + "name": "storage.type.author.natspec" + }, + "natspec-tag-notice": { + "match": "(@notice)\\b", + "name": "storage.type.dev.natspec" + }, + "natspec-tag-dev": { + "match": "(@dev)\\b", + "name": "storage.type.dev.natspec" + }, + "natspec-tag-param": { + "match": "(@param)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.param.natspec" + }, + "3": { + "name": "variable.other.natspec" + } + } + }, + "natspec-tag-return": { + "match": "(@return)\\b", + "name": "storage.type.return.natspec" + }, + "comment": { + "patterns": [ + { + "include": "#comment-line" + }, + { + "include": "#comment-block" + } + ] + }, + "comment-todo": { + "match": "(?i)\\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|COMBAK|TEMP|SUPPRESS|LINT|\\w+-disable|\\w+-suppress)\\b(?-i)", + "name": "keyword.comment.todo" + }, + "comment-line": { + "begin": "(?(?!>)|>=|\\&\\&|\\|\\||\\:(?!=)|\\?)", + "name": "keyword.operator.logic" + }, + "operator-mapping": { + "match": "(=>)", + "name": "keyword.operator.mapping" + }, + "operator-arithmetic": { + "match": "(\\+|\\-|\\/|\\*)", + "name": "keyword.operator.arithmetic" + }, + "operator-binary": { + "match": "(\\^|\\&|\\||<<|>>)", + "name": "keyword.operator.binary" + }, + "operator-assignment": { + "match": "(\\:?=)", + "name": "keyword.operator.assignment" + }, + "control": { + "patterns": [ + { + "include": "#control-flow" + }, + { + "include": "#control-using" + }, + { + "include": "#control-import" + }, + { + "include": "#control-pragma" + }, + { + "include": "#control-underscore" + }, + { + "include": "#control-unchecked" + }, + { + "include": "#control-other" + } + ] + }, + "control-flow": { + "patterns": [ + { + "match": "\\b(if|else|for|while|do|break|continue|try|catch|finally|throw|return)\\b", + "name": "keyword.control.flow" + }, + { + "begin": "\\b(returns)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.flow.return" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#declaration-function-parameters" + } + ] + } + ] + }, + "control-using": { + "patterns": [ + { + "match": "\\b(using)\\b\\s+\\b([A-Za-z\\d_]+)\\b\\s+\\b(for)\\b\\s+\\b([A-Za-z\\d_]+)", + "captures": { + "1": { + "name": "keyword.control.using" + }, + "2": { + "name": "entity.name.type.library" + }, + "3": { + "name": "keyword.control.for" + }, + "4": { + "name": "entity.name.type" + } + } + }, + { + "match": "\\b(using)\\b", + "name": "keyword.control.using" + } + ] + }, + "control-import": { + "patterns": [ + { + "begin": "\\b(import)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.import" + } + }, + "end": "(?=\\;)", + "patterns": [ + { + "begin": "((?=\\{))", + "end": "((?=\\}))", + "patterns": [ + { + "match": "\\b(\\w+)\\b", + "name": "entity.name.type.interface" + } + ] + }, + { + "match": "\\b(from)\\b", + "name": "keyword.control.import.from" + }, + { + "include": "#string" + }, + { + "include": "#punctuation" + } + ] + }, + { + "match": "\\b(import)\\b", + "name": "keyword.control.import" + } + ] + }, + "control-unchecked": { + "match": "\\b(unchecked)\\b", + "name": "keyword.control.unchecked" + }, + "control-import": { + "match": "\\b(import)\\b", + "name": "keyword.control.import.solidity" + }, + "control-pragma": { + "match": "\\b(pragma)(?:\\s+([A-Za-z_]\\w+)\\s+([^\\s]+))?\\b", + "captures": { + "1": { + "name": "keyword.control.pragma.solidity" + }, + "2": { + "name": "entity.name.tag.pragma.solidity" + }, + "3": { + "name": "constant.other.pragma.solidity" + } + } + }, + "control-underscore": { + "match": "\\b(_)\\b", + "name": "constant.other.underscore.solidity" + }, + "control-other": { + "match": "\\b(new|delete|emit)\\b", + "name": "keyword.control.solidity" + }, + "constant": { + "patterns": [ + { + "include": "#constant-boolean" + }, + { + "include": "#constant-time" + }, + { + "include": "#constant-currency" + } + ] + }, + "constant-boolean": { + "match": "\\b(true|false)\\b", + "name": "constant.language.boolean" + }, + "constant-time": { + "match": "\\b(seconds|minutes|hours|days|weeks|years)\\b", + "name": "constant.language.time" + }, + "constant-currency": { + "match": "\\b(ether|wei|finney|szabo)\\b", + "name": "constant.language.currency" + }, + "number": { + "patterns": [ + { + "include": "#number-decimal" + }, + { + "include": "#number-hex" + }, + { + "include": "#number-scientific" + } + ] + }, + "number-decimal": { + "match": "\\b([0-9_]+(\\.[0-9_]+)?)\\b", + "name": "constant.numeric.decimal" + }, + "number-hex": { + "match": "\\b(0[xX][a-fA-F0-9]+)\\b", + "name": "constant.numeric.hexadecimal" + }, + "number-scientific": { + "match": "\\b(?:0\\.(?:0[1-9]|[1-9][0-9_]?)|[1-9][0-9_]*(?:\\.\\d{1,2})?)(?:e[+-]?[0-9_]+)?", + "name": "constant.numeric.scientific" + }, + "string": { + "patterns": [ + { + "match": "\\\".*?\\\"", + "name": "string.quoted.double" + }, + { + "match": "\\'.*?\\'", + "name": "string.quoted.single" + } + ] + }, + "primitive": { + "patterns": [ + { + "include": "#number-decimal" + }, + { + "include": "#number-hex" + }, + { + "include": "#number-scientific" + }, + { + "include": "#string" + } + ] + }, + "type-primitive": { + "patterns": [ + { + "begin": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b(?:\\[\\])(\\()", + "beginCaptures": { + "1": { + "name": "support.type.primitive" + } + }, + "end": "(\\))", + "patterns": [ + { + "include": "#primitive" + }, + { + "include": "#punctuation" + }, + { + "include": "#global" + }, + { + "include": "#variable" + } + ] + }, + { + "match": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b", + "name": "support.type.primitive" + } + ] + }, + "global": { + "patterns": [ + { + "include": "#global-variables" + }, + { + "include": "#global-functions" + } + ] + }, + "global-variables": { + "patterns": [ + { + "match": "\\b(this)\\b", + "name": "variable.language.this" + }, + { + "match": "\\b(super)\\b", + "name": "variable.language.super" + }, + { + "match": "\\b(abi)\\b", + "name": "variable.language.builtin.abi" + }, + { + "match": "\\b(msg\\.sender|msg|block|tx|now)\\b", + "name": "variable.language.transaction" + }, + { + "match": "\\b(tx\\.origin|tx\\.gasprice|msg\\.data|msg\\.sig|msg\\.value)\\b", + "name": "variable.language.transaction" + } + ] + }, + "global-functions": { + "patterns": [ + { + "match": "\\b(require|assert|revert)\\b", + "name": "keyword.control.exceptions" + }, + { + "match": "\\b(selfdestruct|suicide)\\b", + "name": "keyword.control.contract" + }, + { + "match": "\\b(addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\\b", + "name": "support.function.math" + }, + { + "match": "\\b(unicode)\\b", + "name": "support.function.string" + }, + { + "match": "\\b(blockhash|gasleft)\\b", + "name": "variable.language.transaction" + }, + { + "match": "\\b(type)\\b", + "name": "variable.language.type" + } + ] + }, + "type-modifier-access": { + "match": "\\b(internal|external|private|public)\\b", + "name": "storage.type.modifier.access" + }, + "type-modifier-payable": { + "match": "\\b(nonpayable|payable)\\b", + "name": "storage.type.modifier.payable" + }, + "type-modifier-constant": { + "match": "\\b(constant)\\b", + "name": "storage.type.modifier.readonly" + }, + "type-modifier-immutable": { + "match": "\\b(immutable)\\b", + "name": "storage.type.modifier.readonly" + }, + "type-modifier-extended-scope": { + "match": "\\b(pure|view|inherited|indexed|storage|memory|virtual|calldata|override|abstract)\\b", + "name": "storage.type.modifier.extendedscope" + }, + "variable": { + "patterns": [ + { + "match": "\\b(\\_\\w+)\\b", + "captures": { + "1": { + "name": "variable.parameter.function" + } + } + }, + { + "match": "(?:\\.)(\\w+)\\b", + "captures": { + "1": { + "name": "support.variable.property" + } + } + }, + { + "match": "\\b(\\w+)\\b", + "captures": { + "1": { + "name": "variable.parameter.other" + } + } + } + ] + }, + "modifier-call": { + "patterns": [ + { + "include": "#function-call" + }, + { + "match": "\\b(\\w+)\\b", + "name": "entity.name.function.modifier" + } + ] + }, + "declaration": { + "patterns": [ + { + "include": "#declaration-contract" + }, + { + "include": "#declaration-interface" + }, + { + "include": "#declaration-library" + }, + { + "include": "#declaration-function" + }, + { + "include": "#declaration-modifier" + }, + { + "include": "#declaration-constructor" + }, + { + "include": "#declaration-event" + }, + { + "include": "#declaration-storage" + }, + { + "include": "#declaration-error" + } + ] + }, + "declaration-storage-field": { + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#control" + }, + { + "include": "#type-primitive" + }, + { + "include": "#type-modifier-access" + }, + "global-variables": { + "patterns": [ + + { + "match": "\\b(this)\\b", + "name": "variable.language.this.solidity" + }, + { + "match": "\\b(super)\\b", + "name": "variable.language.super.solidity" + }, + { + "match": "\\b(abi)\\b", + "name": "variable.language.builtin.abi.solidity" + }, + { + "match": "\\b(tx\\.origin|tx\\.gasprice|msg\\.data|msg\\.sig|msg\\.value)\\b", + "name": "variable.language.transaction.security.solidity" + }, + { + "match": "\\b(msg\\.sender|msg|block|tx|now)\\b", + "name": "variable.language.transaction.solidity" + } + ] + }, + "global-functions": { + "patterns": [ + { + "match": "\\b(require|assert|revert)\\b", + "name": "keyword.control.exceptions.solidity" + }, + { + "match": "\\b(selfdestruct|suicide)\\b", + "name": "keyword.control.contract.solidity" + }, + { + "match": "\\b(addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\\b", + "name": "support.function.math.solidity" + }, + { + "match": "\\b(blockhash|gasleft)\\b", + "name": "variable.language.transaction.solidity" + }, + { + "match": "\\b(type)\\b", + "name": "variable.language.type.solidity" + }, + { + "match": "\\b\\.(send|call|delegatecall|staticcall|callcode|creationCode|runtimeCode)\\b", + "name": "support.function.transaction.solidity" + }, + { + "match": "\\b\\.(transfer)\\b", + "name": "support.function.transaction.solidity" + } + ] + }, + "declaration": { + "patterns": [ + { + "include": "#declaration-contract" + }, + { + "include": "#declaration-interface" + }, + { + "include": "#declaration-library" + }, + { "include": "#declaration-visibility"}, + { + "include": "#declaration-struct" + }, + { + "include": "#declaration-event" + }, + { + "include": "#declaration-enum" + }, + { + "include": "#declaration-function-fallback" + }, + { + "include": "#declaration-function" + }, + + { + "include": "#declaration-constructor" + }, + { + "include": "#declaration-modifier" + }, + { + "include": "#declaration-mapping" + } + ] + }, + { + "include": "#type-modifier-constant" + }, + { + "include": "#primitive" + }, + { + "include": "#constant" + }, + { + "include": "#operator" + }, + { + "include": "#punctuation" + } + ] + }, + "declaration-storage": { + "patterns": [ + { + "include": "#declaration-storage-mapping" + }, + { + "include": "#declaration-struct" + }, + { + "include": "#declaration-enum" + }, + { + "include": "#declaration-storage-field" + } + ] + }, + "declaration-contract": { + "patterns": [ + { + "match": "\\b(contract)\\b\\s+(\\w+)\\b\\s*(?=\\{)", + "captures": { + "1": { + "name": "storage.type.contract" + }, + "2": { + "name": "entity.name.type.contract" + } + } + }, + { + "begin": "\\b(contract)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+", + "end": "(?=\\{)", + "beginCaptures": { + "1": { + "name": "storage.type.contract" + }, + "2": { + "name": "entity.name.type.contract" + }, + "3": { + "name": "storage.modifier.is" + } + }, + "patterns": [ + { + "match": "\\b(\\w+)\\b", + "name": "entity.name.type.contract.extend" + } + ] + } + ] + }, + "declaration-interface": { + "patterns": [ + { + "match": "\\b(interface)\\b\\s+(\\w+)\\b\\s*(?=\\{)", + "captures": { + "1": { + "name": "storage.type.interface" + }, + "2": { + "name": "entity.name.type.interface" + } + } + }, + { + "begin": "\\b(interface)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+", + "end": "(?=\\{)", + "beginCaptures": { + "1": { + "name": "storage.type.interface" + }, + "2": { + "name": "entity.name.type.interface" + }, + "3": { + "name": "storage.modifier.is" + } + }, + "patterns": [ + { + "match": "\\b(\\w+)\\b", + "name": "entity.name.type.interface.extend" + } + ] + } + ] + }, + "declaration-library": { + "match": "\\b(library)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.library" + }, + "3": { + "name": "entity.name.type.library" + } + } + }, + "declaration-struct": { + "patterns": [ + { + "match": "\\b(struct)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.struct" + }, + "3": { + "name": "entity.name.type.struct" + } + } + }, + { + "begin": "\\b(struct)\\b\\s*(\\w+)?\\b\\s*(?=\\{)", + "beginCaptures": { + "1": { + "name": "storage.type.struct" + }, + "2": { + "name": "entity.name.type.struct" + } + }, + "end": "(?=\\})", + "patterns": [ + { + "include": "#type-primitive" + }, + { + "include": "#variable" + }, + { + "include": "#punctuation" + }, + { + "include": "#comment" + } + ] + } + ] + }, + "declaration-event": { + "patterns": [ + { + "begin": "\\b(event)\\b(?:\\s+(\\w+)\\b)?", + "end": "(?=\\))", + "beginCaptures": { + "1": { + "name": "storage.type.event" + }, + "2": { + "name": "entity.name.type.event" + } + }, + "patterns": [ + { + "include": "#type-primitive" + }, + { + "match": "\\b(?:(indexed)\\s)?(\\w+)(?:,\\s*|)", + "captures": { + "1": { + "name": "storage.type.modifier.indexed" + }, + "2": { + "name": "variable.parameter.event" + } + } + }, + { + "include": "#punctuation" + } + ] + }, + { + "match": "\\b(event)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.event" + }, + "3": { + "name": "entity.name.type.event" + } + } + } + ] + }, + "declaration-constructor": { + "patterns": [ + { + "begin": "\\b(constructor)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.constructor" + } + }, + "end": "(?=\\{)", + "patterns": [ + { + "begin": "\\G\\s*(?=\\()", + "end": "(?=\\))", + "patterns": [ + { + "include": "#declaration-function-parameters" + } + ] + }, + { + "begin": "(?<=\\))", + "end": "(?=\\{)", + "patterns": [ + { + "include": "#method-head" + } + + ] + }, + "declaration-function-fallback": { + "match": "\\b(function)\\s*\\(\\s*\\)", + "name": "storage.type.function.fallback.solidity" + }, + "declaration-function": { + "begin": "\\b(function)\\s+([A-Za-z_]\\w*)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.function.solidity" + }, + { + "include": "#function-call" + } + ] + } + ] + }, + { + "match": "\\b(constructor)\\b", + "captures": { + "1": { + "name": "storage.type.constructor" + } + } + } + ] + }, + "declaration-enum": { + "patterns": [ + { + "begin": "\\b(enum)\\s+(\\w+)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.enum" + }, + "2": { + "name": "entity.name.type.enum" + } + }, + "end": "(?=\\})", + "patterns": [ + { + "match": "\\b(\\w+)\\b", + "name": "variable.other.enummember" + }, + "patterns": [ + { + "include": "#method-head" + } + + ] + }, + { + "match": "\\b(enum)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.enum" + }, + "3": { + "name": "entity.name.type.enum" + } + } + } + ] + }, + "declaration-function-parameters": { + "begin": "\\G\\s*(?=\\()", + "end": "(?=\\))", + "patterns": [ + { + "include": "#type-primitive" + }, + { + "include": "#type-modifier-extended-scope" + }, + { + "match": "\\b([A-Z]\\w*)\\b", + "captures": { + "1": { + "name": "storage.type.struct" + } + } + }, + { + "include": "#variable" + }, + { + "include": "#punctuation" + }, + { + "include": "#comment" + } + ] + }, + "declaration-function": { + "patterns": [ + { + "begin": "\\b(function)\\s+(\\w+)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.function" + }, + "2": { + "name": "entity.name.function" + } + }, + "end": "(?=\\{|;)", + "patterns": [ + { + "include": "#natspec" + }, + { + "include": "#global" + }, + { + "include": "#declaration-function-parameters" + }, + { + "include": "#type-modifier-access" + }, + { + "include": "#type-modifier-payable" + }, + { + "include": "#type-modifier-immutable" + }, + { + "include": "#type-modifier-extended-scope" + }, + { + "include": "#control-flow" + }, + { + "include": "#function-call" + }, + { + "include": "#modifier-call" + } + ] + }, + { + "match": "\\b(function)\\s+([A-Za-z_]\\w*)\\b", + "captures": { + "1": { + "name": "storage.type.function" + }, + "2": { + "name": "entity.name.function" + } + } + } + ] + }, + "declaration-modifier": { + "patterns": [ + { + "begin": "\\b(modifier)\\b\\s*(\\w+)", + "beginCaptures": { + "1": { + "name": "storage.type.function.modifier" + }, + "2": { + "name": "entity.name.function.modifier" + } + }, + "end": "(?=\\{)", + "patterns": [ + { + "include": "#declaration-function-parameters" + }, + { + "begin": "(?<=\\))", + "end": "(?=\\{)", + "patterns": [ + { + "include": "#declaration-function-parameters" + }, + { + "include": "#type-modifier-access" + }, + { + "include": "#type-modifier-payable" + }, + { + "include": "#type-modifier-immutable" + }, + { + "include": "#type-modifier-extended-scope" + }, + { + "include": "#function-call" + }, + { + "include": "#modifier-call" + }, + { + "include": "#control-flow" + } + ] + } + ] + }, + { + "match": "\\b(modifier)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.modifier" + }, + "3": { + "name": "entity.name.function" + } + } + } + ] + }, + "declaration-storage-mapping": { + "patterns": [ + { + "begin": "\\b(mapping)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.mapping" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#declaration-storage-mapping" + }, + { + "include": "#type-primitive" + }, + { + "include": "#punctuation" + }, + { + "include": "#operator" + } + ] + }, + { + "match": "\\b(mapping)\\b", + "name": "storage.type.mapping" + } + ] + }, + "declaration-error": { + "match": "\\b(error)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.error" + }, + "3": { + "name": "entity.name.type.error" + } + } + }, + "function-call": { + "match": "\\b([A-Za-z_]\\w*)\\s*\\(", + "captures": { + "1": { + "name": "entity.name.function" + } + } + }, + "assembly": { + "patterns": [ + { + "match": "\\b(assembly)\\b", + "name": "keyword.control.assembly" + }, + { + "match": "\\b(let)\\b", + "name": "storage.type.assembly" + } + ] + }, + "punctuation": { + "patterns": [ + { + "match": ";", + "name": "punctuation.terminator.statement" + }, + { + "match": "\\.", + "name": "punctuation.accessor" + }, + { + "match": ",", + "name": "punctuation.separator" + }, + { + "match": "\\{", + "name": "punctuation.brace.curly.begin" + }, + { + "match": "\\}", + "name": "punctuation.brace.curly.end" + }, + { + "match": "\\[", + "name": "punctuation.brace.square.begin" + }, + { + "match": "\\]", + "name": "punctuation.brace.square.end" + }, + { + "match": "\\(", + "name": "punctuation.parameters.begin" + }, + { + "match": "\\)", + "name": "punctuation.parameters.end" + }, + { + "match": "({|})", + "name": "punctuation.block.solidity" + } + ] + }, + "scopeName": "source.solidity", + "uuid": "ad87d2cd-8575-4afe-984e-9421a3788933" +} diff --git a/syntaxes/solidity.tmLanguage.json b/syntaxes/solidity.tmLanguage.json index 9583acf..f6a3c29 100644 --- a/syntaxes/solidity.tmLanguage.json +++ b/syntaxes/solidity.tmLanguage.json @@ -1,322 +1,130 @@ { - "fileTypes": ["sol"], + "fileTypes": [ + "sol" + ], "name": "solidity", "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", - "patterns": [ - { - "include": "#natspec" - }, - { - "include": "#comment" - }, - { - "include": "#operator" - }, - { - "include": "#global" - }, - { - "include": "#control" - }, - { - "include": "#constant" - }, - { - "include": "#primitive" - }, - { - "include": "#type-primitive" - }, - { - "include": "#type-modifier-extended-scope" - }, - { - "include": "#declaration" - }, - { - "include": "#function-call" - }, - { - "include": "#assembly" - }, - { - "include": "#punctuation" - } - ], - "repository": { - "natspec": { - "patterns": [ + "patterns": [ { - "begin": "/\\*\\*", - "end": "\\*/", - "name": "comment.block.documentation", - "patterns": [ - { - "include": "#natspec-tags" - } - ] + "include": "#natspec" }, { - "begin": "///", - "end": "$", - "name": "comment.block.documentation", - "patterns": [ - { - "include": "#natspec-tags" - } - ] - } - ] - }, - "natspec-tags": { - "patterns": [ - { - "include": "#comment-todo" + "include": "#comment" }, { - "include": "#natspec-tag-title" + "include": "#operator" }, { - "include": "#natspec-tag-author" + "include": "#global" }, { - "include": "#natspec-tag-notice" + "include": "#control" }, { - "include": "#natspec-tag-dev" + "include": "#constant" }, { - "include": "#natspec-tag-param" + "include": "#primitive" }, { - "include": "#natspec-tag-return" - } - ] - }, - "natspec-tag-title": { - "match": "(@title)\\b", - "name": "storage.type.title.natspec" - }, - "natspec-tag-author": { - "match": "(@author)\\b", - "name": "storage.type.author.natspec" - }, - "natspec-tag-notice": { - "match": "(@notice)\\b", - "name": "storage.type.dev.natspec" - }, - "natspec-tag-dev": { - "match": "(@dev)\\b", - "name": "storage.type.dev.natspec" - }, - "natspec-tag-param": { - "match": "(@param)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.param.natspec" - }, - "3": { - "name": "variable.other.natspec" - } - } - }, - "natspec-tag-return": { - "match": "(@return)\\b", - "name": "storage.type.return.natspec" - }, - "comment": { - "patterns": [ - { - "include": "#comment-line" + "include": "#type-primitive" }, { - "include": "#comment-block" - } - ] - }, - "comment-todo": { - "match": "(?i)\\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|COMBAK|TEMP|SUPPRESS|LINT|\\w+-disable|\\w+-suppress)\\b(?-i)", - "name": "keyword.comment.todo" - }, - "comment-line": { - "begin": "(?(?!>)|>=|\\&\\&|\\|\\||\\:(?!=)|\\?)", - "name": "keyword.operator.logic" - }, - "operator-mapping": { - "match": "(=>)", - "name": "keyword.operator.mapping" - }, - "operator-arithmetic": { - "match": "(\\+|\\-|\\/|\\*)", - "name": "keyword.operator.arithmetic" - }, - "operator-binary": { - "match": "(\\^|\\&|\\||<<|>>)", - "name": "keyword.operator.binary" - }, - "operator-assignment": { - "match": "(\\:?=)", - "name": "keyword.operator.assignment" - }, - "control": { - "patterns": [ - { - "include": "#control-flow" - }, - { - "include": "#control-using" + ], + "repository": { + "natspec": { + "patterns": [ + { + "begin": "/\\*\\*", + "end": "\\*/", + "name": "comment.block.documentation", + "patterns": [ + { + "include": "#natspec-tags" + } + ] + }, + { + "begin": "///", + "end": "$", + "name": "comment.block.documentation", + "patterns": [ + { + "include": "#natspec-tags" + } + ] + } + ] }, - { - "include": "#control-import" + "natspec-tags": { + "patterns": [ + { + "include": "#comment-todo" + }, + { + "include": "#natspec-tag-title" + }, + { + "include": "#natspec-tag-author" + }, + { + "include": "#natspec-tag-notice" + }, + { + "include": "#natspec-tag-dev" + }, + { + "include": "#natspec-tag-param" + }, + { + "include": "#natspec-tag-return" + } + ] }, - { - "include": "#control-pragma" + "natspec-tag-title": { + "match": "(@title)\\b", + "name": "storage.type.title.natspec" }, - { - "include": "#control-underscore" + "natspec-tag-author": { + "match": "(@author)\\b", + "name": "storage.type.author.natspec" }, - { - "include": "#control-unchecked" + "natspec-tag-notice": { + "match": "(@notice)\\b", + "name": "storage.type.dev.natspec" }, - { - "include": "#control-other" - } - ] - }, - "control-flow": { - "patterns": [ - { - "match": "\\b(if|else|for|while|do|break|continue|try|catch|finally|throw|return)\\b", - "name": "keyword.control.flow" + "natspec-tag-dev": { + "match": "(@dev)\\b", + "name": "storage.type.dev.natspec" }, - { - "begin": "\\b(returns)\\b", - "beginCaptures": { - "1": { - "name": "keyword.control.flow.return" - } - }, - "end": "(?=\\))", - "patterns": [ - { - "include": "#declaration-function-parameters" - } - ] - } - ] - }, - "control-using": { - "patterns": [ - { - "match": "\\b(using)\\b\\s+\\b([A-Za-z\\d_]+)\\b\\s+\\b(for)\\b\\s+\\b([A-Za-z\\d_]+)", - "captures": { - "1": { - "name": "keyword.control.using" - }, - "2": { - "name": "entity.name.type.library" - }, - "3": { - "name": "keyword.control.for" - }, - "4": { - "name": "entity.name.type" - } - } - }, - { - "match": "\\b(using)\\b", - "name": "keyword.control.using" - } - ] - }, - "control-import": { - "patterns": [ - { - "begin": "\\b(import)\\b", - "beginCaptures": { - "1": { - "name": "keyword.control.import" - } - }, - "end": "(?=\\;)", - "patterns": [ - { - "begin": "((?=\\{))", - "end": "((?=\\}))", - "patterns": [ - { - "match": "\\b(\\w+)\\b", - "name": "entity.name.type.interface" + "natspec-tag-param": { + "match": "(@param)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.param.natspec" + }, + "3": { + "name": "variable.other.natspec" } - ] - }, - { - "match": "\\b(from)\\b", - "name": "keyword.control.import.from" - }, - { - "include": "#string" - }, - { - "include": "#punctuation" } - ] }, - { - "match": "\\b(import)\\b", - "name": "keyword.control.import" - } - ] - }, - "control-unchecked": { - "match": "\\b(unchecked)\\b", - "name": "keyword.control.unchecked" - }, - "control-pragma": { - "match": "\\b(pragma)(?:\\s+([A-Za-z_]\\w+)\\s+([^\\s]+))?\\b", - "captures": { - "1": { - "name": "keyword.control.pragma" + "natspec-tag-return": { + "match": "(@return)\\b", + "name": "storage.type.return.natspec" }, "comment": { "patterns": [ @@ -328,955 +136,1026 @@ } ] }, + "comment-todo": { + "match": "(?i)\\b(FIXME|TODO|CHANGED|XXX|IDEA|HACK|NOTE|REVIEW|NB|BUG|QUESTION|COMBAK|TEMP|SUPPRESS|LINT|\\w+-disable|\\w+-suppress)\\b(?-i)", + "name": "keyword.comment.todo" + }, "comment-line": { - "begin": "(?(?!>)|>=|\\&\\&|\\|\\||\\:(?!=)|\\?)", + "name": "keyword.operator.logic" }, - { - "include": "#number-scientific" - } - ] - }, - "number-decimal": { - "match": "\\b([0-9_]+(\\.[0-9_]+)?)\\b", - "name": "constant.numeric.decimal" - }, - "number-hex": { - "match": "\\b(0[xX][a-fA-F0-9]+)\\b", - "name": "constant.numeric.hexadecimal" - }, - "number-scientific": { - "match": "\\b(?:0\\.(?:0[1-9]|[1-9][0-9_]?)|[1-9][0-9_]*(?:\\.\\d{1,2})?)(?:e[+-]?[0-9_]+)?", - "name": "constant.numeric.scientific" - }, - "string": { - "patterns": [ - { - "match": "\\\".*?\\\"", - "name": "string.quoted.double" + "operator-mapping": { + "match": "(=>)", + "name": "keyword.operator.mapping" }, - { - "match": "\\'.*?\\'", - "name": "string.quoted.single" - } - ] - }, - "primitive": { - "patterns": [ - { - "include": "#number-decimal" + "operator-arithmetic": { + "match": "(\\+|\\-|\\/|\\*)", + "name": "keyword.operator.arithmetic" }, - { - "include": "#number-hex" + "operator-binary": { + "match": "(\\^|\\&|\\||<<|>>)", + "name": "keyword.operator.binary" }, - { - "include": "#number-scientific" + "operator-assignment": { + "match": "(\\:?=)", + "name": "keyword.operator.assignment" }, - { - "include": "#string" - } - ] - }, - "type-primitive": { - "patterns": [ - { - "begin": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b(?:\\[\\])(\\()", - "beginCaptures": { - "1": { - "name": "support.type.primitive" - } - }, - "end": "(\\))", - "patterns": [ - { - "include": "#primitive" - }, - { - "include": "#punctuation" - }, - { - "include": "#global" - }, - { - "include": "#variable" - } - ] + "control": { + "patterns": [ + { + "include": "#control-flow" + }, + { + "include": "#control-using" + }, + { + "include": "#control-import" + }, + { + "include": "#control-pragma" + }, + { + "include": "#control-underscore" + }, + { + "include": "#control-unchecked" + }, + { + "include": "#control-other" + } + ] }, - { - "match": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b", - "name": "support.type.primitive" - } - ] - }, - "global": { - "patterns": [ - { - "include": "#global-variables" + "control-flow": { + "patterns": [ + { + "match": "\\b(if|else|for|while|do|break|continue|try|catch|finally|throw|return)\\b", + "name": "keyword.control.flow" + }, + { + "begin": "\\b(returns)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.flow.return" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#declaration-function-parameters" + } + ] + } + ] }, - { - "include": "#global-functions" - } - ] - }, - "global-variables": { - "patterns": [ - { - "match": "\\b(this)\\b", - "name": "variable.language.this" + "control-using": { + "patterns": [ + { + "match": "\\b(using)\\b\\s+\\b([A-Za-z\\d_]+)\\b\\s+\\b(for)\\b\\s+\\b([A-Za-z\\d_]+)", + "captures": { + "1": { + "name": "keyword.control.using" + }, + "2": { + "name": "entity.name.type.library" + }, + "3": { + "name": "keyword.control.for" + }, + "4": { + "name": "entity.name.type" + } + } + }, + { + "match": "\\b(using)\\b", + "name": "keyword.control.using" + } + ] }, - { - "match": "\\b(super)\\b", - "name": "variable.language.super" + "control-import": { + "patterns": [ + { + "begin": "\\b(import)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.import" + } + }, + "end": "(?=\\;)", + "patterns": [ + { + "begin": "((?=\\{))", + "end": "((?=\\}))", + "patterns": [ + { + "match": "\\b(\\w+)\\b", + "name": "entity.name.type.interface" + } + ] + }, + { + "match": "\\b(from)\\b", + "name": "keyword.control.import.from" + }, + { + "include": "#string" + }, + { + "include": "#punctuation" + } + ] + }, + { + "match": "\\b(import)\\b", + "name": "keyword.control.import" + } + ] }, - { - "match": "\\b(abi)\\b", - "name": "variable.language.builtin.abi" + "control-unchecked": { + "match": "\\b(unchecked)\\b", + "name": "keyword.control.unchecked" }, - { - "match": "\\b(msg\\.sender|msg|block|tx|now)\\b", - "name": "variable.language.transaction" + "control-pragma": { + "match": "\\b(pragma)(?:\\s+([A-Za-z_]\\w+)\\s+([^\\s]+))?\\b", + "captures": { + "1": { + "name": "keyword.control.pragma" + }, + "2": { + "name": "entity.name.tag.pragma" + }, + "3": { + "name": "constant.other.pragma" + } + } }, - { - "match": "\\b(tx\\.origin|tx\\.gasprice|msg\\.data|msg\\.sig|msg\\.value)\\b", - "name": "variable.language.transaction" - } - ] - }, - "global-functions": { - "patterns": [ - { - "match": "\\b(require|assert|revert)\\b", - "name": "keyword.control.exceptions" + "control-underscore": { + "match": "\\b(_)\\b", + "name": "constant.other.underscore" }, - { - "match": "\\b(selfdestruct|suicide)\\b", - "name": "keyword.control.contract" + "control-other": { + "match": "\\b(new|delete|emit)\\b", + "name": "keyword.control" }, - { - "match": "\\b(addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\\b", - "name": "support.function.math" + "constant": { + "patterns": [ + { + "include": "#constant-boolean" + }, + { + "include": "#constant-time" + }, + { + "include": "#constant-currency" + } + ] }, - { - "match": "\\b(unicode)\\b", - "name": "support.function.string" + "constant-boolean": { + "match": "\\b(true|false)\\b", + "name": "constant.language.boolean" }, - { - "match": "\\b(blockhash|gasleft)\\b", - "name": "variable.language.transaction" + "constant-time": { + "match": "\\b(seconds|minutes|hours|days|weeks|years)\\b", + "name": "constant.language.time" }, - { - "match": "\\b(type)\\b", - "name": "variable.language.type" - } - ] - }, - "type-modifier-access": { - "match": "\\b(internal|external|private|public)\\b", - "name": "storage.type.modifier.access" - }, - "type-modifier-payable": { - "match": "\\b(nonpayable|payable)\\b", - "name": "storage.type.modifier.payable" - }, - "type-modifier-constant": { - "match": "\\b(constant)\\b", - "name": "storage.type.modifier.readonly" - }, - "type-modifier-immutable": { - "match": "\\b(immutable)\\b", - "name": "storage.type.modifier.readonly" - }, - "type-modifier-extended-scope": { - "match": "\\b(pure|view|inherited|indexed|storage|memory|virtual|calldata|override|abstract)\\b", - "name": "storage.type.modifier.extendedscope" - }, - "variable": { - "patterns": [ - { - "match": "\\b(\\_\\w+)\\b", - "captures": { - "1": { - "name": "variable.parameter.function" - } - } + "constant-currency": { + "match": "\\b(ether|wei|finney|szabo)\\b", + "name": "constant.language.currency" }, - { - "match": "(?:\\.)(\\w+)\\b", - "captures": { - "1": { - "name": "support.variable.property" - } - } + "number": { + "patterns": [ + { + "include": "#number-decimal" + }, + { + "include": "#number-hex" + }, + { + "include": "#number-scientific" + } + ] }, - { - "match": "\\b(\\w+)\\b", - "captures": { - "1": { - "name": "variable.parameter.other" - } - } - } - ] - }, - "modifier-call": { - "patterns": [ - { - "include": "#function-call" + "number-decimal": { + "match": "\\b([0-9_]+(\\.[0-9_]+)?)\\b", + "name": "constant.numeric.decimal" }, - { - "match": "\\b(\\w+)\\b", - "name": "entity.name.function.modifier" - } - ] - }, - "declaration": { - "patterns": [ - { - "include": "#declaration-contract" + "number-hex": { + "match": "\\b(0[xX][a-fA-F0-9]+)\\b", + "name": "constant.numeric.hexadecimal" }, - { - "include": "#declaration-interface" + "number-scientific": { + "match": "\\b(?:0\\.(?:0[1-9]|[1-9][0-9_]?)|[1-9][0-9_]*(?:\\.\\d{1,2})?)(?:e[+-]?[0-9_]+)?", + "name": "constant.numeric.scientific" }, - { - "include": "#declaration-library" + "string": { + "patterns": [ + { + "match": "\\\".*?\\\"", + "name": "string.quoted.double" + }, + { + "match": "\\'.*?\\'", + "name": "string.quoted.single" + } + ] }, - { - "include": "#declaration-function" + "primitive": { + "patterns": [ + { + "include": "#number-decimal" + }, + { + "include": "#number-hex" + }, + { + "include": "#number-scientific" + }, + { + "include": "#string" + } + ] }, - { - "include": "#declaration-modifier" + "type-primitive": { + "patterns": [ + { + "begin": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b(?:\\[\\])(\\()", + "beginCaptures": { + "1": { + "name": "support.type.primitive" + } + }, + "end": "(\\))", + "patterns": [ + { + "include": "#primitive" + }, + { + "include": "#punctuation" + }, + { + "include": "#global" + }, + { + "include": "#variable" + } + ] + }, + { + "match": "\\b(address|string\\d*|bytes\\d*|int\\d*|uint\\d*|bool|hash\\d*)\\b", + "name": "support.type.primitive" + } + ] }, - { - "include": "#declaration-constructor" + "global": { + "patterns": [ + { + "include": "#global-variables" + }, + { + "include": "#global-functions" + } + ] }, - { - "include": "#declaration-event" + "global-variables": { + "patterns": [ + { + "match": "\\b(this)\\b", + "name": "variable.language.this" + }, + { + "match": "\\b(super)\\b", + "name": "variable.language.super" + }, + { + "match": "\\b(abi)\\b", + "name": "variable.language.builtin.abi" + }, + { + "match": "\\b(msg\\.sender|msg|block|tx|now)\\b", + "name": "variable.language.transaction" + }, + { + "match": "\\b(tx\\.origin|tx\\.gasprice|msg\\.data|msg\\.sig|msg\\.value)\\b", + "name": "variable.language.transaction" + } + ] }, - { - "include": "#declaration-storage" + "global-functions": { + "patterns": [ + { + "match": "\\b(require|assert|revert)\\b", + "name": "keyword.control.exceptions" + }, + { + "match": "\\b(selfdestruct|suicide)\\b", + "name": "keyword.control.contract" + }, + { + "match": "\\b(addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\\b", + "name": "support.function.math" + }, + { + "match": "\\b(unicode)\\b", + "name": "support.function.string" + }, + { + "match": "\\b(blockhash|gasleft)\\b", + "name": "variable.language.transaction" + }, + { + "match": "\\b(type)\\b", + "name": "variable.language.type" + } + ] }, - { - "include": "#declaration-error" - } - ] - }, - "declaration-storage-field": { - "patterns": [ - { - "include": "#comment" + "type-modifier-access": { + "match": "\\b(internal|external|private|public)\\b", + "name": "storage.type.modifier.access" }, - { - "include": "#control" + "type-modifier-payable": { + "match": "\\b(nonpayable|payable)\\b", + "name": "storage.type.modifier.payable" }, - { - "include": "#type-primitive" + "type-modifier-constant": { + "match": "\\b(constant)\\b", + "name": "storage.type.modifier.readonly" }, - { - "include": "#type-modifier-access" + "type-modifier-immutable": { + "match": "\\b(immutable)\\b", + "name": "storage.type.modifier.readonly" }, - "global-variables": { + "type-modifier-extended-scope": { + "match": "\\b(pure|view|inherited|indexed|storage|memory|virtual|calldata|override|abstract)\\b", + "name": "storage.type.modifier.extendedscope" + }, + "variable": { "patterns": [ - { - "match": "\\b(this)\\b", - "name": "variable.language.this.solidity" + "match": "\\b(\\_\\w+)\\b", + "captures": { + "1": { + "name": "variable.parameter.function" + } + } }, { - "match": "\\b(super)\\b", - "name": "variable.language.super.solidity" + "match": "(?:\\.)(\\w+)\\b", + "captures": { + "1": { + "name": "support.variable.property" + } + } }, { - "match": "\\b(abi)\\b", - "name": "variable.language.builtin.abi.solidity" - }, + "match": "\\b(\\w+)\\b", + "captures": { + "1": { + "name": "variable.parameter.other" + } + } + } + ] + }, + "modifier-call": { + "patterns": [ { - "match": "\\b(tx\\.origin|tx\\.gasprice|msg\\.data|msg\\.sig|msg\\.value)\\b", - "name": "variable.language.transaction.solidity" + "include": "#function-call" }, { - "match": "\\b(msg\\.sender|msg|block|tx|now)\\b", - "name": "variable.language.transaction.solidity" + "match": "\\b(\\w+)\\b", + "name": "entity.name.function.modifier" } ] }, - "global-functions": { + "declaration": { "patterns": [ { - "match": "\\b(require|assert|revert)\\b", - "name": "keyword.control.exceptions.solidity" + "include": "#declaration-contract" }, { - "match": "\\b(selfdestruct|suicide)\\b", - "name": "keyword.control.contract.solidity" + "include": "#declaration-interface" }, { - "match": "\\b(addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\\b", - "name": "support.function.math.solidity" + "include": "#declaration-library" }, { - "match": "\\b(blockhash|gasleft)\\b", - "name": "variable.language.transaction.solidity" + "include": "#declaration-function" }, { - "match": "\\b(type)\\b", - "name": "variable.language.type.solidity" + "include": "#declaration-modifier" + }, + { + "include": "#declaration-constructor" + }, + { + "include": "#declaration-event" }, { - "match": "\\b\\.(send|call|delegatecall|staticcall|callcode|creationCode|runtimeCode)\\b", - "name": "support.function.transaction.solidity" + "include": "#declaration-storage" }, { - "match": "\\b\\.(transfer)\\b", - "name": "support.function.transaction.solidity" + "include": "#declaration-error" } ] }, - "declaration": { + "declaration-storage-field": { "patterns": [ { - "include": "#declaration-contract" + "include": "#comment" }, { - "include": "#declaration-interface" + "include": "#control" }, { - "include": "#declaration-library" + "include": "#type-primitive" }, - { "include": "#declaration-visibility"}, { - "include": "#declaration-struct" + "include": "#type-modifier-access" }, { - "include": "#declaration-event" + "include": "#type-modifier-immutable" }, { - "include": "#declaration-enum" + "include": "#type-modifier-extend-scope" }, { - "include": "#declaration-function-fallback" + "include": "#type-modifier-payable" }, { - "include": "#declaration-function" + "include": "#type-modifier-constant" }, - { - "include": "#declaration-constructor" + "include": "#primitive" }, { - "include": "#declaration-modifier" + "include": "#constant" + }, + { + "include": "#operator" }, { - "include": "#declaration-mapping" + "include": "#punctuation" } ] }, - { - "include": "#type-modifier-constant" - }, - { - "include": "#primitive" - }, - { - "include": "#constant" - }, - { - "include": "#operator" - }, - { - "include": "#punctuation" - } - ] - }, - "declaration-storage": { - "patterns": [ - { - "include": "#declaration-storage-mapping" - }, - { - "include": "#declaration-struct" + "declaration-storage": { + "patterns": [ + { + "include": "#declaration-storage-mapping" + }, + { + "include": "#declaration-struct" + }, + { + "include": "#declaration-enum" + }, + { + "include": "#declaration-storage-field" + } + ] }, - { - "include": "#declaration-enum" + "declaration-contract": { + "patterns": [ + { + "match": "\\b(contract)\\b\\s+(\\w+)\\b\\s*(?=\\{)", + "captures": { + "1": { + "name": "storage.type.contract" + }, + "2": { + "name": "entity.name.type.contract" + } + } + }, + { + "begin": "\\b(contract)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+", + "end": "(?=\\{)", + "beginCaptures": { + "1": { + "name": "storage.type.contract" + }, + "2": { + "name": "entity.name.type.contract" + }, + "3": { + "name": "storage.modifier.is" + } + }, + "patterns": [ + { + "match": "\\b(\\w+)\\b", + "name": "entity.name.type.contract.extend" + } + ] + } + ] }, - { - "include": "#declaration-storage-field" - } - ] - }, - "declaration-contract": { - "patterns": [ - { - "match": "\\b(contract)\\b\\s+(\\w+)\\b\\s*(?=\\{)", - "captures": { - "1": { - "name": "storage.type.contract" - }, - "2": { - "name": "entity.name.type.contract" - } - } + "declaration-interface": { + "patterns": [ + { + "match": "\\b(interface)\\b\\s+(\\w+)\\b\\s*(?=\\{)", + "captures": { + "1": { + "name": "storage.type.interface" + }, + "2": { + "name": "entity.name.type.interface" + } + } + }, + { + "begin": "\\b(interface)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+", + "end": "(?=\\{)", + "beginCaptures": { + "1": { + "name": "storage.type.interface" + }, + "2": { + "name": "entity.name.type.interface" + }, + "3": { + "name": "storage.modifier.is" + } + }, + "patterns": [ + { + "match": "\\b(\\w+)\\b", + "name": "entity.name.type.interface.extend" + } + ] + } + ] }, - { - "begin": "\\b(contract)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+", - "end": "(?=\\{)", - "beginCaptures": { - "1": { - "name": "storage.type.contract" - }, - "2": { - "name": "entity.name.type.contract" - }, - "3": { - "name": "storage.modifier.is" - } - }, - "patterns": [ - { - "match": "\\b(\\w+)\\b", - "name": "entity.name.type.contract.extend" - } - ] - } - ] - }, - "declaration-interface": { - "patterns": [ - { - "match": "\\b(interface)\\b\\s+(\\w+)\\b\\s*(?=\\{)", - "captures": { - "1": { - "name": "storage.type.interface" - }, - "2": { - "name": "entity.name.type.interface" + "declaration-library": { + "match": "\\b(library)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.library" + }, + "3": { + "name": "entity.name.type.library" + } } - } }, - { - "begin": "\\b(interface)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+", - "end": "(?=\\{)", - "beginCaptures": { - "1": { - "name": "storage.type.interface" - }, - "2": { - "name": "entity.name.type.interface" - }, - "3": { - "name": "storage.modifier.is" - } - }, - "patterns": [ - { - "match": "\\b(\\w+)\\b", - "name": "entity.name.type.interface.extend" - } - ] - } - ] - }, - "declaration-library": { - "match": "\\b(library)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.library" - }, - "3": { - "name": "entity.name.type.library" - } - } - }, - "declaration-struct": { - "patterns": [ - { - "match": "\\b(struct)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.struct" - }, - "3": { - "name": "entity.name.type.struct" - } - } + "declaration-struct": { + "patterns": [ + { + "match": "\\b(struct)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.struct" + }, + "3": { + "name": "entity.name.type.struct" + } + } + }, + { + "begin": "\\b(struct)\\b\\s*(\\w+)?\\b\\s*(?=\\{)", + "beginCaptures": { + "1": { + "name": "storage.type.struct" + }, + "2": { + "name": "entity.name.type.struct" + } + }, + "end": "(?=\\})", + "patterns": [ + { + "include": "#type-primitive" + }, + { + "include": "#variable" + }, + { + "include": "#punctuation" + }, + { + "include": "#comment" + } + ] + } + ] }, - { - "begin": "\\b(struct)\\b\\s*(\\w+)?\\b\\s*(?=\\{)", - "beginCaptures": { - "1": { - "name": "storage.type.struct" - }, - "2": { - "name": "entity.name.type.struct" - } - }, - "end": "(?=\\})", - "patterns": [ - { - "include": "#type-primitive" - }, - { - "include": "#variable" - }, - { - "include": "#punctuation" - }, - { - "include": "#comment" - } - ] - } - ] - }, - "declaration-event": { - "patterns": [ - { - "begin": "\\b(event)\\b(?:\\s+(\\w+)\\b)?", - "end": "(?=\\))", - "beginCaptures": { - "1": { - "name": "storage.type.event" - }, - "2": { - "name": "entity.name.type.event" - } - }, - "patterns": [ - { - "include": "#type-primitive" - }, - { - "match": "\\b(?:(indexed)\\s)?(\\w+)(?:,\\s*|)", - "captures": { - "1": { - "name": "storage.type.modifier.indexed" + "declaration-event": { + "patterns": [ + { + "begin": "\\b(event)\\b(?:\\s+(\\w+)\\b)?", + "end": "(?=\\))", + "beginCaptures": { + "1": { + "name": "storage.type.event" + }, + "2": { + "name": "entity.name.type.event" + } + }, + "patterns": [ + { + "include": "#type-primitive" + }, + { + "match": "\\b(?:(indexed)\\s)?(\\w+)(?:,\\s*|)", + "captures": { + "1": { + "name": "storage.type.modifier.indexed" + }, + "2": { + "name": "variable.parameter.event" + } + } + }, + { + "include": "#punctuation" + } + ] }, - "2": { - "name": "variable.parameter.event" + { + "match": "\\b(event)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.event" + }, + "3": { + "name": "entity.name.type.event" + } + } } - } - }, - { - "include": "#punctuation" - } - ] + ] }, - { - "match": "\\b(event)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.event" - }, - "3": { - "name": "entity.name.type.event" - } - } - } - ] - }, - "declaration-constructor": { - "patterns": [ - { - "begin": "\\b(constructor)\\b", - "beginCaptures": { - "1": { - "name": "storage.type.constructor" - } - }, - "end": "(?=\\{)", - "patterns": [ - { - "begin": "\\G\\s*(?=\\()", - "end": "(?=\\))", - "patterns": [ - { - "include": "#declaration-function-parameters" + "declaration-constructor": { + "patterns": [ + { + "begin": "\\b(constructor)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.constructor" + } + }, + "end": "(?=\\{)", + "patterns": [ + { + "begin": "\\G\\s*(?=\\()", + "end": "(?=\\))", + "patterns": [ + { + "include": "#declaration-function-parameters" + } + ] + }, + { + "begin": "(?<=\\))", + "end": "(?=\\{)", + "patterns": [ + { + "include": "#type-modifier-access" + }, + { + "include": "#function-call" + } + ] + } + ] + }, + { + "match": "\\b(constructor)\\b", + "captures": { + "1": { + "name": "storage.type.constructor" + } + } } - ] - }, - { - "begin": "(?<=\\))", - "end": "(?=\\{)", - "patterns": [ - { - "include": "#method-head" + ] + }, + "declaration-enum": { + "patterns": [ + { + "begin": "\\b(enum)\\s+(\\w+)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.enum" + }, + "2": { + "name": "entity.name.type.enum" + } + }, + "end": "(?=\\})", + "patterns": [ + { + "match": "\\b(\\w+)\\b", + "name": "variable.other.enummember" + }, + { + "include": "#punctuation" + } + ] + }, + { + "match": "\\b(enum)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.enum" + }, + "3": { + "name": "entity.name.type.enum" + } + } } - ] }, - "declaration-function-fallback": { - "match": "\\b(function)\\s*\\(\\s*\\)", - "name": "storage.type.function.fallback.solidity" + "declaration-function-parameters": { + "begin": "\\G\\s*(?=\\()", + "end": "(?=\\))", + "patterns": [ + { + "include": "#type-primitive" + }, + { + "include": "#type-modifier-extended-scope" + }, + { + "match": "\\b([A-Z]\\w*)\\b", + "captures": { + "1": { + "name": "storage.type.struct" + } + } + }, + { + "include": "#variable" + }, + { + "include": "#punctuation" + }, + { + "include": "#comment" + } + ] }, "declaration-function": { - "begin": "\\b(function)\\s+([A-Za-z_]\\w*)\\b", - "beginCaptures": { - "1": { - "name": "storage.type.function.solidity" + "patterns": [ + { + "begin": "\\b(function)\\s+(\\w+)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.function" + }, + "2": { + "name": "entity.name.function" + } + }, + "end": "(?=\\{|;)", + "patterns": [ + { + "include": "#natspec" + }, + { + "include": "#global" + }, + { + "include": "#declaration-function-parameters" + }, + { + "include": "#type-modifier-access" + }, + { + "include": "#type-modifier-payable" + }, + { + "include": "#type-modifier-immutable" + }, + { + "include": "#type-modifier-extended-scope" + }, + { + "include": "#control-flow" + }, + { + "include": "#function-call" + }, + { + "include": "#modifier-call" + } + ] }, { - "include": "#function-call" + "match": "\\b(function)\\s+([A-Za-z_]\\w*)\\b", + "captures": { + "1": { + "name": "storage.type.function" + }, + "2": { + "name": "entity.name.function" + } + } } - ] - } - ] + ] }, - { - "match": "\\b(constructor)\\b", - "captures": { - "1": { - "name": "storage.type.constructor" - } - } - } - ] - }, - "declaration-enum": { - "patterns": [ - { - "begin": "\\b(enum)\\s+(\\w+)\\b", - "beginCaptures": { - "1": { - "name": "storage.type.enum" - }, - "2": { - "name": "entity.name.type.enum" - } - }, - "end": "(?=\\})", - "patterns": [ - { - "match": "\\b(\\w+)\\b", - "name": "variable.other.enummember" - }, + "declaration-modifier": { "patterns": [ { - "include": "#method-head" + "begin": "\\b(modifier)\\b\\s*(\\w+)", + "beginCaptures": { + "1": { + "name": "storage.type.function.modifier" + }, + "2": { + "name": "entity.name.function.modifier" + } + }, + "end": "(?=\\{)", + "patterns": [ + { + "include": "#declaration-function-parameters" + }, + { + "begin": "(?<=\\))", + "end": "(?=\\{)", + "patterns": [ + { + "include": "#declaration-function-parameters" + }, + { + "include": "#type-modifier-access" + }, + { + "include": "#type-modifier-payable" + }, + { + "include": "#type-modifier-immutable" + }, + { + "include": "#type-modifier-extended-scope" + }, + { + "include": "#function-call" + }, + { + "include": "#modifier-call" + }, + { + "include": "#control-flow" + } + ] + } + ] + }, + { + "match": "\\b(modifier)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.modifier" + }, + "3": { + "name": "entity.name.function" + } + } } - ] }, - { - "match": "\\b(enum)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.enum" - }, - "3": { - "name": "entity.name.type.enum" - } - } - } - ] - }, - "declaration-function-parameters": { - "begin": "\\G\\s*(?=\\()", - "end": "(?=\\))", - "patterns": [ - { - "include": "#type-primitive" - }, - { - "include": "#type-modifier-extended-scope" + "declaration-storage-mapping": { + "patterns": [ + { + "begin": "\\b(mapping)\\b", + "beginCaptures": { + "1": { + "name": "storage.type.mapping" + } + }, + "end": "(?=\\))", + "patterns": [ + { + "include": "#declaration-storage-mapping" + }, + { + "include": "#type-primitive" + }, + { + "include": "#punctuation" + }, + { + "include": "#operator" + } + ] + }, + { + "match": "\\b(mapping)\\b", + "name": "storage.type.mapping" + } + ] }, - { - "match": "\\b([A-Z]\\w*)\\b", - "captures": { - "1": { - "name": "storage.type.struct" + "declaration-error": { + "match": "\\b(error)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.error" + }, + "3": { + "name": "entity.name.type.error" + } } - } - }, - { - "include": "#variable" - }, - { - "include": "#punctuation" }, - { - "include": "#comment" - } - ] - }, - "declaration-function": { - "patterns": [ - { - "begin": "\\b(function)\\s+(\\w+)\\b", - "beginCaptures": { - "1": { - "name": "storage.type.function" - }, - "2": { - "name": "entity.name.function" - } - }, - "end": "(?=\\{|;)", - "patterns": [ - { - "include": "#natspec" - }, - { - "include": "#global" - }, - { - "include": "#declaration-function-parameters" - }, - { - "include": "#type-modifier-access" - }, - { - "include": "#type-modifier-payable" - }, - { - "include": "#type-modifier-immutable" - }, - { - "include": "#type-modifier-extended-scope" - }, - { - "include": "#control-flow" - }, - { - "include": "#function-call" - }, - { - "include": "#modifier-call" + "function-call": { + "match": "\\b([A-Za-z_]\\w*)\\s*\\(", + "captures": { + "1": { + "name": "entity.name.function" + } } - ] }, - { - "match": "\\b(function)\\s+([A-Za-z_]\\w*)\\b", - "captures": { - "1": { - "name": "storage.type.function" - }, - "2": { - "name": "entity.name.function" - } - } - } - ] - }, - "declaration-modifier": { - "patterns": [ - { - "begin": "\\b(modifier)\\b\\s*(\\w+)", - "beginCaptures": { - "1": { - "name": "storage.type.function.modifier" - }, - "2": { - "name": "entity.name.function.modifier" - } - }, - "end": "(?=\\{)", - "patterns": [ - { - "include": "#declaration-function-parameters" - }, - { - "begin": "(?<=\\))", - "end": "(?=\\{)", - "patterns": [ + "assembly": { + "patterns": [ + { + "match": "\\b(assembly)\\b", + "name": "keyword.control.assembly" + }, + { + "match": "\\b(let)\\b", + "name": "storage.type.assembly" + } + ] + }, + "punctuation": { + "patterns": [ { - "include": "#declaration-function-parameters" + "match": ";", + "name": "punctuation.terminator.statement" }, { - "include": "#type-modifier-access" + "match": "\\.", + "name": "punctuation.accessor" }, { - "include": "#type-modifier-payable" + "match": ",", + "name": "punctuation.separator" }, { - "include": "#type-modifier-immutable" + "match": "\\{", + "name": "punctuation.brace.curly.begin" }, { - "include": "#type-modifier-extended-scope" + "match": "\\}", + "name": "punctuation.brace.curly.end" }, { - "include": "#function-call" + "match": "\\[", + "name": "punctuation.brace.square.begin" }, { - "include": "#modifier-call" + "match": "\\]", + "name": "punctuation.brace.square.end" }, { - "include": "#control-flow" + "match": "\\(", + "name": "punctuation.parameters.begin" + }, + { + "match": "\\)", + "name": "punctuation.parameters.end" } - ] - } - ] - }, - { - "match": "\\b(modifier)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.modifier" - }, - "3": { - "name": "entity.name.function" - } - } - } - ] - }, - "declaration-storage-mapping": { - "patterns": [ - { - "begin": "\\b(mapping)\\b", - "beginCaptures": { - "1": { - "name": "storage.type.mapping" - } - }, - "end": "(?=\\))", - "patterns": [ - { - "include": "#declaration-storage-mapping" - }, - { - "include": "#type-primitive" - }, - { - "include": "#punctuation" - }, - { - "include": "#operator" - } - ] - }, - { - "match": "\\b(mapping)\\b", - "name": "storage.type.mapping" - } - ] - }, - "declaration-error": { - "match": "\\b(error)(\\s+([A-Za-z_]\\w*))?\\b", - "captures": { - "1": { - "name": "storage.type.error" - }, - "3": { - "name": "entity.name.type.error" - } - } - }, - "function-call": { - "match": "\\b([A-Za-z_]\\w*)\\s*\\(", - "captures": { - "1": { - "name": "entity.name.function" - } - } - }, - "assembly": { - "patterns": [ - { - "match": "\\b(assembly)\\b", - "name": "keyword.control.assembly" - }, - { - "match": "\\b(let)\\b", - "name": "storage.type.assembly" - } - ] - }, - "punctuation": { - "patterns": [ - { - "match": ";", - "name": "punctuation.terminator.statement" - }, - { - "match": "\\.", - "name": "punctuation.accessor" - }, - { - "match": ",", - "name": "punctuation.separator" - }, - { - "match": "\\{", - "name": "punctuation.brace.curly.begin" - }, - { - "match": "\\}", - "name": "punctuation.brace.curly.end" - }, - { - "match": "\\[", - "name": "punctuation.brace.square.begin" - }, - { - "match": "\\]", - "name": "punctuation.brace.square.end" - }, - { - "match": "\\(", - "name": "punctuation.parameters.begin" - }, - { - "match": "\\)", - "name": "punctuation.parameters.end" - }, - { - "match": "({|})", - "name": "punctuation.block.solidity" + ] } - ] }, "scopeName": "source.solidity", - "uuid": "ad87d2cd-8575-4afe-984e-9421a3788933" -} + "uuid": "25f5cd46-fd8e-4a88-986a-239ae90c9877" +} \ No newline at end of file diff --git a/tests/ref.schema.json b/tests/ref.schema.json index ce0b741..00f4d73 100644 --- a/tests/ref.schema.json +++ b/tests/ref.schema.json @@ -1,3 +1,3 @@ { -"$ref": "https://raw.githubusercontent.com/Septh/tmlanguage/master/tmLanguage.schema.json" + "$ref": "https://raw.githubusercontent.com/Septh/tmlanguage/master/tmLanguage.schema.json" } diff --git a/tests/tmLanguage.schema.json b/tests/tmLanguage.schema.json index d93f68f..bd9f1cc 100644 --- a/tests/tmLanguage.schema.json +++ b/tests/tmLanguage.schema.json @@ -1,209 +1,196 @@ { - "$schema": "http://json-schema.org/draft-06/schema#", + "$schema": "http://json-schema.org/draft-06/schema#", - "title": "tmLanguage", - "description": "Schema for language grammar description files in Textmate and compatible editors.", - "type": "object", - "properties": { - "scopeName": { - "description": "This should be a unique name for the grammar, following the convention of being a dot-separated name where each new (left-most) part specializes the name. Normally it would be a two-part name where the first is either `text` or `source` and the second is the name of the language or document type. But if you are specializing an existing type, you probably want to derive the name from the type you are specializing. For example Markdown is `text.html.markdown` and Ruby on Rails (rhtml files) is `text.html.rails`. The advantage of deriving it from (in this case) `text.html` is that everything which works in the `text.html` scope will also work in the `text.html.«something»` scope (but with a lower precedence than something specifically targeting `text.html.«something»`).", - "type": "string", - "pattern": "^[\\w$@][\\w\\-$@]*(?:\\.[\\w$@][\\w\\-$@]*)*$" - }, - "fileTypes": { - "description": "An array of file type extensions that the grammar should (by default) be used with.", - "type": "array", - "items": { - "type": "string" + "title": "tmLanguage", + "description": "Schema for language grammar description files in Textmate and compatible editors.", + "type": "object", + "properties": { + "scopeName": { + "description": "This should be a unique name for the grammar, following the convention of being a dot-separated name where each new (left-most) part specializes the name. Normally it would be a two-part name where the first is either `text` or `source` and the second is the name of the language or document type. But if you are specializing an existing type, you probably want to derive the name from the type you are specializing. For example Markdown is `text.html.markdown` and Ruby on Rails (rhtml files) is `text.html.rails`. The advantage of deriving it from (in this case) `text.html` is that everything which works in the `text.html` scope will also work in the `text.html.«something»` scope (but with a lower precedence than something specifically targeting `text.html.«something»`).", + "type": "string", + "pattern": "^[\\w$@][\\w\\-$@]*(?:\\.[\\w$@][\\w\\-$@]*)*$" + }, + "fileTypes": { + "description": "An array of file type extensions that the grammar should (by default) be used with.", + "type": "array", + "items": { + "type": "string" + } + }, + "firstLineMatch": { + "description": "A regular expression which is matched against the first line of the document when it is first loaded. If it matches, the grammar is used for the document.", + "type": "string" + }, + "uuid": { + "description": "When the grammar is part of a larger bundle (ie., grammar + theme + whatever), the uuid helps classify which file is a part of which bundle.", + "type": "string" + }, + "foldingStartMarker": { + "description": "Regular expression that lines (in the document) are matched against. If a line matches the pattern, it starts a foldable block.", + "type": "string" + }, + "foldingStopMarker": { + "description": "Regular expressions that lines (in the document) are matched against. If a line matches pattern, it ends a foldable block.", + "type": "string" + }, + "patterns": { + "description": "An array with the actual rules used to parse the document.", + "$ref": "#/definitions/patterns" + }, + "repository": { + "description": "A dictionary (i.e. key/value pairs) of rules which can be included from other places in the grammar. The key is the name of the rule and the value is the actual rule.", + "$ref": "#/definitions/repository" + }, + "injectionSelector": { + "description": "The key is a scope selector that specifies which scope(s) the current grammar should be injected in.", + "type": "string" + }, + "injections": { + "description": "A dictionary (i.e. key/value pairs) of rules which will be injected into an existing grammar. The key is the target scope of the parent grammar and the value is the actual rule to inject.", + "$ref": "#/definitions/repository" + } + }, + "required": ["scopeName", "patterns"], + "dependencies": { + "foldingStartMarker": ["foldingStopMarker"], + "foldingStopMarker": ["foldingStartMarker"] + }, + "additionalProperties": true, + + "definitions": { + "boolean-or-integer": { + "oneOf": [{ "type": "boolean" }, { "type": "number", "enum": [0, 1] }] + }, + + "patterns": { + "type": "array", + "items": { + "$ref": "#/definitions/rule" + } + }, + + "repository": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/rule" + } + }, + + "name": { + "type": "string", + "pattern": "^[\\w$@][\\w\\-$@]*(?:(?:\\.| )[\\w$@][\\w\\-$@]*)*$" + }, + + "captures": { + "type": "object", + "patternProperties": { + "^[0-9]+$": { + "type": "object", + "properties": { + "name": { + "description": "The scope name which gets assigned to the capture matched. This should generally be derived from one of the standard names.", + "type": "string" + }, + "patterns": { + "description": "Yes, captures can be further matched against additional patterns, too.", + "$ref": "#/definitions/patterns" } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + + "rule": { + "type": "object", + "properties": { + "comment": { + "description": "A generic text used to describe or explain the rule.", + "type": "string" }, - "firstLineMatch": { - "description": "A regular expression which is matched against the first line of the document when it is first loaded. If it matches, the grammar is used for the document.", - "type": "string" + "name": { + "description": "The scope name which gets assigned to the capture matched. This should generally be derived from one of the standard names.", + "type": "string" }, - "uuid": { - "description": "When the grammar is part of a larger bundle (ie., grammar + theme + whatever), the uuid helps classify which file is a part of which bundle.", - "type": "string" + "disabled": { + "description": "Marks the rule as disabled. A disabled rule should be ignored by the tokenization engine.", + "$ref": "#/definitions/boolean-or-integer" }, - "foldingStartMarker": { - "description": "Regular expression that lines (in the document) are matched against. If a line matches the pattern, it starts a foldable block.", - "type": "string" + "include": { + "description": "This key allows you to reference a different language (value == scope name), recursively reference the grammar itself (value == \"$self\") or a rule declared in this file’s repository (value starts with a pound (#) sign).", + "type": "string" }, - "foldingStopMarker": { - "description": "Regular expressions that lines (in the document) are matched against. If a line matches pattern, it ends a foldable block.", - "type": "string" + "match": { + "description": "A regular expression which is used to identify the portion of text to which the name should be assigned.", + "type": "string" }, - "patterns": { - "description": "An array with the actual rules used to parse the document.", - "$ref": "#/definitions/patterns" + "begin": { + "description": "The `begin` key is a regular expression pattern that allows matches which span several lines. Captures from the `begin` pattern can be referenced in the corresponding `end` or `while` pattern by using normal regular expression back-references, eg. `\\1$`.", + "type": "string" }, - "repository": { - "description": "A dictionary (i.e. key/value pairs) of rules which can be included from other places in the grammar. The key is the name of the rule and the value is the actual rule.", - "$ref": "#/definitions/repository" + "end": { + "description": "A regular expression pattern that, when matched, ends the multi-line block started by the `begin` key.", + "type": "string" }, - "injectionSelector": { - "description": "The key is a scope selector that specifies which scope(s) the current grammar should be injected in.", - "type": "string" + "while": { + "description": "A regular expression pattern that, while matched, continues the multi-line block started by the `begin` key.", + "type": "string" }, - "injections": { - "description": "A dictionary (i.e. key/value pairs) of rules which will be injected into an existing grammar. The key is the target scope of the parent grammar and the value is the actual rule to inject.", - "$ref": "#/definitions/repository" - } - }, - "required": [ "scopeName", "patterns" ], - "dependencies": { - "foldingStartMarker": [ "foldingStopMarker" ], - "foldingStopMarker": [ "foldingStartMarker" ] - }, - "additionalProperties": true, - - "definitions": { - - "boolean-or-integer": { - "oneOf": [ - { "type": "boolean" }, - { "type": "number", "enum": [ 0, 1 ] } - ] + "applyEndPatternLast": { + "description": "Tests the `end` pattern after the other patterns in the `begin`/`end` block.", + "$ref": "#/definitions/boolean-or-integer" + }, + "contentName": { + "description": "This key is similar to the `name` key but it only assigns the name to the text between what is matched by the `begin`/`end` patterns.", + "type": "string" + }, + "captures": { + "description": "This key allows you to assign attributes to the captures of the `match`, `begin`, `end` and `while`patterns. Using the `captures` key for a `begin`/`end` rule is short-hand for giving both `beginCaptures` and `endCaptures` with same values. The value of this key is a dictionary with the key being the capture number and the value being a dictionary of attributes to assign to the captured text.", + "$ref": "#/definitions/captures" + }, + "beginCaptures": { + "description": "This key allows you to assign attributes to the captures of the `begin` pattern. The value of this key is a dictionary with the key being the capture number and the value being a dictionary of attributes to assign to the captured text.", + "$ref": "#/definitions/captures" + }, + "endCaptures": { + "description": "This key allows you to assign attributes to the captures of the `end` pattern. The value of this key is a dictionary with the key being the capture number and the value being a dictionary of attributes to assign to the captured text.", + "$ref": "#/definitions/captures" + }, + "whileCaptures": { + "description": "This key allows you to assign attributes to the captures of the `while` pattern. The value of this key is a dictionary with the key being the capture number and the value being a dictionary of attributes to assign to the captured text.", + "$ref": "#/definitions/captures" }, - "patterns": { - "type": "array", - "items": { - "$ref": "#/definitions/rule" - } + "description": "An array with the actual rules used to parse the matched content.", + "$ref": "#/definitions/patterns" }, - "repository": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/rule" - } + "description": "A dictionary (i.e. key/value pairs) of rules which can be included from other places in the grammar. The key is the name of the rule and the value is the actual rule.", + "$ref": "#/definitions/repository" + } + }, + "additionalProperties": false, + "dependencies": { + "include": { + "allOf": [{ "not": { "required": ["match"] } }, { "not": { "required": ["begin"] } }] }, - - "name": { - "type": "string", - "pattern": "^[\\w$@][\\w\\-$@]*(?:(?:\\.| )[\\w$@][\\w\\-$@]*)*$" + "match": { + "not": { "required": ["begin"] } }, - + "begin": { + "oneOf": [{ "required": ["end"] }, { "required": ["while"] }] + }, + "end": ["begin"], + "while": ["begin"], + "applyEndPatternLast": ["begin"], "captures": { - "type": "object", - "patternProperties": { - "^[0-9]+$": { - "type": "object", - "properties": { - "name": { - "description": "The scope name which gets assigned to the capture matched. This should generally be derived from one of the standard names.", - "type": "string" - }, - "patterns": { - "description": "Yes, captures can be further matched against additional patterns, too.", - "$ref": "#/definitions/patterns" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false + "oneOf": [{ "required": ["match"] }, { "required": ["begin"] }] }, - - "rule": { - "type": "object", - "properties": { - "comment": { - "description": "A generic text used to describe or explain the rule.", - "type": "string" - }, - "name": { - "description": "The scope name which gets assigned to the capture matched. This should generally be derived from one of the standard names.", - "type": "string" - }, - "disabled": { - "description": "Marks the rule as disabled. A disabled rule should be ignored by the tokenization engine.", - "$ref": "#/definitions/boolean-or-integer" - }, - "include": { - "description": "This key allows you to reference a different language (value == scope name), recursively reference the grammar itself (value == \"$self\") or a rule declared in this file’s repository (value starts with a pound (#) sign).", - "type": "string" - }, - "match": { - "description": "A regular expression which is used to identify the portion of text to which the name should be assigned.", - "type": "string" - }, - "begin": { - "description": "The `begin` key is a regular expression pattern that allows matches which span several lines. Captures from the `begin` pattern can be referenced in the corresponding `end` or `while` pattern by using normal regular expression back-references, eg. `\\1$`.", - "type": "string" - }, - "end": { - "description": "A regular expression pattern that, when matched, ends the multi-line block started by the `begin` key.", - "type": "string" - }, - "while": { - "description": "A regular expression pattern that, while matched, continues the multi-line block started by the `begin` key.", - "type": "string" - }, - "applyEndPatternLast": { - "description": "Tests the `end` pattern after the other patterns in the `begin`/`end` block.", - "$ref": "#/definitions/boolean-or-integer" - }, - "contentName": { - "description": "This key is similar to the `name` key but it only assigns the name to the text between what is matched by the `begin`/`end` patterns.", - "type": "string" - }, - "captures": { - "description": "This key allows you to assign attributes to the captures of the `match`, `begin`, `end` and `while`patterns. Using the `captures` key for a `begin`/`end` rule is short-hand for giving both `beginCaptures` and `endCaptures` with same values. The value of this key is a dictionary with the key being the capture number and the value being a dictionary of attributes to assign to the captured text.", - "$ref": "#/definitions/captures" - }, - "beginCaptures": { - "description": "This key allows you to assign attributes to the captures of the `begin` pattern. The value of this key is a dictionary with the key being the capture number and the value being a dictionary of attributes to assign to the captured text.", - "$ref": "#/definitions/captures" - }, - "endCaptures": { - "description": "This key allows you to assign attributes to the captures of the `end` pattern. The value of this key is a dictionary with the key being the capture number and the value being a dictionary of attributes to assign to the captured text.", - "$ref": "#/definitions/captures" - }, - "whileCaptures": { - "description": "This key allows you to assign attributes to the captures of the `while` pattern. The value of this key is a dictionary with the key being the capture number and the value being a dictionary of attributes to assign to the captured text.", - "$ref": "#/definitions/captures" - }, - "patterns": { - "description": "An array with the actual rules used to parse the matched content.", - "$ref": "#/definitions/patterns" - }, - "repository": { - "description": "A dictionary (i.e. key/value pairs) of rules which can be included from other places in the grammar. The key is the name of the rule and the value is the actual rule.", - "$ref": "#/definitions/repository" - } - }, - "additionalProperties": false, - "dependencies": { - "include": { - "allOf": [ - { "not": { "required": [ "match" ] } }, - { "not": { "required": [ "begin" ] } } - ] - }, - "match": { - "not": { "required": [ "begin" ] } - }, - "begin": { - "oneOf": [ - { "required": [ "end" ] }, - { "required": [ "while" ] } - ] - }, - "end": [ "begin" ], - "while": [ "begin" ], - "applyEndPatternLast": [ "begin" ], - "captures": { - "oneOf": [ - { "required": [ "match" ] }, - { "required": [ "begin" ] } - ] - }, - "beginCaptures": [ "begin" ], - "endCaptures": [ "end" ], - "whileCaptures": [ "while" ] - } - } + "beginCaptures": ["begin"], + "endCaptures": ["end"], + "whileCaptures": ["while"] + } } + } } diff --git a/themes/solidity-lang-theme.json b/themes/solidity-lang-theme.json index 7e45572..bb35311 100644 --- a/themes/solidity-lang-theme.json +++ b/themes/solidity-lang-theme.json @@ -556,12 +556,7 @@ } }, { - "scope": [ - "comment", - "punctuation.definition.comment", - "unused.comment", - "wildcard.comment" - ], + "scope": ["comment", "punctuation.definition.comment", "unused.comment", "wildcard.comment"], "settings": { "foreground": "#6272A4" } @@ -584,9 +579,7 @@ } }, { - "scope": [ - "comment.block.documentation entity.name.type punctuation.definition.bracket" - ], + "scope": ["comment.block.documentation entity.name.type punctuation.definition.bracket"], "settings": { "foreground": "#8BE9FD" } @@ -605,11 +598,7 @@ } }, { - "scope": [ - "constant.character.escape", - "constant.character.string.escape", - "constant.regexp" - ], + "scope": ["constant.character.escape", "constant.character.string.escape", "constant.regexp"], "settings": { "foreground": "#FF79C6" } @@ -705,11 +694,7 @@ } }, { - "scope": [ - "support.function.magic", - "support.variable", - "variable.other.predefined" - ], + "scope": ["support.function.magic", "support.variable", "variable.other.predefined"], "settings": { "foreground": "#BD93F9", "fontStyle": "regular" @@ -931,10 +916,7 @@ } }, { - "scope": [ - "punctuation.definition.string.begin", - "punctuation.definition.string.end" - ], + "scope": ["punctuation.definition.string.begin", "punctuation.definition.string.end"], "settings": { "foreground": "#E9F284" } From cb5af4ce902e1169e5d6bc52852ab5a3d34ee10d Mon Sep 17 00:00:00 2001 From: sam bacha Date: Thu, 7 Oct 2021 15:03:59 -0700 Subject: [PATCH 3/4] docs(readme): open vsx registry --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 13016c5..ac4a9c5 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,13 @@
-[![vscode marketplace](https://badgen.net/vs-marketplace/v/contractshark.solidity-lang)](https://marketplace.visualstudio.com/items?itemName=ContractShark.solidity-lang) + + + +[![vscode marketplace](https://badgen.net/vs-marketplace/v/contractshark.solidity-lang)](https://marketplace.visualstudio.com/items?itemName=ContractShark.solidity-lang) ![Open VSX Version](https://img.shields.io/open-vsx/v/contractshark/solidity-lang?logo=eclipse) [![solidity - <0.9.0](https://img.shields.io/badge/solidity-v0.9.0-2ea44f?logo=solidity)](https://github.com/manifoldfinance) + + -[![solidity - <0.9.0](https://img.shields.io/badge/solidity-v0.9.0-2ea44f?logo=solidity)](https://github.com/manifoldfinance) ## Motivation @@ -41,6 +45,9 @@ to add without having to give up basic functionality. - [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=ContractShark.solidity-lang) +- [Eclipse Open VSX Registry Marketplace](https://open-vsx.org/extension/contractshark/solidity-lang) + + ## Extension Settings This extension contributes the following settings: From 142ca02bce95b561142a2260427001d914e6ead3 Mon Sep 17 00:00:00 2001 From: sam bacha Date: Sun, 20 Mar 2022 07:34:07 -0700 Subject: [PATCH 4/4] feat(natspec): support for @custom and updates to grammar (#7) --- .gitignore | 4 +- .vscode/extensions.json | 4 +- .vscodeignore | 15 ++++-- CHANGELOG.md | 51 -------------------- LICENSE.txt | 38 +++++++++++++++ README.md | 17 ++++--- dist/LICENSE.txt | 38 +++++++++++++++ package.json | 6 +-- syntaxes/solidity.tmLanguage.json | 78 ++++++++++++++++++++----------- 9 files changed, 152 insertions(+), 99 deletions(-) delete mode 100644 CHANGELOG.md create mode 100644 LICENSE.txt create mode 100644 dist/LICENSE.txt diff --git a/.gitignore b/.gitignore index 9f7a197..242b9f6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,11 +7,11 @@ node_modules *.tgz *.zip *.tar -dist/ build/ cache .cache/ *.log *-error. solidity-lang-*.zip - +*.vsix +!dist/*.vsix diff --git a/.vscode/extensions.json b/.vscode/extensions.json index bf2261d..074fedb 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,5 +1,3 @@ { - "recommendations": [ - "leodevbro.blockman" - ] + "recommendations": ["leodevbro.blockman"] } diff --git a/.vscodeignore b/.vscodeignore index f369b5e..c9bcde0 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -1,4 +1,13 @@ -.vscode/** -.vscode-test/** +.github/** .gitignore -vsc-extension-quickstart.md +.prettierignore +.vscode-test/** +.vscode/** +.yarnrc +**/.eslintrc.json +**/*.map +**/*.ts +**/test/* +**/tsconfig.json +node_modules + diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index ab7ac2b..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,51 +0,0 @@ -### Changelog - -All notable changes to this project will be documented in this file. Dates are displayed in UTC. - -Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - -#### [v1.3.0](https://github.com/contractshark/vscode-solidity-extenstion/compare/v1.2.1...v1.3.0) - -> 1 October 2021 - -- v1.2.0 [`#3`](https://github.com/contractshark/vscode-solidity-extenstion/pull/3) -- v1.1.0 [`#2`](https://github.com/contractshark/vscode-solidity-extenstion/pull/2) -- bug/vscode [`#1`](https://github.com/contractshark/vscode-solidity-extenstion/pull/1) -- feat(vscode): release v1.3.0 [`3f15e3c`](https://github.com/contractshark/vscode-solidity-extenstion/commit/3f15e3c4b014db649c219756b1669dd8743adc5d) -- Release 1.2.1 [`020ef3b`](https://github.com/contractshark/vscode-solidity-extenstion/commit/020ef3bb5fdf77966db1ce3e9b12016bb8d7f21c) -- chore(package): pin dependencies, fix git url [`86a55c8`](https://github.com/contractshark/vscode-solidity-extenstion/commit/86a55c8b74248c25f7d6524ad49bd60b50133d8c) - -#### [v1.2.1](https://github.com/contractshark/vscode-solidity-extenstion/compare/v1.2.0...v1.2.1) - -> 17 August 2021 - -#### [v1.2.0](https://github.com/contractshark/vscode-solidity-extenstion/compare/v1.1.0...v1.2.0) - -> 17 August 2021 - -- feat(release): EIP1559 support [`4353981`](https://github.com/contractshark/vscode-solidity-extenstion/commit/43539818462f5b6d5c0b3a6cb3bd0ac992020387) -- Release 1.2.1 [`16f05e8`](https://github.com/contractshark/vscode-solidity-extenstion/commit/16f05e8020e8bd8581e67853ab6327879cb12eba) - -#### [v1.1.0](https://github.com/contractshark/vscode-solidity-extenstion/compare/v1.0.1...v1.1.0) - -> 30 July 2021 - -- feat(release): v1.1.0 [`efbb953`](https://github.com/contractshark/vscode-solidity-extenstion/commit/efbb9534d220bbe9efc94a3f296376a88e65bfb5) -- feat(vscode): inital theme overlay [`d11ba45`](https://github.com/contractshark/vscode-solidity-extenstion/commit/d11ba45b0382e88e3f8c5f38f96242095f1c178b) -- docs(readme): v1.0.0 [`60295d7`](https://github.com/contractshark/vscode-solidity-extenstion/commit/60295d7b5fc3cdc54f9c5595e5c1e55d01b07e93) - -### [v1.0.1](https://github.com/contractshark/vscode-solidity-extenstion/compare/v0.0.2...v1.0.1) - -> 15 April 2021 - -- test(validate): validate grammar [`d7b281a`](https://github.com/contractshark/vscode-solidity-extenstion/commit/d7b281a6b1b570cf8afc1b1eae0f1c253de2b6d8) -- fix(ext): url update and CI [`bc29fe5`](https://github.com/contractshark/vscode-solidity-extenstion/commit/bc29fe53de67ade1058c62285194d691ed488d7f) -- docs(readme): vscode ext [`33d1c37`](https://github.com/contractshark/vscode-solidity-extenstion/commit/33d1c3731c4f02419a7a9b4cd60d13723e63eaf6) - -#### v0.0.2 - -> 14 April 2021 - -- release [`06906dc`](https://github.com/contractshark/vscode-solidity-extenstion/commit/06906dc5dffabb815395d29c9643bf9ff5c86f9e) -- chore(release): 0.0.2 [`c8c2741`](https://github.com/contractshark/vscode-solidity-extenstion/commit/c8c274182f95fa7d9a9d544857ac4aa58405dc9e) -- build(vsce): package [`aec374a`](https://github.com/contractshark/vscode-solidity-extenstion/commit/aec374ac38ab110046f018e914fb4b39bb7931e5) diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..20d68c5 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,38 @@ +SPDX-License-Identifier: BSD 3-Clause License +SPDX-FileCopyrightText: Copyright (c) 2021, Sam Bacha, <@sambacha> All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +CopyrightNotice +SPDX-License-Identifier: CC-BY-4.0 +SPDX-FileCopyrightText: © 2020 The Solidity Language Authors + + The Solidity logo is distributed and licensed under a Creative Commons Attribution 4.0 International License. + + + + diff --git a/README.md b/README.md index ac4a9c5..67f86ce 100644 --- a/README.md +++ b/README.md @@ -11,21 +11,21 @@ - -[![vscode marketplace](https://badgen.net/vs-marketplace/v/contractshark.solidity-lang)](https://marketplace.visualstudio.com/items?itemName=ContractShark.solidity-lang) ![Open VSX Version](https://img.shields.io/open-vsx/v/contractshark/solidity-lang?logo=eclipse) [![solidity - <0.9.0](https://img.shields.io/badge/solidity-v0.9.0-2ea44f?logo=solidity)](https://github.com/manifoldfinance) +[![vscode marketplace](https://badgen.net/vs-marketplace/v/contractshark.solidity-lang)](https://marketplace.visualstudio.com/items?itemName=ContractShark.solidity-lang) +![Open VSX Version](https://img.shields.io/open-vsx/v/contractshark/solidity-lang?logo=eclipse) +[![solidity - <0.9.0](https://img.shields.io/badge/solidity-v0.9.0-2ea44f?logo=solidity)](https://github.com/manifoldfinance) - ## Motivation -Every Solidity extension on Visual Studio Code's Marketplace contain multiple plugins. This can -lead to an inconsistent developer environment, or worse create conflicting configurations that, -under the pretense of `helping` you, do things in the background to your files without your explicit +Every Solidity extension on Visual Studio Code's Marketplace contain multiple plugins. This can lead +to an inconsistent developer environment, or worse create conflicting configurations that, under the +pretense of `helping` you, do things in the background to your files without your explicit knowledge. -Hence why this extension exists: only to provide syntax highlighting so that you can decided what -to add without having to give up basic functionality. +Hence why this extension exists: only to provide syntax highlighting so that you can decided what to +add without having to give up basic functionality. ## Features @@ -47,7 +47,6 @@ to add without having to give up basic functionality. - [Eclipse Open VSX Registry Marketplace](https://open-vsx.org/extension/contractshark/solidity-lang) - ## Extension Settings This extension contributes the following settings: diff --git a/dist/LICENSE.txt b/dist/LICENSE.txt new file mode 100644 index 0000000..20d68c5 --- /dev/null +++ b/dist/LICENSE.txt @@ -0,0 +1,38 @@ +SPDX-License-Identifier: BSD 3-Clause License +SPDX-FileCopyrightText: Copyright (c) 2021, Sam Bacha, <@sambacha> All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +CopyrightNotice +SPDX-License-Identifier: CC-BY-4.0 +SPDX-FileCopyrightText: © 2020 The Solidity Language Authors + + The Solidity logo is distributed and licensed under a Creative Commons Attribution 4.0 International License. + + + + diff --git a/package.json b/package.json index 14075e1..c791b8d 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "publisher": "ContractShark", "icon": "assets/icon.png", "license": "MIT", - "version": "1.3.0", + "version": "1.4.0", "engines": { - "vscode": "^1.55.0" + "vscode": "^1.65.0" }, "keywords": [ "solidity", @@ -28,7 +28,7 @@ ], "scripts": { "ci": "npm i -g vsce && npm run build", - "build": "npx vsce package", + "build": "npx vsce package -o dist/", "test": "npx ajv-cli test -s tests/tmLanguage.schema.json -d syntaxes/solidity.tmLanguage.json --valid" }, "bugs": { diff --git a/syntaxes/solidity.tmLanguage.json b/syntaxes/solidity.tmLanguage.json index f6a3c29..6cb5c70 100644 --- a/syntaxes/solidity.tmLanguage.json +++ b/syntaxes/solidity.tmLanguage.json @@ -2,8 +2,8 @@ "fileTypes": [ "sol" ], - "name": "solidity", - "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", + "name": "Solidity", + "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", "patterns": [ { "include": "#natspec" @@ -92,6 +92,9 @@ }, { "include": "#natspec-tag-return" + }, + { + "include": "#natspec-tag-custom" } ] }, @@ -111,6 +114,10 @@ "match": "(@dev)\\b", "name": "storage.type.dev.natspec" }, + "natspec-tag-custom": { + "match": "(@custom:)\\b", + "name": "storage.type.custom.natspec" + }, "natspec-tag-param": { "match": "(@param)(\\s+([A-Za-z_]\\w*))?\\b", "captures": { @@ -123,8 +130,15 @@ } }, "natspec-tag-return": { - "match": "(@return)\\b", - "name": "storage.type.return.natspec" + "match": "(@return)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.return.natspec" + }, + "3": { + "name": "variable.other.natspec" + } + } }, "comment": { "patterns": [ @@ -358,7 +372,7 @@ "name": "constant.language.time" }, "constant-currency": { - "match": "\\b(ether|wei|finney|szabo)\\b", + "match": "\\b(ether|wei|gwei|nanoeth|finney|szabo)\\b", "name": "constant.language.currency" }, "number": { @@ -655,17 +669,6 @@ }, "declaration-contract": { "patterns": [ - { - "match": "\\b(contract)\\b\\s+(\\w+)\\b\\s*(?=\\{)", - "captures": { - "1": { - "name": "storage.type.contract" - }, - "2": { - "name": "entity.name.type.contract" - } - } - }, { "begin": "\\b(contract)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+", "end": "(?=\\{)", @@ -686,22 +689,23 @@ "name": "entity.name.type.contract.extend" } ] - } - ] - }, - "declaration-interface": { - "patterns": [ + }, { - "match": "\\b(interface)\\b\\s+(\\w+)\\b\\s*(?=\\{)", + "match": "\\b(contract)(\\s+([A-Za-z_]\\w*))?\\b", "captures": { "1": { - "name": "storage.type.interface" + "name": "storage.type.contract" }, "2": { - "name": "entity.name.type.interface" + "name": "entity.name.type.contract" } } - }, + } + + ] + }, + "declaration-interface": { + "patterns": [ { "begin": "\\b(interface)\\b\\s+(\\w+)\\b\\s+\\b(is)\\b\\s+", "end": "(?=\\{)", @@ -722,7 +726,19 @@ "name": "entity.name.type.interface.extend" } ] + }, + { + "match": "\\b(interface)(\\s+([A-Za-z_]\\w*))?\\b", + "captures": { + "1": { + "name": "storage.type.interface" + }, + "2": { + "name": "entity.name.type.interface" + } + } } + ] }, "declaration-library": { @@ -975,6 +991,9 @@ }, { "include": "#modifier-call" + }, + { + "include": "#punctuation" } ] }, @@ -1096,10 +1115,13 @@ } }, "function-call": { - "match": "\\b([A-Za-z_]\\w*)\\s*\\(", + "match": "\\b([A-Za-z_]\\w*)\\s*(\\()", "captures": { "1": { "name": "entity.name.function" + }, + "2": { + "name": "punctuation.parameters.begin" } } }, @@ -1157,5 +1179,5 @@ } }, "scopeName": "source.solidity", - "uuid": "25f5cd46-fd8e-4a88-986a-239ae90c9877" -} \ No newline at end of file + "uuid": "18e064f3-32b1-44de-ac9e-10f0607d7b84" +}