Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2015-12-02 20:25:48 +0000
committerTom Schindl2015-12-02 20:25:48 +0000
commit87ff1c4c6dc1005a270818704980f9c0eec98ef4 (patch)
tree31554f32d4414d3fdd080dcd35c00acac3c46197
parentc45e930d47f2d5e0d4c8e52ac1e71e692969cdc3 (diff)
downloadorg.eclipse.efxclipse-87ff1c4c6dc1005a270818704980f9c0eec98ef4.tar.gz
org.eclipse.efxclipse-87ff1c4c6dc1005a270818704980f9c0eec98ef4.tar.xz
org.eclipse.efxclipse-87ff1c4c6dc1005a270818704980f9c0eec98ef4.zip
Bug 483520 - Add support for typescript
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/dart.json13
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/java.json13
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/js.json28
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/ts.json223
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/dart.css4
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/dart.ldef3
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/java.css4
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/java.ldef3
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/js.css8
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/js.ldef6
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/typescript.css38
-rw-r--r--bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/typescript.ldef65
12 files changed, 408 insertions, 0 deletions
diff --git a/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/dart.json b/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/dart.json
index 7945c08bb..c76005db7 100644
--- a/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/dart.json
+++ b/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/dart.json
@@ -171,6 +171,19 @@
]
}
]
+ },
+ {
+ "$gtype": "Token",
+ "defaultToken": false,
+ "name": "dart_number",
+ "tokenScannerList": [
+ {
+ "$gtype": "TokenScanner_PatternRule",
+ "containmentPattern": "[\\d|\\.]",
+ "startLength": 0,
+ "startPattern": "\\d"
+ }
+ ]
}
]
},
diff --git a/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/java.json b/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/java.json
index 979e5f074..086b79b69 100644
--- a/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/java.json
+++ b/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/java.json
@@ -163,6 +163,19 @@
"startPattern": "@"
}
]
+ },
+ {
+ "$gtype": "Token",
+ "defaultToken": false,
+ "name": "java_number",
+ "tokenScannerList": [
+ {
+ "$gtype": "TokenScanner_PatternRule",
+ "containmentPattern": "[\\d|_|\\.]",
+ "startLength": 0,
+ "startPattern": "\\d"
+ }
+ ]
}
]
},
diff --git a/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/js.json b/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/js.json
index 67327d94b..d35c84e11 100644
--- a/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/js.json
+++ b/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/js.json
@@ -99,6 +99,34 @@
]
}
]
+ },
+ {
+ "$gtype": "Token",
+ "defaultToken": false,
+ "name": "js_constant",
+ "tokenScannerList": [
+ {
+ "$gtype": "TokenScanner_Keyword",
+ "keywordList": [
+ "true",
+ "false",
+ "undefined"
+ ]
+ }
+ ]
+ },
+ {
+ "$gtype": "Token",
+ "defaultToken": false,
+ "name": "js_number",
+ "tokenScannerList": [
+ {
+ "$gtype": "TokenScanner_PatternRule",
+ "containmentPattern": "[\\d|\\.]",
+ "startLength": 0,
+ "startPattern": "\\d"
+ }
+ ]
}
]
},
diff --git a/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/ts.json b/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/ts.json
new file mode 100644
index 000000000..44e853097
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.langs/src-gen/org/eclipse/fx/code/editor/ldef/langs/ts.json
@@ -0,0 +1,223 @@
+{
+ "$gtype": "LanguageDef",
+ "fileSuffix": "ts",
+ "partitionList": [
+ {
+ "$gtype": "Partition",
+ "name": "__dftl_partition_content_type",
+ "ruleList": [],
+ "tokenList": [
+ {
+ "$gtype": "Token",
+ "defaultToken": true,
+ "name": "ts_default",
+ "tokenScannerList": []
+ },
+ {
+ "$gtype": "Token",
+ "defaultToken": false,
+ "name": "ts_operator",
+ "tokenScannerList": [
+ {
+ "$gtype": "TokenScanner_CharacterRule",
+ "characterList": [
+ ";",
+ ".",
+ "\u003d",
+ "/",
+ "\\",
+ "+",
+ "-",
+ "*",
+ "\u003c",
+ "\u003e",
+ ":",
+ "?",
+ "!",
+ ",",
+ "|",
+ "\u0026",
+ "^",
+ "%",
+ "~"
+ ]
+ }
+ ]
+ },
+ {
+ "$gtype": "Token",
+ "defaultToken": false,
+ "name": "ts_bracket",
+ "tokenScannerList": [
+ {
+ "$gtype": "TokenScanner_CharacterRule",
+ "characterList": [
+ "(",
+ ")",
+ "{",
+ "}",
+ "[",
+ "]"
+ ]
+ }
+ ]
+ },
+ {
+ "$gtype": "Token",
+ "defaultToken": false,
+ "name": "ts_keyword",
+ "tokenScannerList": [
+ {
+ "$gtype": "TokenScanner_Keyword",
+ "keywordList": [
+ "break",
+ "case",
+ "catch",
+ "continue",
+ "debugger",
+ "default",
+ "delete",
+ "do",
+ "else",
+ "finally",
+ "for",
+ "function",
+ "if",
+ "in",
+ "instanceof",
+ "new",
+ "return",
+ "switch",
+ "this",
+ "throw",
+ "try",
+ "typeof",
+ "var",
+ "while",
+ "with",
+ "interface",
+ "class",
+ "constructor",
+ "declare",
+ "module",
+ "export",
+ "extends",
+ "super",
+ "public"
+ ]
+ }
+ ]
+ },
+ {
+ "$gtype": "Token",
+ "defaultToken": false,
+ "name": "ts_builtin_types",
+ "tokenScannerList": [
+ {
+ "$gtype": "TokenScanner_Keyword",
+ "keywordList": [
+ "any",
+ "void",
+ "string",
+ "number",
+ "boolean"
+ ]
+ }
+ ]
+ },
+ {
+ "$gtype": "Token",
+ "defaultToken": false,
+ "name": "ts_constant",
+ "tokenScannerList": [
+ {
+ "$gtype": "TokenScanner_Keyword",
+ "keywordList": [
+ "true",
+ "false",
+ "undefined"
+ ]
+ }
+ ]
+ },
+ {
+ "$gtype": "Token",
+ "defaultToken": false,
+ "name": "ts_number",
+ "tokenScannerList": [
+ {
+ "$gtype": "TokenScanner_PatternRule",
+ "containmentPattern": "[\\d|\\.]",
+ "startLength": 0,
+ "startPattern": "\\d"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "$gtype": "Partition",
+ "name": "__ts_single_line_comment",
+ "ruleList": [
+ {
+ "$gtype": "PartitionRule_SingleLine",
+ "endSeq": "",
+ "startSeq": "//"
+ }
+ ],
+ "tokenList": [
+ {
+ "$gtype": "Token",
+ "defaultToken": true,
+ "name": "ts_doc_default",
+ "tokenScannerList": []
+ }
+ ]
+ },
+ {
+ "$gtype": "Partition",
+ "name": "__ts_multi_line_comment",
+ "ruleList": [
+ {
+ "$gtype": "PartitionRule_MultiLine",
+ "endSeq": "*/",
+ "startSeq": "/*"
+ }
+ ],
+ "tokenList": [
+ {
+ "$gtype": "Token",
+ "defaultToken": true,
+ "name": "ts_doc_default",
+ "tokenScannerList": []
+ }
+ ]
+ },
+ {
+ "$gtype": "Partition",
+ "name": "__ts_string",
+ "ruleList": [
+ {
+ "$gtype": "PartitionRule_SingleLine",
+ "endSeq": "\u0027",
+ "escapedBy": "\\",
+ "startSeq": "\u0027"
+ },
+ {
+ "$gtype": "PartitionRule_SingleLine",
+ "endSeq": "\"",
+ "escapedBy": "\\",
+ "startSeq": "\""
+ }
+ ],
+ "tokenList": [
+ {
+ "$gtype": "Token",
+ "defaultToken": true,
+ "name": "ts_string",
+ "tokenScannerList": []
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/dart.css b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/dart.css
index bcb0c717d..06b8cfa71 100644
--- a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/dart.css
+++ b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/dart.css
@@ -62,4 +62,8 @@
.dart-type-info {
-fx-fill: -type-info-color;
+}
+
+.styled-text-area .dart.dart_number {
+ -styled-text-color: -source-editor-number;
} \ No newline at end of file
diff --git a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/dart.ldef b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/dart.ldef
index 8cb2a59b9..fd228ed74 100644
--- a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/dart.ldef
+++ b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/dart.ldef
@@ -45,6 +45,9 @@ dart {
dart_builtin_types {
keywords [ "num", "String", "bool", "int", "double", "List", "Map" ]
}
+ dart_number {
+ pattern "\\d" containing "[\\d|\\.]"
+ }
}
rule __dart_singlelinedoc_comment {
default dart_doc
diff --git a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/java.css b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/java.css
index 0d3dc5568..80b1cdb01 100644
--- a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/java.css
+++ b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/java.css
@@ -41,4 +41,8 @@
.styled-text-area .java.java_apidoc {
-styled-text-color: -source-editor-api-doc;
+}
+
+.styled-text-area .java.java_number {
+ -styled-text-color: -source-editor-number;
} \ No newline at end of file
diff --git a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/java.ldef b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/java.ldef
index 3dbe0851f..f70e8a42a 100644
--- a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/java.ldef
+++ b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/java.ldef
@@ -42,6 +42,9 @@ package org.eclipse.fx.code.editor.ldef.langs
java_annotation {
pattern "@" containing "\\w"
}
+ java_number {
+ pattern "\\d" containing "[\\d|_|\\.]"
+ }
}
rule __java_multi_line_api_comment {
default java_apidoc
diff --git a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/js.css b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/js.css
index 935bf863d..01095afc3 100644
--- a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/js.css
+++ b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/js.css
@@ -23,3 +23,11 @@
-styled-text-color: -source-editor-string;
}
+.styled-text-area .js.js_constant {
+ -styled-text-color: -source-editor-keyword;
+ -fx-font-weight: bold;
+}
+
+.styled-text-area .js.js_number {
+ -styled-text-color: -source-editor-number;
+} \ No newline at end of file
diff --git a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/js.ldef b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/js.ldef
index 710517f45..99467ba3c 100644
--- a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/js.ldef
+++ b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/js.ldef
@@ -31,6 +31,12 @@ js {
"try", "typeof", "var", "void",
"while", "with" ]
}
+ js_constant {
+ keywords [ "true", "false", "undefined" ]
+ }
+ js_number {
+ pattern "\\d" containing "[\\d|\\.]"
+ }
}
rule __js_single_line_comment {
default js_doc_default
diff --git a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/typescript.css b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/typescript.css
new file mode 100644
index 000000000..fd2d7cc44
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/typescript.css
@@ -0,0 +1,38 @@
+.styled-text-area .ts.ts_default {
+ -styled-text-color: -source-editor-code;
+}
+
+.styled-text-area .ts.ts_operator {
+ -styled-text-color: -source-editor-operator;
+}
+
+.styled-text-area .ts.ts_bracket {
+ -styled-text-color: -source-editor-bracket;
+}
+
+.styled-text-area .ts.ts_keyword {
+ -styled-text-color: -source-editor-keyword;
+ -fx-font-weight: bold;
+}
+
+.styled-text-area .ts.ts_builtin_types {
+ -styled-text-color: -source-editor-buitin-type;
+ -fx-font-weight: bold;
+}
+
+.styled-text-area .ts.ts_doc_default {
+ -styled-text-color: -source-editor-doc;
+}
+
+.styled-text-area .ts.ts_string {
+ -styled-text-color: -source-editor-string;
+}
+
+.styled-text-area .ts.ts_constant {
+ -styled-text-color: -source-editor-keyword;
+ -fx-font-weight: bold;
+}
+
+.styled-text-area .ts.ts_number {
+ -styled-text-color: -source-editor-number;
+} \ No newline at end of file
diff --git a/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/typescript.ldef b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/typescript.ldef
new file mode 100644
index 000000000..f395c92a4
--- /dev/null
+++ b/bundles/code/org.eclipse.fx.code.editor.langs/src/org/eclipse/fx/code/editor/ldef/langs/typescript.ldef
@@ -0,0 +1,65 @@
+package org.eclipse.fx.code.editor.ldef.langs
+
+ts {
+ partitioning {
+ partition __dftl_partition_content_type
+ partition __ts_single_line_comment
+ partition __ts_multi_line_comment
+ partition __ts_string
+ rule {
+ single_line __ts_single_line_comment "//" => ''
+ multi_line __ts_multi_line_comment "/*" => "*/"
+ single_line __ts_string "'" => "'" escaped by "\\"
+ single_line __ts_string '"' => '"' escaped by "\\"
+ }
+ }
+ lexical_highlighting {
+ rule __dftl_partition_content_type whitespace javawhitespace {
+ default ts_default
+ ts_operator {
+ character [ ';', '.', '=', '/', '\\', '+', '-', '*', '<', '>', ':', '?', '!', ',', '|', '&', '^', '%', '~' ]
+ }
+ ts_bracket {
+ character [ '(', ')', '{', '}', '[', ']' ]
+ }
+ ts_keyword {
+ keywords [ "break", "case", "catch", "continue",
+ "debugger", "default", "delete", "do",
+ "else", "finally", "for", "function",
+ "if", "in", "instanceof", "new",
+ "return", "switch", "this", "throw",
+ "try", "typeof", "var",
+ "while", "with"
+ // typescript specific
+ , "interface", "class", "constructor", "declare", "module", "export", "extends", "super"
+ , "public"
+ ]
+ }
+ ts_builtin_types {
+ keywords [ "any", "void", "string", "number", "boolean" ]
+ }
+ ts_constant {
+ keywords [ "true", "false", "undefined" ]
+ }
+ ts_number {
+ pattern "\\d" containing "[\\d|\\.]"
+ }
+ }
+ rule __ts_single_line_comment {
+ default ts_doc_default
+ }
+ rule __ts_multi_line_comment {
+ default ts_doc_default
+ }
+ rule __ts_string {
+ default ts_string
+ }
+ }
+ integration {
+ javafx {
+ java "org.eclipse.fx.code.editor.langs.codegen.fx.ts" {
+ project : "org.eclipse.fx.code.editor.langs.codegen.fx"
+ }
+ }
+ }
+} \ No newline at end of file

Back to the top