diff --git a/vscode-extensions/vscode-boot/.gitignore b/vscode-extensions/vscode-boot/.gitignore new file mode 100644 index 000000000..e0fd3a462 --- /dev/null +++ b/vscode-extensions/vscode-boot/.gitignore @@ -0,0 +1,17 @@ +out +node_modules +target +*.log +*.log.* +classpath.txt +*.vsix +repo +.idea +*.iml +.DS_Store +**/.DS_Store +src/test/resources/test-projects/**/.classpath +src/test/resources/test-projects/**/.project +src/test/resources/test-projects/**/.factorypath +src/test/resources/test-projects/**/.settings/** +src/test/resources/test-projects/**/bin/** \ No newline at end of file diff --git a/vscode-extensions/vscode-boot/.vscode/launch.json b/vscode-extensions/vscode-boot/.vscode/launch.json new file mode 100644 index 000000000..07e1c6011 --- /dev/null +++ b/vscode-extensions/vscode-boot/.vscode/launch.json @@ -0,0 +1,31 @@ +// A launch configuration that compiles the extension and then opens it inside a new window +{ + "version": "0.1.0", + "configurations": [ + { + "type": "extensionHost", + "request": "launch", + "name": "Launch Extension", + "runtimeExecutable": "${execPath}", + "args": [ + "--extensionDevelopmentPath=${workspaceRoot}" + ], + "sourceMaps": true, + "outFiles": [ + "${workspaceRoot}/out/**/*.js" + ], + "preLaunchTask": "npm" + }, + { + "name": "Launch Tests", + "type": "extensionHost", + "request": "launch", + "runtimeExecutable": "${execPath}", + "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ], + "stopOnEntry": false, + "sourceMaps": true, + "outDir": "${workspaceRoot}/out/test", + "preLaunchTask": "npm" + } + ] +} diff --git a/vscode-extensions/vscode-boot/.vscode/settings.json b/vscode-extensions/vscode-boot/.vscode/settings.json new file mode 100644 index 000000000..c5592bee9 --- /dev/null +++ b/vscode-extensions/vscode-boot/.vscode/settings.json @@ -0,0 +1,12 @@ +// Place your settings in this file to overwrite default and user settings. +{ + "files.exclude": { + "out": true, // set this to true to hide the "out" folder with the compiled JS files + "node_modules": false, + "target": true + }, + "search.exclude": { + "out": true // set this to false to include "out" folder in search results + }, + "typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version +} \ No newline at end of file diff --git a/vscode-extensions/vscode-boot/.vscode/tasks.json b/vscode-extensions/vscode-boot/.vscode/tasks.json new file mode 100644 index 000000000..1cbb9fd45 --- /dev/null +++ b/vscode-extensions/vscode-boot/.vscode/tasks.json @@ -0,0 +1,30 @@ +// Available variables which can be used inside of strings. +// ${workspaceRoot}: the root folder of the team +// ${file}: the current opened file +// ${fileBasename}: the current opened file's basename +// ${fileDirname}: the current opened file's dirname +// ${fileExtname}: the current opened file's extension +// ${cwd}: the current working directory of the spawned process + +// A task runner that calls a custom npm script that compiles the extension. +{ + "version": "0.1.0", + + // we want to run npm + "command": "npm", + + // the command is a shell script + "isShellCommand": true, + + // show the output window only if unrecognized errors occur. + "showOutput": "silent", + + // we run the custom script "compile" as defined in package.json + "args": ["run", "compile"], //, "--loglevel", "silent"], + + // The tsc compiler is started in watching mode + "isWatching": true, + + // use the standard tsc in watch mode problem matcher to find compile problems in the output. + "problemMatcher": "$tsc-watch" +} \ No newline at end of file diff --git a/vscode-extensions/vscode-boot/.vscodeignore b/vscode-extensions/vscode-boot/.vscodeignore new file mode 100644 index 000000000..37a538825 --- /dev/null +++ b/vscode-extensions/vscode-boot/.vscodeignore @@ -0,0 +1,30 @@ +# IDE configs +.vscode/** +.idea/** +*.iml +javaconfig.json +classpath.txt +tsconfig.json +tsd.json +*.xml + +# Logs +*.log* + +# Sources +typings/** +src/** +test/** +lib/** +!lib/javaconfig.schema.json +repo/** +scripts/** + +# Compiler output +out/test/** +target/** +!target/vscode-boot-properties-*.jar + +# Extensions +.gitignore +**/*.map diff --git a/vscode-extensions/vscode-boot/DEVELOPER-NOTES.md b/vscode-extensions/vscode-boot/DEVELOPER-NOTES.md new file mode 100644 index 000000000..cf924f168 --- /dev/null +++ b/vscode-extensions/vscode-boot/DEVELOPER-NOTES.md @@ -0,0 +1,60 @@ +# Developer notes + +## Bulding and Running + +This project consists of three pieces: + + - a vscode-extension which is a language-server client implemented in TypeScript. + - commons-vscode: a local npm module with some utilities implemented in TypeScript. + - a language server implemented in Java. + +To build all these pieces you normally only need to run: + + npm install + +**However, the first time you build** it might fail trying to +find the `commons-vscode` module on npm central. Once we publish a stable +version of that module on npm central that will no longer be a problem. +Until that time, you can work around this by doing a one time manual +run of the `preinstall` script prior to running `npm install`: + + ./scripts/preinstall.sh + npm install + +Now you can open the client-app in vscode. From the root of this project. + + code . + +To launch the language server in a vscode runtime, press F5. + +## Debugging + +### Method 1: attach remote debugger to Language Server + +To debug the language server, open `lib/Main.ts` and edit to set the +`DEBUG` option to `true`. When you launch the app next by pressing +`F5` it will launch with debug options being passed to the server JVM. + +You can then connect a 'Remote Java' debugger on port 8000. + +### Method 2: Launch a 'standalone' Language Server + +To debug the language server, open `lib/Main.ts` and edit to set the +`CONNECT_TO_LS` option to `true`. When you launch the app next by pressing +`F5`... When it needs a language server it not launch a process but instead +try to connect to an already running server on port `5007`. It is up to you +to ensure a server is running on that port by launching it beforehand +with a commandline arguments: `-Dstandalone-startup=true`. + +## Packaging as a vscode extension + +First make sure the stuff is all built locally: + + ./scripts/preinstall.sh # only needed if this is the first build. + npm install + +Then package it: + + npm run vsce-package + +This produces a `.vsix` file which you can install directly into vscode. \ No newline at end of file diff --git a/vscode-extensions/vscode-boot/README.md b/vscode-extensions/vscode-boot/README.md new file mode 100644 index 000000000..169f5a8c6 --- /dev/null +++ b/vscode-extensions/vscode-boot/README.md @@ -0,0 +1,58 @@ +# VS Code Language Server for Spring Boot Application Properties + +VSCode extension and Language Server providing support for working with Spring Boot +`application.properties` and `application.yml` files. + +# Usage: + +The extension will automatically activate when you edit files with the following +name patterns: + + - `application*.properties` => activates support for Spring Boot properties in `.properties`format. + - `application*.yml` => activates support for Spring Boot properties in `.yml` format. + +You can also define your own patterns and map them to the language-ids +`spring-boot-properties` or `spring-boot-properties-yaml` by defining `files.associations` +in workspace settings. See [vscode documentation](https://code.visualstudio.com/Docs/languages/overview#_adding-a-file-extension-to-a-language) for details. + +# Functionality + +This extension analyzes your project's classpath and parses and indexes any [Spring Boot +Properties Metadata](https://docs.spring.io/spring-boot/docs/current/reference/html/configuration-metadata.html) it finds. Both Maven and Gradle projects are supported. + +The data in the index is used to provide validation, code completions and information +hovers while editing Spring Boot Properties in either `.properties` or `.yml` format. + +## Validation + +![application-yaml-validation][yaml-validation] +![application-properties-validation][properties-validation] + +## Code Completions + +![application-yaml-completions][yaml-completion] + +![application-properties-completions][properties-completion] + +## Information Hovers + +![application-yaml-hovers][yaml-hovers] + +## Issues and Feature Requests + +Please report bugs, issues and feature requests on the [Github STS4 issue tracker](https://github.com/spring-projects/sts4/issues). + +# Releases: + +Released versions of this extension can be installed directly from the vscode marketplace. + +There are also development snapshots available with the latest fixes and improvements as a `.vsix` file +that can be donwloaded from +[here](http://dist.springsource.com/snapshot/STS4/nightly-distributions.html). To install it +open vscode, press `CTRL-SHIFT-P` and search for VSIX, then select `Extension: Install from VSIX` + +[yaml-completion]: https://github.com/spring-projects/sts4/raw/5360ae4fabf9245da58f5897c54e9a14786d0622/vscode-extensions/vscode-boot-properties/readme-imgs/yaml-completion.png +[properties-completion]: https://github.com/spring-projects/sts4/raw/5360ae4fabf9245da58f5897c54e9a14786d0622/vscode-extensions/vscode-boot-properties/readme-imgs/properties-completion.png +[yaml-validation]: https://github.com/spring-projects/sts4/raw/5360ae4fabf9245da58f5897c54e9a14786d0622/vscode-extensions/vscode-boot-properties/readme-imgs/yaml-validation.png +[properties-validation]: https://github.com/spring-projects/sts4/raw/5360ae4fabf9245da58f5897c54e9a14786d0622/vscode-extensions/vscode-boot-properties/readme-imgs/properties-validation.png +[yaml-hovers]: https://github.com/spring-projects/sts4/raw/1d731ed1ad5c8defcca4e4abb3cf5f2d89daba43/vscode-extensions/vscode-boot-properties/readme-imgs/yaml-hover.png diff --git a/vscode-extensions/vscode-boot/lib/.gitignore b/vscode-extensions/vscode-boot/lib/.gitignore new file mode 100644 index 000000000..a6c7c2852 --- /dev/null +++ b/vscode-extensions/vscode-boot/lib/.gitignore @@ -0,0 +1 @@ +*.js diff --git a/vscode-extensions/vscode-boot/lib/Main.ts b/vscode-extensions/vscode-boot/lib/Main.ts new file mode 100644 index 000000000..3a2988ade --- /dev/null +++ b/vscode-extensions/vscode-boot/lib/Main.ts @@ -0,0 +1,32 @@ +'use strict'; +// The module 'vscode' contains the VS Code extensibility API +// Import the module and reference it with the alias vscode in your code below + +import * as VSCode from 'vscode'; +import * as Path from 'path'; +import * as FS from 'fs'; +import * as Net from 'net'; +import * as ChildProcess from 'child_process'; +import {LanguageClient, LanguageClientOptions, SettingMonitor, ServerOptions, StreamInfo} from 'vscode-languageclient'; +import {TextDocument} from 'vscode'; + +import * as commons from 'commons-vscode'; + +const PROPERTIES_LANGUAGE_ID = "spring-boot-properties"; +const YAML_LANGUAGE_ID = "spring-boot-properties-yaml"; +const JAVA_LANGUAGE_ID = "java"; + +/** Called when extension is activated */ +export function activate(context: VSCode.ExtensionContext) { + let options : commons.ActivatorOptions = { + DEBUG: false, + CONNECT_TO_LS: false, + extensionId: 'vscode-boot', + launcher: (context: VSCode.ExtensionContext) => Path.resolve(context.extensionPath, 'jars/language-server.jar'), + jvmHeap: "160m", + clientOptions: { + documentSelector: [ PROPERTIES_LANGUAGE_ID, YAML_LANGUAGE_ID, JAVA_LANGUAGE_ID ] + } + }; + let clientPromise = commons.activate(options, context); +} diff --git a/vscode-extensions/vscode-boot/package.json b/vscode-extensions/vscode-boot/package.json new file mode 100644 index 000000000..cd75951fd --- /dev/null +++ b/vscode-extensions/vscode-boot/package.json @@ -0,0 +1,91 @@ +{ + "name": "vscode-boot", + "displayName": "Spring Boot Support", + "description": "Provides validation and content assist for Spring Boot `application.properties`, `application.yml` properties files. As well as Boot-specific support for `.java` files.", + "icon": "spring-boot-logo.png", + "version": "0.1.4", + "publisher": "Pivotal", + "repository": { + "type": "git", + "url": "https://github.com/spring-projects/sts4.git" + }, + "license": "EPL-1.0", + "engines": { + "npm": "^3.0.0", + "vscode": "^1.19.0" + }, + "categories": [ + "Languages", + "Linters" + ], + "keywords": [ + "java-properties", + "spring-boot", + "java", + "application-properties", + "application-yaml" + ], + "activationEvents": [ + "onLanguage:spring-boot-properties", + "onLanguage:spring-boot-properties-yaml", + "onLanguage:java" + ], + "contributes": { + "languages": [ + { + "id": "spring-boot-properties-yaml", + "aliases": [ + "Spring Boot Properties Yaml" + ], + "filenamePatterns": [ + "application*.yml", + "bootstrap*.yml" + ], + "configuration": "./yaml-support/language-configuration.json" + }, + { + "id": "spring-boot-properties", + "aliases": [ + "Spring Boot Properties" + ], + "filenamePatterns": [ + "application*.properties", + "bootstrap*.yml" + ], + "configuration": "./properties-support/language-configuration.json" + } + ], + "grammars": [ + { + "language": "spring-boot-properties-yaml", + "scopeName": "source.yaml", + "path": "./yaml-support/yaml.tmLanguage" + }, + { + "language": "spring-boot-properties", + "scopeName": "source.java-properties", + "path": "./properties-support/java-properties.tmLanguage" + } + ] + }, + "main": "./out/lib/Main", + "scripts": { + "vscode:prepublish": "npm run compile", + "compile": "tsc -p ./", + "watch": "tsc -watch -p ./", + "clean": "rm -fr node_modules out *.vsix package-lock.json", + "preinstall": "./scripts/preinstall.sh", + "postinstall": "node ./node_modules/vscode/bin/install", + "vsce-package": "vsce package" + }, + "dependencies": { + "commons-vscode": "file:../commons-vscode/commons-vscode-0.1.4.tgz", + "vscode-languageclient": "^3.4.2" + }, + "devDependencies": { + "vsce": "^1.36.1", + "typescript": "2.6.1", + "@types/node": "^7.0.43", + "vscode": "^1.1.10" + } +} diff --git a/vscode-extensions/vscode-boot/properties-support/OSSREADME.json b/vscode-extensions/vscode-boot/properties-support/OSSREADME.json new file mode 100644 index 000000000..c1ebef0ea --- /dev/null +++ b/vscode-extensions/vscode-boot/properties-support/OSSREADME.json @@ -0,0 +1,13 @@ +// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS: + +[{ + "name": "textmate/java.tmbundle", + "version": "0.0.0", + "repositoryURL": "https://github.com/textmate/java.tmbundle/blob/master/Syntaxes/JavaProperties.plist", + "licenseDetail": [ + "Permission to copy, use, modify, sell and distribute this", + "software is granted. This software is provided \"as is\" without", + "express or implied warranty, and with no claim as to its", + "suitability for any purpose." + ] +}] diff --git a/vscode-extensions/vscode-boot/properties-support/java-properties.tmLanguage b/vscode-extensions/vscode-boot/properties-support/java-properties.tmLanguage new file mode 100644 index 000000000..bf25ce875 --- /dev/null +++ b/vscode-extensions/vscode-boot/properties-support/java-properties.tmLanguage @@ -0,0 +1,160 @@ + + + + + fileTypes + + properties + + foldingStartMarker + ^[a-zA-Z0-9.-_]+=.*\ + + foldingStopMarker + ^(.*(?<!\) +) + keyEquivalent + ^~J + name + Java Properties + patterns + + + comment + Ignore blank lines + match + ^\s*$ + + + include + #comment-line + + + include + #property-name + + + include + #property-definition + + + repository + + comment-line + + captures + + 1 + + name + punctuation.whitespace.comment.leading.java-properties + + 2 + + name + punctuation.definition.comment.java-properties + + + match + ^(\s*)([#!])(.+)?$\n? + name + comment.line.java-properties + + property-definition + + begin + ^(\s*)((?:\\[ \t]|\\:|\\=|[^:=\s])+)(?:\s*([:=]))?\s* + beginCaptures + + 1 + + name + punctuation.whitespace.leading.java-properties + + 2 + + name + support.constant.java-properties + patterns + + + match + \\(?:[ \t:=\\ntfr\"']|u[0-9A-Fa-f]{4}) + name + constant.character.escape.java-properties + + + + 3 + + name + punctuation.separator.key-value.java-properties + + + contentName + string.unquoted.java-properties + end + (?<!\\{1})$\n + name + meta.key-value.java-properties + patterns + + + comment + Leading space on a continued line is ignored + match + ^\s* + name + punctuation.whitespace.leading.java-properties + + + match + (\\{1})(?=$\n) + name + punctuation.separator.continuation.java-properties + + + match + \\(?:[\\ntfr\"']|u[0-9A-Fa-f]{4}) + name + constant.character.escape.java-properties + + + + property-name + + captures + + 1 + + name + punctuation.whitespace.comment.leading.java-properties + + 2 + + name + support.constant.java-properties + patterns + + + match + \\(?:[ \t:=\\ntfr\"']|u[0-9A-Fa-f]{4}) + name + constant.character.escape.java-properties + + + + + comment + A property name with no value + match + ^(\s*)((?:\\[ \t]|\\:|\\=|[^:=\s])+)(?:\s*([:=]))?\s*$\n + name + meta.key-value.java-properties + + + scopeName + source.java-properties + uuid + D364E829-7643-4AFF-948D-3C0D6B4EA8A4 + + diff --git a/vscode-extensions/vscode-boot/properties-support/language-configuration.json b/vscode-extensions/vscode-boot/properties-support/language-configuration.json new file mode 100644 index 000000000..053f8fee2 --- /dev/null +++ b/vscode-extensions/vscode-boot/properties-support/language-configuration.json @@ -0,0 +1,21 @@ +{ + "comments": { + "lineComment": "#" + }, + "brackets": [ + ], + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/vscode-extensions/vscode-boot/readme-imgs/properties-completion.png b/vscode-extensions/vscode-boot/readme-imgs/properties-completion.png new file mode 100644 index 000000000..12e591f1a Binary files /dev/null and b/vscode-extensions/vscode-boot/readme-imgs/properties-completion.png differ diff --git a/vscode-extensions/vscode-boot/readme-imgs/properties-validation.png b/vscode-extensions/vscode-boot/readme-imgs/properties-validation.png new file mode 100644 index 000000000..92949cd6a Binary files /dev/null and b/vscode-extensions/vscode-boot/readme-imgs/properties-validation.png differ diff --git a/vscode-extensions/vscode-boot/readme-imgs/yaml-completion.png b/vscode-extensions/vscode-boot/readme-imgs/yaml-completion.png new file mode 100644 index 000000000..8fa36eae1 Binary files /dev/null and b/vscode-extensions/vscode-boot/readme-imgs/yaml-completion.png differ diff --git a/vscode-extensions/vscode-boot/readme-imgs/yaml-hover.png b/vscode-extensions/vscode-boot/readme-imgs/yaml-hover.png new file mode 100644 index 000000000..acd07df3d Binary files /dev/null and b/vscode-extensions/vscode-boot/readme-imgs/yaml-hover.png differ diff --git a/vscode-extensions/vscode-boot/readme-imgs/yaml-validation.png b/vscode-extensions/vscode-boot/readme-imgs/yaml-validation.png new file mode 100644 index 000000000..8135c703b Binary files /dev/null and b/vscode-extensions/vscode-boot/readme-imgs/yaml-validation.png differ diff --git a/vscode-extensions/vscode-boot/scripts/preinstall.sh b/vscode-extensions/vscode-boot/scripts/preinstall.sh new file mode 100755 index 000000000..4d2e09b1d --- /dev/null +++ b/vscode-extensions/vscode-boot/scripts/preinstall.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +workdir=`pwd` + +# Preinstall commons-vscode package +(cd ../commons-vscode ; npm install ; npm pack) +npm install ../commons-vscode/commons-vscode-*.tgz + +# Copy grammar files for .properties and .yml format +curl https://raw.githubusercontent.com/textmate/yaml.tmbundle/master/Syntaxes/YAML.tmLanguage > yaml-support/yaml.tmLanguage +curl https://raw.githubusercontent.com/textmate/java.tmbundle/master/Syntaxes/JavaProperties.plist > properties-support/java-properties.tmLanguage + +# Use maven to build fat jar of the language server +cd ../../headless-services/boot-language-server +./build.sh + +mkdir -p ${workdir}/jars +cp target/*.jar ${workdir}/jars/language-server.jar + diff --git a/vscode-extensions/vscode-boot/spring-boot-logo.png b/vscode-extensions/vscode-boot/spring-boot-logo.png new file mode 100644 index 000000000..0ccdef63a Binary files /dev/null and b/vscode-extensions/vscode-boot/spring-boot-logo.png differ diff --git a/vscode-extensions/vscode-boot/tsconfig.json b/vscode-extensions/vscode-boot/tsconfig.json new file mode 100644 index 000000000..1905ffea7 --- /dev/null +++ b/vscode-extensions/vscode-boot/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "target": "es6", + "lib": [ + "es6" + ], + "declaration": true, + "outDir": "out", + "sourceMap": true, + "rootDir": "." + }, + "include": [ + "typings/*.d.ts", + "lib/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/vscode-extensions/vscode-boot/yaml-support/OSSREADME.json b/vscode-extensions/vscode-boot/yaml-support/OSSREADME.json new file mode 100644 index 000000000..bcdae2a4c --- /dev/null +++ b/vscode-extensions/vscode-boot/yaml-support/OSSREADME.json @@ -0,0 +1,28 @@ +// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS: + +[{ + "name": "textmate/yaml.tmbundle", + "version": "0.0.0", + "license": "TextMate Bundle License", + "repositoryURL": "https://github.com/textmate/yaml.tmbundle", + "licenseDetail": [ + "Copyright (c) 2015 FichteFoll ", + "", + "Permission is hereby granted, free of charge, to any person obtaining a copy", + "of this software and associated documentation files (the \"Software\"), to deal", + "in the Software without restriction, including without limitation the rights", + "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell", + "copies of the Software, and to permit persons to whom the Software is", + "furnished to do so, subject to the following conditions:", + "", + "The above copyright notice and this permission notice shall be included in all", + "copies or substantial portions of the Software.", + "", + "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR", + "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,", + "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE", + "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER", + "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,", + "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." + ] +}] diff --git a/vscode-extensions/vscode-boot/yaml-support/language-configuration.json b/vscode-extensions/vscode-boot/yaml-support/language-configuration.json new file mode 100644 index 000000000..cab4f6602 --- /dev/null +++ b/vscode-extensions/vscode-boot/yaml-support/language-configuration.json @@ -0,0 +1,24 @@ +{ + "comments": { + "lineComment": "#" + }, + "brackets": [ + ["{", "}"], + ["[", "]"], + ["(", ")"] + ], + "autoClosingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ], + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["\"", "\""], + ["'", "'"] + ] +} \ No newline at end of file diff --git a/vscode-extensions/vscode-boot/yaml-support/yaml.tmLanguage b/vscode-extensions/vscode-boot/yaml-support/yaml.tmLanguage new file mode 100644 index 000000000..efc4c8ab0 --- /dev/null +++ b/vscode-extensions/vscode-boot/yaml-support/yaml.tmLanguage @@ -0,0 +1,1164 @@ + + + + + fileTypes + + yaml + yml + rviz + reek + clang-format + yaml-tmlanguage + syntax + sublime-syntax + + firstLineMatch + ^%YAML( ?1.\d+)? + keyEquivalent + ^~Y + name + YAML + patterns + + + include + #comment + + + include + #property + + + include + #directive + + + match + ^--- + name + entity.other.document.begin.yaml + + + match + ^\.{3} + name + entity.other.document.end.yaml + + + include + #node + + + repository + + block-collection + + patterns + + + include + #block-sequence + + + include + #block-mapping + + + + block-mapping + + patterns + + + include + #block-pair + + + + block-node + + patterns + + + include + #prototype + + + include + #block-scalar + + + include + #block-collection + + + include + #flow-scalar-plain-out + + + include + #flow-node + + + + block-pair + + patterns + + + begin + \? + beginCaptures + + 1 + + name + punctuation.definition.key-value.begin.yaml + + + end + (?=\?)|^ *(:)|(:) + endCaptures + + 1 + + name + punctuation.separator.key-value.mapping.yaml + + 2 + + name + invalid.illegal.expected-newline.yaml + + + name + meta.block-mapping.yaml + patterns + + + include + #block-node + + + + + begin + (?x) + (?= + (?x: + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] \S + ) + ( + [^\s:] + | : \S + | \s+ (?![#\s]) + )* + \s* + : + (\s|$) + ) + + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + ) + + patterns + + + include + #flow-scalar-plain-out-implicit-type + + + begin + (?x) + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] \S + + beginCaptures + + 0 + + name + entity.name.tag.yaml + + + contentName + entity.name.tag.yaml + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + ) + + name + string.unquoted.plain.out.yaml + + + + + match + :(?=\s|$) + name + punctuation.separator.key-value.mapping.yaml + + + + block-scalar + + begin + (?:(\|)|(>))([1-9])?([-+])?(.*\n?) + beginCaptures + + 1 + + name + punctuation.definition.block.scalar.literal.yaml + + 2 + + name + punctuation.definition.block.scalar.folded.yaml + + 3 + + name + constant.numeric.indentation-indicator.yaml + + 4 + + name + support.other.chomping-indicator.yaml + + 5 + + patterns + + + include + #comment + + + match + .+ + name + invalid.illegal.expected-comment-or-newline.yaml + + + + + end + ^(?=\S)|(?!\G) + patterns + + + begin + ^([ ]+)(?! ) + end + ^(?!\1|\s*$) + name + string.unquoted.block.yaml + + + + block-sequence + + match + (-)( |\t|$) + name + punctuation.definition.block.sequence.item.yaml + + comment + + begin + (?:(^[ \t]*)|[ \t]+)(?=#\p{Print}*$) + beginCaptures + + 1 + + name + punctuation.whitespace.comment.leading.yaml + + + end + (?!\G) + patterns + + + begin + # + beginCaptures + + 0 + + name + punctuation.definition.comment.yaml + + + end + \n + name + comment.line.number-sign.yaml + + + + directive + + begin + ^% + beginCaptures + + 0 + + name + punctuation.definition.directive.begin.yaml + + + end + (?=$|[ \t]+($|#)) + name + meta.directive.yaml + patterns + + + captures + + 1 + + name + keyword.other.directive.yaml.yaml + + 2 + + name + constant.numeric.yaml-version.yaml + + + match + \G(YAML)[ \t]+(\d+\.\d+) + + + captures + + 1 + + name + keyword.other.directive.tag.yaml + + 2 + + name + storage.type.tag-handle.yaml + + 3 + + name + support.type.tag-prefix.yaml + + + match + (?x) + \G + (TAG) + (?:[ \t]+ + ((?:!(?:[0-9A-Za-z\-]*!)?)) + (?:[ \t]+ ( + ! (?x: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )* + | (?![,!\[\]{}]) (?x: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )+ + ) + )? + )? + + + + captures + + 1 + + name + support.other.directive.reserved.yaml + + 2 + + name + string.unquoted.directive-name.yaml + + 3 + + name + string.unquoted.directive-parameter.yaml + + + match + (?x) \G (\w+) (?:[ \t]+ (\w+) (?:[ \t]+ (\w+))? )? + + + match + \S+ + name + invalid.illegal.unrecognized.yaml + + + + flow-alias + + captures + + 1 + + name + keyword.control.flow.alias.yaml + + 2 + + name + punctuation.definition.alias.yaml + + 3 + + name + variable.other.alias.yaml + + 4 + + name + invalid.illegal.character.anchor.yaml + + + match + ((\*))([^\s\[\]/{/},]+)([^\s\]},]\S*)? + + flow-collection + + patterns + + + include + #flow-sequence + + + include + #flow-mapping + + + + flow-mapping + + begin + \{ + beginCaptures + + 0 + + name + punctuation.definition.mapping.begin.yaml + + + end + \} + endCaptures + + 0 + + name + punctuation.definition.mapping.end.yaml + + + name + meta.flow-mapping.yaml + patterns + + + include + #prototype + + + match + , + name + punctuation.separator.mapping.yaml + + + include + #flow-pair + + + + flow-node + + patterns + + + include + #prototype + + + include + #flow-alias + + + include + #flow-collection + + + include + #flow-scalar + + + + flow-pair + + patterns + + + begin + \? + beginCaptures + + 0 + + name + punctuation.definition.key-value.begin.yaml + + + end + (?=[},\]]) + name + meta.flow-pair.explicit.yaml + patterns + + + include + #prototype + + + include + #flow-pair + + + include + #flow-node + + + begin + :(?=\s|$|[\[\]{},]) + beginCaptures + + 0 + + name + punctuation.separator.key-value.mapping.yaml + + + end + (?=[},\]]) + patterns + + + include + #flow-value + + + + + + + begin + (?x) + (?= + (?: + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] [^\s[\[\]{},]] + ) + ( + [^\s:[\[\]{},]] + | : [^\s[\[\]{},]] + | \s+ (?![#\s]) + )* + \s* + : + (\s|$) + ) + + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + | \s* : [\[\]{},] + | \s* [\[\]{},] + ) + + name + meta.flow-pair.key.yaml + patterns + + + include + #flow-scalar-plain-in-implicit-type + + + begin + (?x) + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] [^\s[\[\]{},]] + + beginCaptures + + 0 + + name + entity.name.tag.yaml + + + contentName + entity.name.tag.yaml + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + | \s* : [\[\]{},] + | \s* [\[\]{},] + ) + + name + string.unquoted.plain.in.yaml + + + + + include + #flow-node + + + begin + :(?=\s|$|[\[\]{},]) + captures + + 0 + + name + punctuation.separator.key-value.mapping.yaml + + + end + (?=[},\]]) + name + meta.flow-pair.yaml + patterns + + + include + #flow-value + + + + + + flow-scalar + + patterns + + + include + #flow-scalar-double-quoted + + + include + #flow-scalar-single-quoted + + + include + #flow-scalar-plain-in + + + + flow-scalar-double-quoted + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.yaml + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.yaml + + + name + string.quoted.double.yaml + patterns + + + match + \\([0abtnvfre "/\\N_Lp]|x\d\d|u\d{4}|U\d{8}) + name + constant.character.escape.yaml + + + match + \\\n + name + constant.character.escape.double-quoted.newline.yaml + + + + flow-scalar-plain-in + + patterns + + + include + #flow-scalar-plain-in-implicit-type + + + begin + (?x) + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] [^\s[\[\]{},]] + + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + | \s* : [\[\]{},] + | \s* [\[\]{},] + ) + + name + string.unquoted.plain.in.yaml + + + + flow-scalar-plain-in-implicit-type + + patterns + + + captures + + 1 + + name + constant.language.null.yaml + + 2 + + name + constant.language.boolean.yaml + + 3 + + name + constant.numeric.integer.yaml + + 4 + + name + constant.numeric.float.yaml + + 5 + + name + constant.other.timestamp.yaml + + 6 + + name + constant.language.value.yaml + + 7 + + name + constant.language.merge.yaml + + + match + (?x) + (?x: + (null|Null|NULL|~) + | (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF) + | ( + (?: + [-+]? 0b [0-1_]+ # (base 2) + | [-+]? 0 [0-7_]+ # (base 8) + | [-+]? (?: 0|[1-9][0-9_]*) # (base 10) + | [-+]? 0x [0-9a-fA-F_]+ # (base 16) + | [-+]? [1-9] [0-9_]* (?: :[0-5]?[0-9])+ # (base 60) + ) + ) + | ( + (?x: + [-+]? (?: [0-9] [0-9_]*)? \. [0-9.]* (?: [eE] [-+] [0-9]+)? # (base 10) + | [-+]? [0-9] [0-9_]* (?: :[0-5]?[0-9])+ \. [0-9_]* # (base 60) + | [-+]? \. (?: inf|Inf|INF) # (infinity) + | \. (?: nan|NaN|NAN) # (not a number) + ) + ) + | ( + (?x: + \d{4} - \d{2} - \d{2} # (y-m-d) + | \d{4} # (year) + - \d{1,2} # (month) + - \d{1,2} # (day) + (?: [Tt] | [ \t]+) \d{1,2} # (hour) + : \d{2} # (minute) + : \d{2} # (second) + (?: \.\d*)? # (fraction) + (?: + (?:[ \t]*) Z + | [-+] \d{1,2} (?: :\d{1,2})? + )? # (time zone) + ) + ) + | (=) + | (<<) + ) + (?: + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + | \s* : [\[\]{},] + | \s* [\[\]{},] + ) + ) + + + + + flow-scalar-plain-out + + patterns + + + include + #flow-scalar-plain-out-implicit-type + + + begin + (?x) + [^\s[-?:,\[\]{}#&*!|>'"%@`]] + | [?:-] \S + + end + (?x) + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + ) + + name + string.unquoted.plain.out.yaml + + + + flow-scalar-plain-out-implicit-type + + patterns + + + captures + + 1 + + name + constant.language.null.yaml + + 2 + + name + constant.language.boolean.yaml + + 3 + + name + constant.numeric.integer.yaml + + 4 + + name + constant.numeric.float.yaml + + 5 + + name + constant.other.timestamp.yaml + + 6 + + name + constant.language.value.yaml + + 7 + + name + constant.language.merge.yaml + + + match + (?x) + (?x: + (null|Null|NULL|~) + | (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF) + | ( + (?: + [-+]? 0b [0-1_]+ # (base 2) + | [-+]? 0 [0-7_]+ # (base 8) + | [-+]? (?: 0|[1-9][0-9_]*) # (base 10) + | [-+]? 0x [0-9a-fA-F_]+ # (base 16) + | [-+]? [1-9] [0-9_]* (?: :[0-5]?[0-9])+ # (base 60) + ) + ) + | ( + (?x: + [-+]? (?: [0-9] [0-9_]*)? \. [0-9.]* (?: [eE] [-+] [0-9]+)? # (base 10) + | [-+]? [0-9] [0-9_]* (?: :[0-5]?[0-9])+ \. [0-9_]* # (base 60) + | [-+]? \. (?: inf|Inf|INF) # (infinity) + | \. (?: nan|NaN|NAN) # (not a number) + ) + ) + | ( + (?x: + \d{4} - \d{2} - \d{2} # (y-m-d) + | \d{4} # (year) + - \d{1,2} # (month) + - \d{1,2} # (day) + (?: [Tt] | [ \t]+) \d{1,2} # (hour) + : \d{2} # (minute) + : \d{2} # (second) + (?: \.\d*)? # (fraction) + (?: + (?:[ \t]*) Z + | [-+] \d{1,2} (?: :\d{1,2})? + )? # (time zone) + ) + ) + | (=) + | (<<) + ) + (?x: + (?= + \s* $ + | \s+ \# + | \s* : (\s|$) + ) + ) + + + + + flow-scalar-single-quoted + + begin + ' + beginCaptures + + 0 + + name + punctuation.definition.string.begin.yaml + + + end + '(?!') + endCaptures + + 0 + + name + punctuation.definition.string.end.yaml + + + name + string.quoted.single.yaml + patterns + + + match + '' + name + constant.character.escape.single-quoted.yaml + + + + flow-sequence + + begin + \[ + beginCaptures + + 0 + + name + punctuation.definition.sequence.begin.yaml + + + end + \] + endCaptures + + 0 + + name + punctuation.definition.sequence.end.yaml + + + name + meta.flow-sequence.yaml + patterns + + + include + #prototype + + + match + , + name + punctuation.separator.sequence.yaml + + + include + #flow-pair + + + include + #flow-node + + + + flow-value + + patterns + + + begin + \G(?![},\]]) + end + (?=[},\]]) + name + meta.flow-pair.value.yaml + patterns + + + include + #flow-node + + + + + + node + + patterns + + + include + #block-node + + + + property + + begin + (?=!|&) + end + (?!\G) + name + meta.property.yaml + patterns + + + captures + + 1 + + name + keyword.control.property.anchor.yaml + + 2 + + name + punctuation.definition.anchor.yaml + + 3 + + name + entity.name.type.anchor.yaml + + 4 + + name + invalid.illegal.character.anchor.yaml + + + match + \G((&))([^\s\[\]/{/},]+)(\S+)? + + + match + (?x) + \G + (?: + ! < (?: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )+ > + | (?:!(?:[0-9A-Za-z\-]*!)?) (?: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$_.~*'()] )+ + | ! + ) + (?=\ |\t|$) + + name + storage.type.tag-handle.yaml + + + match + \S+ + name + invalid.illegal.tag-handle.yaml + + + + prototype + + patterns + + + include + #comment + + + include + #property + + + + + scopeName + source.yaml + uuid + 686AD6AE-33F3-4493-9512-9E9FC1D5417F + +