├── .gitignore ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── .vscodeignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── images ├── error.png ├── highlighting.png └── icon.png ├── package-lock.json ├── package.json ├── pegjs.configuration.json ├── server ├── src │ └── server.ts └── tsconfig.json ├── snippets └── snippets.json ├── src └── main.ts ├── syntaxes └── pegjs.json └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | out/ 3 | tsconfig.tsbuildinfo -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | { 3 | "version": "0.2.0", 4 | "configurations": [ 5 | { 6 | "type": "extensionHost", 7 | "request": "launch", 8 | "name": "Launch Client", 9 | "runtimeExecutable": "${execPath}", 10 | "args": [ 11 | "--extensionDevelopmentPath=${workspaceRoot}" 12 | ], 13 | "outFiles": [ 14 | "${workspaceRoot}/out/**/*.js" 15 | ], 16 | "preLaunchTask": { 17 | "type": "npm", 18 | "script": "watch" 19 | } 20 | }, 21 | { 22 | "type": "node", 23 | "request": "attach", 24 | "name": "Attach to Server", 25 | "port": 6009, 26 | "restart": true, 27 | "outFiles": [ 28 | "${workspaceRoot}/server/out/**/*.js" 29 | ] 30 | } 31 | ], 32 | "compounds": [ 33 | { 34 | "name": "Client + Server", 35 | "configurations": [ 36 | "Launch Client", 37 | "Attach to Server" 38 | ] 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "**/.git": true, 5 | "**/.DS_Store": true, 6 | } 7 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // Available variables which can be used inside of strings. 2 | // ${workspaceRoot}: the root folder of the team 3 | // ${file}: the current opened file 4 | // ${fileBasename}: the current opened file's basename 5 | // ${fileDirname}: the current opened file's dirname 6 | // ${fileExtname}: the current opened file's extension 7 | // ${cwd}: the current working directory of the spawned process 8 | 9 | // A task runner that calls a custom npm script that compiles the extension. 10 | { 11 | "version": "2.0.0", 12 | "tasks": [ 13 | { 14 | "type": "npm", 15 | "script": "compile", 16 | "group": "build", 17 | "presentation": { 18 | "panel": "dedicated", 19 | "reveal": "never" 20 | }, 21 | "problemMatcher": [ 22 | "$tsc" 23 | ] 24 | }, 25 | { 26 | "type": "npm", 27 | "script": "watch", 28 | "isBackground": true, 29 | "group": { 30 | "kind": "build", 31 | "isDefault": true 32 | }, 33 | "presentation": { 34 | "panel": "dedicated", 35 | "reveal": "never" 36 | }, 37 | "problemMatcher": [ 38 | "$tsc-watch" 39 | ] 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | images/*.svg 3 | .gitignore 4 | 5 | **/*.ts 6 | **/out/test/** 7 | **/test/** 8 | **/src/** 9 | **/*.map 10 | **/tsconfig.json 11 | **/tsconfig.tsbuildinfo -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Feel free to contribute to this extension. Please follow this workflow: 4 | 5 | 1. __Open an issue with your bug report / idea / feature.__ 6 | 2. Fork the Repository. 7 | 3. Create a new branch for your coding. 8 | 4. Create a pull request to merge into `master`. 9 | 5. Remember me to add you to the contributors list. 10 | 11 | Use Typescript :) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Tobias Kahlert 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | !!!! Important !!!! 2 | =================== 3 | 4 | There is now a fork of PEG.js, called [Peggy](https://peggyjs.org/), that is actively maintained. I suggest migrating there (Peggy version 1.x.x is fully compatible to the latest PEG.js version). 5 | 6 | They also provide a fork of this extension [here](https://marketplace.visualstudio.com/items?itemName=PeggyJS.peggy-language) with additional features like: 7 | - Goto Definition 8 | - Find Usages 9 | - Rule name completion 10 | - Rename Symbol 11 | - Outline 12 | 13 | Please check it out! 14 | 15 | This extension will stay as it is, continuing to provide support for the latest PEG.js version, but no further development is planned. 16 | 17 | PEG.js Language Support 18 | ======================= 19 | 20 | Syntax highlighting and error reporting for [PEG.js](http://pegjs.org) in Visual Studio Code. 21 | 22 | ## Syntax Highlighting 23 | 24 | ![Syntax Highlighting](/images/highlighting.png) 25 | 26 | ## Error Reporting 27 | 28 | Errors in the grammar are highlighted. Unfortunately only one error at a time is highlighted. 29 | 30 | ![Error Reporting](/images/error.png) 31 | 32 | ## Contributing 33 | 34 | Feel free to contribute to this extension [here](https://github.com/SrTobi/code-pegjs-language). 35 | Please read the [CONTRIBUTING.md](/CONTRIBUTING.md). -------------------------------------------------------------------------------- /images/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrTobi/code-pegjs-language/71459465aae055a76e6dba614f6182f32216afc1/images/error.png -------------------------------------------------------------------------------- /images/highlighting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrTobi/code-pegjs-language/71459465aae055a76e6dba614f6182f32216afc1/images/highlighting.png -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrTobi/code-pegjs-language/71459465aae055a76e6dba614f6182f32216afc1/images/icon.png -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pegjs-language", 3 | "version": "1.0.3", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@types/node": { 8 | "version": "12.12.2", 9 | "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.2.tgz", 10 | "integrity": "sha512-Dt624lmxSFhjor3/QoBAJyqKbPgPnJETqG+eUSxOYwwq5HeHh9hel1c4YAcFmCsClMESmMqcTBbfkjWK+ytCsg==", 11 | "dev": true 12 | }, 13 | "@types/pegjs": { 14 | "version": "0.10.2", 15 | "resolved": "https://registry.npmjs.org/@types/pegjs/-/pegjs-0.10.2.tgz", 16 | "integrity": "sha512-HSiQX7133jjMBOrN3kWaLlpelS6Bg95uJaesr3nwf8qz9MTQorXqbLlErYGxKqXuYgRCKmSLUk0faCKS4yzT3g==", 17 | "dev": true 18 | }, 19 | "@types/vscode": { 20 | "version": "1.50.0", 21 | "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.50.0.tgz", 22 | "integrity": "sha512-QnIeyi4L2DiD9M2bAQKRzT/EQvc80qP9UL6JD5TiLlNRL1khIDg4ej4mDSRbtFrDAsRntFI1RhMvdomUThMsqg==", 23 | "dev": true 24 | }, 25 | "pegjs": { 26 | "version": "0.10.0", 27 | "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", 28 | "integrity": "sha1-z4uvrm7d/0tafvsYUmnqr0YQ3b0=" 29 | }, 30 | "semver": { 31 | "version": "6.3.0", 32 | "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 33 | "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" 34 | }, 35 | "typescript": { 36 | "version": "4.0.3", 37 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz", 38 | "integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==", 39 | "dev": true 40 | }, 41 | "vscode-jsonrpc": { 42 | "version": "5.0.1", 43 | "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-5.0.1.tgz", 44 | "integrity": "sha512-JvONPptw3GAQGXlVV2utDcHx0BiY34FupW/kI6mZ5x06ER5DdPG/tXWMVHjTNULF5uKPOUUD0SaXg5QaubJL0A==" 45 | }, 46 | "vscode-languageclient": { 47 | "version": "6.1.3", 48 | "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-6.1.3.tgz", 49 | "integrity": "sha512-YciJxk08iU5LmWu7j5dUt9/1OLjokKET6rME3cI4BRpiF6HZlusm2ZwPt0MYJ0lV5y43sZsQHhyon2xBg4ZJVA==", 50 | "requires": { 51 | "semver": "^6.3.0", 52 | "vscode-languageserver-protocol": "^3.15.3" 53 | } 54 | }, 55 | "vscode-languageserver": { 56 | "version": "6.1.1", 57 | "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-6.1.1.tgz", 58 | "integrity": "sha512-DueEpkUAkD5XTR4MLYNr6bQIp/UFR0/IPApgXU3YfCBCB08u2sm9hRCs6DxYZELkk++STPjpcjksR2H8qI3cDQ==", 59 | "requires": { 60 | "vscode-languageserver-protocol": "^3.15.3" 61 | } 62 | }, 63 | "vscode-languageserver-protocol": { 64 | "version": "3.15.3", 65 | "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.3.tgz", 66 | "integrity": "sha512-zrMuwHOAQRhjDSnflWdJG+O2ztMWss8GqUUB8dXLR/FPenwkiBNkMIJJYfSN6sgskvsF0rHAoBowNQfbyZnnvw==", 67 | "requires": { 68 | "vscode-jsonrpc": "^5.0.1", 69 | "vscode-languageserver-types": "3.15.1" 70 | } 71 | }, 72 | "vscode-languageserver-textdocument": { 73 | "version": "1.0.1", 74 | "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.1.tgz", 75 | "integrity": "sha512-UIcJDjX7IFkck7cSkNNyzIz5FyvpQfY7sdzVy+wkKN/BLaD4DQ0ppXQrKePomCxTS7RrolK1I0pey0bG9eh8dA==" 76 | }, 77 | "vscode-languageserver-types": { 78 | "version": "3.15.1", 79 | "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.15.1.tgz", 80 | "integrity": "sha512-+a9MPUQrNGRrGU630OGbYVQ+11iOIovjCkqxajPa9w57Sd5ruK8WQNsslzpa0x/QJqC8kRc2DUxWjIFwoNm4ZQ==" 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pegjs-language", 3 | "displayName": "PEG.js Language", 4 | "description": "Syntax highlighting and error reporting for PEG.js", 5 | "version": "1.0.4", 6 | "license": "MIT", 7 | "publisher": "SirTobi", 8 | "author": { 9 | "name": "Tobias Kahlert", 10 | "email": "code.databyte@gmail.com" 11 | }, 12 | "homepage": "https://github.com/SrTobi/code-pegjs-language", 13 | "engines": { 14 | "vscode": "^1.50.0" 15 | }, 16 | "categories": [ 17 | "Programming Languages", 18 | "Snippets" 19 | ], 20 | "icon": "images/icon.png", 21 | "bugs": { 22 | "url": "https://github.com/SrTobi/code-pegjs-language/issues" 23 | }, 24 | "repository": { 25 | "type": "git", 26 | "url": "https://github.com/SrTobi/code-pegjs-language" 27 | }, 28 | "activationEvents": [ 29 | "onLanguage:pegjs" 30 | ], 31 | "main": "./out/main", 32 | "contributes": { 33 | "languages": [ 34 | { 35 | "id": "pegjs", 36 | "aliases": [ 37 | "PEG.js", 38 | "pegjs", 39 | "peg.js" 40 | ], 41 | "extensions": [ 42 | ".pegjs" 43 | ], 44 | "configuration": "./pegjs.configuration.json" 45 | } 46 | ], 47 | "grammars": [ 48 | { 49 | "language": "pegjs", 50 | "scopeName": "source.pegjs", 51 | "path": "./syntaxes/pegjs.json", 52 | "embeddedLanguages": { 53 | "meta.embedded.block.javascript": "javascript" 54 | } 55 | } 56 | ], 57 | "snippets": [ 58 | { 59 | "language": "pegjs", 60 | "path": "./snippets/snippets.json" 61 | } 62 | ] 63 | }, 64 | "scripts": { 65 | "vscode:prepublish": "rm -r ./node_modules ./out ./server/out ./server/tsconfig.tsbuildinfo && npm install && npm run compile && npm prune --production", 66 | "compile": "tsc -b", 67 | "watch": "tsc -b -w" 68 | }, 69 | "devDependencies": { 70 | "typescript": "^4.0.3", 71 | "@types/pegjs": "^0.10.2", 72 | "@types/vscode": "^1.50.0", 73 | "@types/node": "12.12.2" 74 | }, 75 | "dependencies": { 76 | "pegjs": "^0.10.0", 77 | "vscode-languageserver": "^6.1.1", 78 | "vscode-languageserver-textdocument": "^1.0.1", 79 | "vscode-languageclient": "^6.1.3" 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /pegjs.configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | "lineComment": "//", 4 | "blockComment": [ "/*", "*/" ] 5 | }, 6 | // symbols used as brackets 7 | "brackets": [ 8 | ["(", ")"], 9 | ["[", "]"], 10 | ["{", "}"] 11 | ] 12 | } -------------------------------------------------------------------------------- /server/src/server.ts: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import * as PEG from 'pegjs'; 4 | import { 5 | createConnection, 6 | Diagnostic, 7 | 8 | DiagnosticSeverity, IConnection, 9 | 10 | InitializeResult, 11 | ProposedFeatures, 12 | Range, TextDocuments, 13 | TextDocumentSyncKind 14 | } from 'vscode-languageserver'; 15 | import { 16 | TextDocument 17 | } from 'vscode-languageserver-textdocument'; 18 | 19 | 20 | 21 | // Create a connection for the server. The connection uses 22 | // stdin / stdout for message passing 23 | let connection: IConnection = createConnection(ProposedFeatures.all); 24 | 25 | // Create a simple text document manager. The text document manager 26 | // supports full document sync only 27 | let documents = new TextDocuments(TextDocument); 28 | // Make the text document manager listen on the connection 29 | // for open, change and close text document events 30 | documents.listen(connection); 31 | 32 | // After the server has started the client sends an initilize request. The server receives 33 | // in the passed params the rootPath of the workspace plus the client capabilites. 34 | connection.onInitialize((): InitializeResult => { 35 | return { 36 | capabilities: { 37 | // Tell the client that the server works in FULL text document sync mode 38 | textDocumentSync: TextDocumentSyncKind.Incremental 39 | } 40 | } 41 | }); 42 | 43 | function pegjsLoc_to_vscodeRange(loc: PEG.LocationRange): Range { 44 | return { 45 | start: { 46 | line: loc.start.line - 1, 47 | character: loc.start.column - 1 48 | }, 49 | end: { 50 | line: loc.end.line - 1, 51 | character: loc.end.column - 1 52 | } 53 | }; 54 | } 55 | 56 | documents.onDidChangeContent((change) => { 57 | let diagnostics: Diagnostic[] = []; 58 | 59 | try { 60 | PEG.generate(change.document.getText()) 61 | } catch(error) 62 | { 63 | let err = error as PEG.GrammarError; 64 | diagnostics.push({ 65 | severity: DiagnosticSeverity.Error, 66 | range: pegjsLoc_to_vscodeRange(err.location), 67 | message: err.name + ": " + err.message 68 | }); 69 | } 70 | 71 | // Send the computed diagnostics to VS Code. 72 | connection.sendDiagnostics({ uri: change.document.uri, diagnostics }); 73 | }); 74 | 75 | // Listen on the connection 76 | connection.listen(); -------------------------------------------------------------------------------- /server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es2019", 5 | "lib": ["ES2019"], 6 | "moduleResolution": "node", 7 | 8 | "composite": true, 9 | 10 | "sourceMap": true, 11 | "noImplicitAny": true, 12 | "rootDir": "src", 13 | "outDir": "out" 14 | }, 15 | "include": [ 16 | "src" 17 | ] 18 | } -------------------------------------------------------------------------------- /snippets/snippets.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import * as path from 'path'; 4 | 5 | import { workspace, ExtensionContext } from 'vscode'; 6 | import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind } from 'vscode-languageclient'; 7 | 8 | export function activate(context: ExtensionContext) { 9 | 10 | // The server is implemented in node 11 | let serverModule = context.asAbsolutePath(path.join('server', 'out', 'server.js')); 12 | // The debug options for the server 13 | let debugOptions = { execArgv: ["--nolazy", "--inspect=6009"] }; 14 | 15 | // If the extension is launch in debug mode the debug server options are use 16 | // Otherwise the run options are used 17 | let serverOptions: ServerOptions = { 18 | run : { module: serverModule, transport: TransportKind.ipc }, 19 | debug: { module: serverModule, options: debugOptions } 20 | } 21 | 22 | // Options to control the language client 23 | let clientOptions: LanguageClientOptions = { 24 | // Register the server for plain text documents 25 | documentSelector: [{ language: 'pegjs' }], 26 | synchronize: { 27 | // Notify the server about file changes to '.clientrc files condisposabletain in the workspace 28 | fileEvents: workspace.createFileSystemWatcher('**/.clientrc') 29 | } 30 | } 31 | 32 | // Create the language client and start the client. 33 | let server = new LanguageClient('Language Server PEG.js', serverOptions, clientOptions) 34 | let disposable = server.start() 35 | 36 | // Push the disposable to the context's subscriptions so that the 37 | // client can be deactivated on extension deactivation 38 | context.subscriptions.push(disposable); 39 | } -------------------------------------------------------------------------------- /syntaxes/pegjs.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileTypes": [ 3 | "pegjs" 4 | ], 5 | "name": "PEG.js File", 6 | "patterns": [ 7 | { 8 | "include": "#comment" 9 | }, 10 | { 11 | "include": "#label" 12 | }, 13 | { 14 | "include": "#defRule" 15 | }, 16 | { 17 | "include": "#rule" 18 | }, 19 | { 20 | "include": "#literal" 21 | }, 22 | { 23 | "include": "#charclass" 24 | }, 25 | { 26 | "include": "#operators" 27 | }, 28 | { 29 | "include": "#inlinejs" 30 | } 31 | ], 32 | "repository": { 33 | "comment": { 34 | "patterns": [ 35 | { 36 | "begin": "/\\*", 37 | "end": "\\*/", 38 | "name": "comment.block.pegjs" 39 | }, 40 | { 41 | "match": "//.*$\\n?", 42 | "name": "comment.line.double-slash.pegjs" 43 | } 44 | ] 45 | }, 46 | "label": { 47 | "match": "(\\w+)\\s*(?=:)", 48 | "captures": { 49 | "1": { 50 | "name": "entity.other.attribute-name.attribute.pegjs" 51 | } 52 | } 53 | }, 54 | "rule": { 55 | "match": "[a-zA-Z_][a-zA-Z_0-9]*", 56 | "name": "entity.name.function.pegjs" 57 | }, 58 | "literal": { 59 | "patterns": [ 60 | { 61 | "begin": "\"", 62 | "end": "\"", 63 | "name": "string.quoted.double.pegjs", 64 | "patterns": [ 65 | { 66 | "match": "\\\\(x\\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)", 67 | "name": "constant.character.escape.pegjs" 68 | }, 69 | { 70 | "match": "[^\"]*[^\\n\\r\"\\\\]$", 71 | "name": "invalid.illegal.string.pegjs" 72 | } 73 | ] 74 | }, 75 | { 76 | "begin": "'", 77 | "end": "'", 78 | "name": "string.quoted.single.pegjs", 79 | "patterns": [ 80 | { 81 | "match": "\\\\(x\\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)", 82 | "name": "constant.character.escape.pegjs" 83 | }, 84 | { 85 | "match": "[^']*[^\\n\\r'\\\\]$", 86 | "name": "invalid.illegal.string.pegjs" 87 | } 88 | ] 89 | } 90 | ] 91 | }, 92 | "charclass": { 93 | "begin": "\\[", 94 | "end": "\\]", 95 | "name": "declaration.keyword.pegjs" 96 | }, 97 | "defRule": { 98 | "match": "(\\w+)\\s*(?=\\=)", 99 | "captures": { 100 | "1": { 101 | "name": "entity.name.function.pegjs" 102 | } 103 | } 104 | }, 105 | "operators": { 106 | "match": "[*?/.$!=+&]", 107 | "name": "keyword.operator.pegjs" 108 | }, 109 | "inlinejs": { 110 | "begin": "{", 111 | "end": "}", 112 | "name": "meta.embedded.block.javascript", 113 | "patterns": [ 114 | { 115 | "include": "source.js" 116 | } 117 | ] 118 | } 119 | }, 120 | "scopeName": "source.pegjs" 121 | } 122 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es2019", 5 | "lib": ["ES2019"], 6 | 7 | "sourceMap": true, 8 | "incremental": false, 9 | 10 | "noImplicitAny": true, 11 | "rootDir": "src", 12 | "outDir": "out" 13 | }, 14 | "include": [ 15 | "src" 16 | ], 17 | "references": [ 18 | { "path": "./server" } 19 | ] 20 | } --------------------------------------------------------------------------------