Define concourse-pipeline-yaml language id
This commit is contained in:
@@ -13,6 +13,8 @@ import {TextDocument, OutputChannel} from 'vscode';
|
||||
|
||||
var log_output : OutputChannel = null;
|
||||
|
||||
const PIPELINE_LANGUAGE_ID = "concourse-pipeline-yaml";
|
||||
|
||||
function log(msg : string) {
|
||||
if (log_output) {
|
||||
log_output.append(msg +"\n");
|
||||
@@ -41,13 +43,12 @@ export function activate(context: VSCode.ExtensionContext) {
|
||||
// events pass on to Language Server only for documents for which function passed via textDocumentFilter property return true
|
||||
|
||||
// TODO: Remove <any> cast ones https://github.com/Microsoft/vscode-languageserver-node/issues/9 is resolved
|
||||
documentSelector: [
|
||||
<any> {language: 'yaml', pattern: '**/*pipeline*.yml'}
|
||||
],
|
||||
documentSelector: [ PIPELINE_LANGUAGE_ID ],
|
||||
synchronize: {
|
||||
// TODO: Remove textDocumentFilter property once https://github.com/Microsoft/vscode-languageserver-node/issues/9 is resolved
|
||||
textDocumentFilter: function(textDocument : TextDocument) : boolean {
|
||||
let result : boolean = /^(.*)pipeline(.*)\.yml$/i.test(textDocument.fileName);
|
||||
let result : boolean = PIPELINE_LANGUAGE_ID===textDocument.languageId;
|
||||
// old way: let result : boolean = /^(.*)pipeline(.*)\.yml$/i.test(textDocument.fileName);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,27 @@
|
||||
"pipeline.yml"
|
||||
],
|
||||
"activationEvents": [
|
||||
"onLanguage:yaml"
|
||||
"onLanguage:concourse-pipeline-yaml"
|
||||
],
|
||||
"contributes": {
|
||||
"languages": [
|
||||
{
|
||||
"id": "concourse-pipeline-yaml",
|
||||
"aliases": [
|
||||
"concourse-pipeline"
|
||||
],
|
||||
"filenamePatterns": [
|
||||
"*pipeline*.yml"
|
||||
],
|
||||
"configuration": "./yaml-support/language-configuration.json"
|
||||
}
|
||||
],
|
||||
"grammars": [{
|
||||
"language": "concourse-pipeline-yaml",
|
||||
"scopeName": "source.yaml",
|
||||
"path": "./yaml-support/yaml.tmLanguage"
|
||||
}]
|
||||
},
|
||||
"main": "./out/lib/Main",
|
||||
"scripts": {
|
||||
"prepublish": "tsc -p .",
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
# Download yaml TextMate grammar
|
||||
curl https://raw.githubusercontent.com/textmate/yaml.tmbundle/master/Syntaxes/YAML.tmLanguage > yaml-support/yaml.tmLanguage
|
||||
|
||||
# Preinstall commons-vscode package
|
||||
(cd ../commons-vscode ; npm install)
|
||||
npm install ../commons-vscode
|
||||
|
||||
# Use maven to build fat jar of the language server
|
||||
../mvnw -U -f ../pom.xml -pl vscode-concourse -am clean install
|
||||
|
||||
1
vscode-extensions/vscode-concourse/yaml-support/.gitignore
vendored
Normal file
1
vscode-extensions/vscode-concourse/yaml-support/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
yaml.tmLanguage
|
||||
@@ -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 <fichtefoll2@googlemail.com>",
|
||||
"",
|
||||
"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."
|
||||
]
|
||||
}]
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"comments": {
|
||||
"lineComment": "#"
|
||||
},
|
||||
"brackets": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"]
|
||||
],
|
||||
"autoClosingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""],
|
||||
["'", "'"]
|
||||
],
|
||||
"surroundingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""],
|
||||
["'", "'"]
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user