Java properties format syntax support

This commit is contained in:
BoykoAlex
2016-09-22 19:05:31 -04:00
parent be8c73adec
commit d3a279fddc
8 changed files with 277 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,7 @@
out
node_modules
*.log
*.log.*
.idea
*.iml
*.vsix

View File

@@ -0,0 +1,18 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}"
],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}",
"preLaunchTask": "npm"
}
]
}

View File

@@ -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"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@@ -0,0 +1,25 @@
{
"comments": {
"lineComment": "#",
"blockComment": [ "#", "!" ]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
]
}

View File

@@ -0,0 +1,37 @@
{
"name": "java-properties",
"displayName": "Java Properties files Support",
"description": "Provides syntax highlighting for Java Properties files",
"icon": "icon.png",
"version": "0.0.1",
"publisher": "pivotal",
"repository": {
"type": "git",
"url": "https://github.com/spring-projects/sts4.git"
},
"license": "EPL",
"engines": {
"vscode": "*"
},
"categories": [
"Languages"
],
"keywords": [
"properties", "java"
],
"contributes": {
"languages": [{
"id": "java-properties",
"aliases": ["Java-Properties", "java-proeprties"],
"extensions": [
".properties"
],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "java-properties",
"scopeName": "source.java-properties",
"path": "./syntaxes/JavaProperties.plist"
}]
}
}

View File

@@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>properties</string>
</array>
<key>foldingStartMarker</key>
<string>^[a-zA-Z0-9.-_]+=.*\
</string>
<key>foldingStopMarker</key>
<string>^(.*(?&lt;!\)
)</string>
<key>keyEquivalent</key>
<string>^~J</string>
<key>name</key>
<string>Java Properties</string>
<key>patterns</key>
<array>
<dict>
<key>comment</key>
<string>Ignore blank lines</string>
<key>match</key>
<string>^\s*$</string>
</dict>
<dict>
<key>include</key>
<string>#comment-line</string>
</dict>
<dict>
<key>include</key>
<string>#property-name</string>
</dict>
<dict>
<key>include</key>
<string>#property-definition</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>comment-line</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.leading.java-properties</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.java-properties</string>
</dict>
</dict>
<key>match</key>
<string>^(\s*)([#!])(.+)?$\n?</string>
<key>name</key>
<string>comment.line.java-properties</string>
</dict>
<key>property-definition</key>
<dict>
<key>begin</key>
<string>^(\s*)((?:\\[ \t]|\\:|\\=|[^:=\s])+)(?:\s*([:=]))?\s*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.leading.java-properties</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>support.constant.java-properties</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\(?:[ \t:=\\ntfr\"']|u[0-9A-Fa-f]{4})</string>
<key>name</key>
<string>constant.character.escape.java-properties</string>
</dict>
</array>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.separator.key-value.java-properties</string>
</dict>
</dict>
<key>contentName</key>
<string>string.unquoted.java-properties</string>
<key>end</key>
<string>(?&lt;!\\{1})$\n</string>
<key>name</key>
<string>meta.key-value.java-properties</string>
<key>patterns</key>
<array>
<dict>
<key>comment</key>
<string>Leading space on a continued line is ignored</string>
<key>match</key>
<string>^\s*</string>
<key>name</key>
<string>punctuation.whitespace.leading.java-properties</string>
</dict>
<dict>
<key>match</key>
<string>(\\{1})(?=$\n)</string>
<key>name</key>
<string>punctuation.separator.continuation.java-properties</string>
</dict>
<dict>
<key>match</key>
<string>\\(?:[\\ntfr\"']|u[0-9A-Fa-f]{4})</string>
<key>name</key>
<string>constant.character.escape.java-properties</string>
</dict>
</array>
</dict>
<key>property-name</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.leading.java-properties</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>support.constant.java-properties</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\(?:[ \t:=\\ntfr\"']|u[0-9A-Fa-f]{4})</string>
<key>name</key>
<string>constant.character.escape.java-properties</string>
</dict>
</array>
</dict>
</dict>
<key>comment</key>
<string>A property name with no value</string>
<key>match</key>
<string>^(\s*)((?:\\[ \t]|\\:|\\=|[^:=\s])+)(?:\s*([:=]))?\s*$\n</string>
<key>name</key>
<string>meta.key-value.java-properties</string>
</dict>
</dict>
<key>scopeName</key>
<string>source.java-properties</string>
<key>uuid</key>
<string>D364E829-7643-4AFF-948D-3C0D6B4EA8A4</string>
</dict>
</plist>