Skip to content

Commit

Permalink
Merge pull request #1115 from DustinCampbell/new-syntax
Browse files Browse the repository at this point in the history
Brand new TextMate grammar for providing C# syntax highlighting
  • Loading branch information
DustinCampbell authored Jan 12, 2017
2 parents 931498c + 47fb5c5 commit 4d90180
Show file tree
Hide file tree
Showing 45 changed files with 18,630 additions and 1,672 deletions.
40 changes: 0 additions & 40 deletions ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ expressly granted, whether by implication, estoppel or otherwise.
3. run-in-terminal version 0.0.2 (https://github.com/microsoft/run-in-terminal)
4. semver version 5.1.0 (https://github.com/npm/node-semver)
5. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped)
6. language-csharp version 0.11.0 (https://github.com/atom/language-csharp)

%% omnisharp-roslyn NOTICES AND INFORMATION BEGINS HERE
============================================================
Expand Down Expand Up @@ -123,42 +122,3 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
============================================================
END OF DefinitelyTyped NOTICES AND INFORMATION

%% language-csharp NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2014 GitHub Inc.

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.


This package was derived from a TextMate bundle located at
https://github.com/wintermi/csharp-tmbundle by Matthew Winter @wintermi and
Adam Lickel @lickel and distributed under the following license, located in
`README.markdown`:

This bundle is dual-licensed under MIT and GPL licenses.

- http://www.opensource.org/licenses/mit-license.php
- http://www.gnu.org/licenses/gpl.html

Use it, change it, fork it, sell it. Do what you will, but please leave the
author attribution.
=========================================
END OF language-csharp NOTICES AND INFORMATION
23 changes: 23 additions & 0 deletions buildSyntax.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as fs from 'fs';
import * as path from 'path';
import * as yaml from 'js-yaml';
import * as plist from 'plist';

function writePlistFile(grammar: any, fileName: string) {
const text = plist.build(grammar);
fs.writeFileSync(fileName, text, "utf8");
}

function readYaml(fileName: string) {
const text = fs.readFileSync(fileName, "utf8");
return yaml.safeLoad(text);
}

function buildGrammar() {
const tsGrammar = readYaml("syntaxes/csharp.tmLanguage.yml");

// Write csharp.tmLanguage
writePlistFile(tsGrammar, "syntaxes/csharp.tmLanguage");
}

buildGrammar();
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
"main": "./out/src/main",
"scripts": {
"vscode:prepublish": "tsc -p ./",
"compile": "tsc -p ./ && gulp tslint",
"compile": "tsc -p ./ && gulp tslint && node ./out/buildSyntax.js",
"watch": "tsc -watch -p ./",
"test": "node ./node_modules/vscode/bin/test",
"test": "node ./node_modules/vscode/bin/test && mocha --timeout 15000 --ui bdd ./out/test/syntaxes/*.test.syntax.js",
"build-syntax": "node ./out/buildSyntax.js",
"test-syntax": "mocha --timeout 15000 --ui bdd ./out/test/syntaxes/*.test.syntax.js",
"postinstall": "node ./node_modules/vscode/bin/install"
},
Expand All @@ -46,6 +47,7 @@
"devDependencies": {
"@types/chai": "^3.4.34",
"@types/fs-extra": "0.0.35",
"@types/js-yaml": "^3.5.29",
"@types/mkdirp": "^0.3.29",
"@types/mocha": "^2.2.32",
"@types/node": "^6.0.40",
Expand All @@ -56,7 +58,9 @@
"gulp": "^3.9.1",
"gulp-mocha": "^2.1.3",
"gulp-tslint": "^4.3.0",
"js-yaml": "^3.7.0",
"mocha": "^2.3.3",
"plist": "^2.0.1",
"tslint": "^3.15.1",
"tslint-microsoft-contrib": "^2.0.12",
"typescript": "^2.0.3",
Expand Down Expand Up @@ -390,7 +394,7 @@
{
"language": "csharp",
"scopeName": "source.cs",
"path": "./syntaxes/csharp.json"
"path": "./syntaxes/csharp.tmLanguage"
}
],
"jsonValidation": [
Expand Down Expand Up @@ -1144,4 +1148,4 @@
}
]
}
}
}
Loading

0 comments on commit 4d90180

Please sign in to comment.