Split out ts syntax and grammar to ts basics

This commit is contained in:
Matt Bierner
2018-02-23 12:53:01 -08:00
parent ac5ed16ece
commit e23c58b3ab
39 changed files with 111 additions and 45 deletions

View File

@@ -30,6 +30,7 @@ const extensions = [
'extension-editing',
'markdown',
'typescript',
'typescript-basics',
'php',
'javascript',
'css',

View File

@@ -0,0 +1,4 @@
build/**
src/**
test/**
tsconfig.json

View File

@@ -0,0 +1,7 @@
[{
"name": "TypeScript-TmLanguage",
"version": "0.1.8",
"license": "MIT",
"repositoryURL": "https://github.com/Microsoft/TypeScript-TmLanguage",
"description": "The files syntaxes/TypeScript.tmLanguage.json and syntaxes/TypeScriptReact.tmLanguage.json were derived from TypeScript.tmLanguage and TypeScriptReact.tmLanguage in https://github.com/Microsoft/TypeScript-TmLanguage."
}]

View File

@@ -0,0 +1,34 @@
{
"comments": {
"lineComment": "//",
"blockComment": [ "/*", "*/" ]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
{ "open": "\"", "close": "\"", "notIn": ["string"] },
{ "open": "`", "close": "`", "notIn": ["string", "comment"] },
{ "open": "/**", "close": " */", "notIn": ["string"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["'", "'"],
["\"", "\""],
["`", "`"]
],
"folding": {
"markers": {
"start": "^\\s*//\\s*#?region\\b",
"end": "^\\s*//\\s*#?endregion\\b"
}
}
}

View File

@@ -0,0 +1,60 @@
{
"name": "typescript-basics",
"description": "%description%",
"displayName": "%displayName%",
"version": "0.10.1",
"author": "vscode",
"publisher": "vscode",
"license": "MIT",
"engines": {
"vscode": "*"
},
"scripts": {
"update-grammar": "node ./build/update-grammars.js"
},
"contributes": {
"languages": [
{
"id": "typescript",
"aliases": [
"TypeScript",
"ts",
"typescript"
],
"extensions": [
".ts"
],
"configuration": "./language-configuration.json"
},
{
"id": "typescriptreact",
"aliases": [
"TypeScript React",
"tsx"
],
"extensions": [
".tsx"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "typescript",
"scopeName": "source.ts",
"path": "./syntaxes/TypeScript.tmLanguage.json"
},
{
"language": "typescriptreact",
"scopeName": "source.tsx",
"path": "./syntaxes/TypeScriptReact.tmLanguage.json",
"embeddedLanguages": {
"meta.tag.tsx": "jsx-tags",
"meta.tag.without-attributes.tsx": "jsx-tags",
"meta.tag.attributes.tsx": "typescriptreact",
"meta.embedded.expression.tsx": "typescriptreact"
}
}
]
}
}

View File

@@ -0,0 +1,4 @@
{
"displayName": "TypeScript Language Basics",
"description": "Provides syntax highlighting and basic language support for TypeScript."
}

View File

@@ -21,8 +21,7 @@
"@types/semver": "5.4.0"
},
"scripts": {
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:typescript ./tsconfig.json",
"update-grammar": "node ./build/update-grammars.js"
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:typescript ./tsconfig.json"
},
"activationEvents": [
"onLanguage:javascript",
@@ -40,49 +39,6 @@
],
"main": "./out/extension",
"contributes": {
"languages": [
{
"id": "typescript",
"aliases": [
"TypeScript",
"ts",
"typescript"
],
"extensions": [
".ts"
],
"configuration": "./language-configuration.json"
},
{
"id": "typescriptreact",
"aliases": [
"TypeScript React",
"tsx"
],
"extensions": [
".tsx"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "typescript",
"scopeName": "source.ts",
"path": "./syntaxes/TypeScript.tmLanguage.json"
},
{
"language": "typescriptreact",
"scopeName": "source.tsx",
"path": "./syntaxes/TypeScriptReact.tmLanguage.json",
"embeddedLanguages": {
"meta.tag.tsx": "jsx-tags",
"meta.tag.without-attributes.tsx": "jsx-tags",
"meta.tag.attributes.tsx": "typescriptreact",
"meta.embedded.expression.tsx": "typescriptreact"
}
}
],
"configuration": {
"type": "object",
"title": "%configuration.typescript%",