FIDL language definition + VS Code package info

Change-Id: I23408a4f25b2de5f727be48b31b0b53480325164
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..8384213
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,13 @@
+// A launch configuration that launches the extension inside a new window
+{
+    "version": "0.1.0",
+    "configurations": [
+        {
+            "name": "Launch Extension",
+            "type": "extensionHost",
+            "request": "launch",
+            "runtimeExecutable": "${execPath}",
+            "args": ["--extensionDevelopmentPath=${workspaceRoot}" ]
+        }
+    ]
+}
\ No newline at end of file
diff --git a/.vscodeignore b/.vscodeignore
new file mode 100644
index 0000000..f16fa55
--- /dev/null
+++ b/.vscodeignore
@@ -0,0 +1 @@
+.vscode/**
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..d68cdd6
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,3 @@
+# v0.0.1
+
+- Initial release with basic syntax highlighting support for FIDL.
diff --git a/README.md b/README.md
index 8b90b74..364f654 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,6 @@
-Fuchsia Open Source Template Repository
-=======================================
+# FIDL Language Support for Visual Studio Code
 
-This repository is a template that we will use when creating new open source
-repositories for Fuchsia.
+This extension adds syntax highlighting to [FIDL][fidl] files in VS Code.
+
+
+[fidl]: https://fuchsia.googlesource.com/fidl
diff --git a/language-configuration.json b/language-configuration.json
new file mode 100644
index 0000000..9afbacf
--- /dev/null
+++ b/language-configuration.json
@@ -0,0 +1,26 @@
+{
+    "comments": {
+        "lineComment": "//",
+        "blockComment": [ "/*", "*/" ]
+    },
+    // symbols used as brackets
+    "brackets": [
+        ["{", "}"],
+        ["[", "]"],
+        ["(", ")"]
+    ],
+    // symbols that are auto closed when typing
+    "autoClosingPairs": [
+        ["{", "}"],
+        ["[", "]"],
+        ["(", ")"],
+        ["\"", "\""]
+    ],
+    // symbols that that can be used to surround a selection
+    "surroundingPairs": [
+        ["{", "}"],
+        ["[", "]"],
+        ["(", ")"],
+        ["\"", "\""]
+    ]
+}
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..54f5641
--- /dev/null
+++ b/package.json
@@ -0,0 +1,28 @@
+{
+    "name": "language-fidl",
+    "displayName": "FIDL Language Support",
+    "description": "Syntax highlighting support for FIDL files",
+    "license": "SEE LICENSE IN LICENSE",
+    "version": "0.0.1",
+    "publisher": "fuchsia-authors",
+    "engines": {
+        "vscode": "^1.10.0"
+    },
+    "categories": [
+        "Languages"
+    ],
+    "contributes": {
+        "languages": [{
+            "id": "fidl",
+            "aliases": ["FIDL", "fidl"],
+            "extensions": [".fidl"],
+            "configuration": "./language-configuration.json"
+        }],
+        "grammars": [{
+            "language": "fidl",
+            "scopeName": "source.fidl",
+            "path": "./syntaxes/fidl.tmLanguage.json"
+        }]
+    },
+    "homepage": "https://fuchsia.googlesource.com/vscode-language-fidl"
+}
\ No newline at end of file
diff --git a/syntaxes/fidl.tmLanguage.json b/syntaxes/fidl.tmLanguage.json
new file mode 100644
index 0000000..2ad9785
--- /dev/null
+++ b/syntaxes/fidl.tmLanguage.json
@@ -0,0 +1,221 @@
+{
+	"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
+	"name": "FIDL",
+	"patterns": [
+		{
+			"include": "#comments"
+		},
+		{
+			"include": "#literal"
+		},
+		{
+			"match": "\\b(import|module)\\b",
+			"name": "keyword.control.fidl"
+		},
+		{
+			"match": "\\b(default|const)\\b",
+			"name": "keyword.fidl"
+		},
+		{
+			"match": "\\b(bool|float|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64|string)\\b",
+			"name": "storage.type.basic.fidl"
+		},
+		{
+			"match": "\\b(handle|array|map)\\b",
+			"name": "storage.type.compound.fidl"
+		},
+		{
+			"begin": "\\b(struct|union)\\b\\s*([_A-Za-z][_A-Za-z0-9]*)\\b",
+			"beginCaptures": {
+				"1": {
+					"name": "storage.type.fidl"
+				},
+				"2": {
+					"name": "entity.name.type.fidl"
+				}
+			},
+			"end": "(?<=\\})",
+			"name": "meta.struct-union-block.fidl",
+			"patterns": [
+				{
+					"begin": "\\{",
+					"beginCaptures": {
+						"0": {
+							"name": "punctuation.section.block.begin.fidl"
+						}
+					},
+					"end": "\\}",
+					"endCaptures": {
+						"0": {
+							"name": "punctuation.section.block.end.fidl"
+						}
+					},
+					"name": "meta.block.cpp",
+					"patterns": [
+						{
+							"include": "$base"
+						}
+					]
+				}
+			]
+		},
+		{
+			"begin": "\\b(interface)\\b\\s*([_A-Za-z][_A-Za-z0-9]*)\\b",
+			"beginCaptures": {
+				"1": {
+					"name": "storage.type.fidl"
+				},
+				"2": {
+					"name": "entity.name.type.fidl"
+				}
+			},
+			"end": "(?<=\\})",
+			"name": "meta.interface-block.fidl",
+			"patterns": [
+				{
+					"begin": "\\b([_A-Za-z][_A-Za-z0-9]*)\\b",
+					"beginCaptures": {
+						"1": {
+							"name": "entity.name.function.fidl"
+						}
+					},
+					"end": "(?<=;)",
+					"patterns": [
+						{
+							"include": "$base"
+						}
+					]
+				},
+				{
+					"include": "$base"
+				}
+			]
+		},
+		{
+			"begin": "\\b(enum)\\b\\s*([_A-Za-z][_A-Za-z0-9]*)\\b",
+			"beginCaptures": {
+				"1": {
+					"name": "storage.type.fidl"
+				},
+				"2": {
+					"name": "entity.name.type.fidl"
+				}
+			},
+			"end": "(?<=\\})",
+			"name": "meta.enum-block.fidl",
+			"patterns": [
+				{
+					"include": "$base"
+				}
+			]
+		}
+	],
+	"repository": {
+		"comments": {
+			"patterns": [
+				{
+					"begin": "/\\*",
+					"beginCaptures": {
+						"0": {
+							"name": "punctuation.definition.comment.begin.fidl"
+						}
+					},
+					"end": "\\*/",
+					"endCaptures": {
+						"0": {
+							"name": "punctuation.definition.comment.end.fidl"
+						}
+					},
+					"name": "comment.block.fidl"
+				},
+				{
+					"match": "\\*/.*\\n",
+					"name": "invalid.illegal.stray-comment-end.fidl"
+				},
+				{
+					"begin": "(^[ \\t]+)?(?=//)",
+					"beginCaptures": {
+						"1": {
+							"name": "punctuation.whitespace.comment.leading.fidl"
+						}
+					},
+					"end": "(?!\\G)",
+					"patterns": [
+						{
+							"begin": "//",
+							"beginCaptures": {
+								"0": {
+									"name": "punctuation.definition.comment.fidl"
+								}
+							},
+							"end": "\\n",
+							"name": "comment.line.double-slash",
+							"patterns": [
+								{
+									"match": "(?>\\\\\\s*\\n)",
+									"name": "punctuation.separator.continuation.fidl"
+								}
+							]
+						}
+					]
+				}
+			]
+		},
+		"literal": {
+			"patterns": [
+				{
+					"include": "#string"
+				},
+				{
+					"match": "\\b(true|false)\\b",
+					"name": "constant.bool.language.fidl"
+				},
+				{
+					"match": "\\b(float|double)(.INFINITY|.NEGATIVE_INFINITY|.NAN)\\b",
+					"name": "constant.float.language.fidl"
+				},
+				{
+					"match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b",
+					"name": "constant.numeric.c"
+				}
+			]
+		},
+		"string": {
+			"patterns": [
+				{
+					"begin": "\"",
+					"beginCaptures": {
+						"0": {
+							"name": "punctuation.definition.string.begin.fidl"
+						}
+					},
+					"end": "\"",
+					"endCaptures": {
+						"0": {
+							"name": "punctuation.definition.string.end.fidl"
+						}
+					},
+					"name": "string.quoted.double.fidl",
+					"patterns": [
+						{
+							"include": "#string_escaped_char"
+						}
+					]
+				}
+			]
+		},
+		"string_escaped_char": {
+			"patterns": [
+				{
+					"match": "\\\\(\\\\|[abefnprtv'\"?]|[0-3]\\d{,2}|[4-7]\\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8})",
+					"name": "constant.character.escape.fidl"
+				},
+				{
+					"match": "\\\\.",
+					"name": "invalid.illegal.unknown-escape.fidl"
+				}
+			]
+		}
+	},
+	"scopeName": "source.fidl"
+}
\ No newline at end of file