diff options
author | Grant Gayed <grant_gayed@ca.ibm.com> | 2014-12-19 16:08:38 -0500 |
---|---|---|
committer | Grant Gayed <grant_gayed@ca.ibm.com> | 2014-12-19 16:09:22 -0500 |
commit | 73816185cb29006454f75bc30008082e33999be1 (patch) | |
tree | 42e61b28458e8a3820d457a67999a64d2c0a90c4 | |
parent | 0f2aea47c8474add08703f111807c4d1b4188446 (diff) | |
download | org.eclipse.orion.client-origin/stable_20141223.zip org.eclipse.orion.client-origin/stable_20141223.tar.gz org.eclipse.orion.client-origin/stable_20141223.tar.bz2 |
Bug 455269 - implement syntax styling for some CLR languages (VB.NET andorigin/stable_20141223
vbhtml)
9 files changed, 305 insertions, 12 deletions
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/lib/syntax.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/lib/syntax.js index ce19652..bb62e4f 100644 --- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/lib/syntax.js +++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/lib/syntax.js @@ -49,7 +49,7 @@ define("orion/editor/stylers/lib/syntax", [], function() { //$NON-NLS-0$ match: "@(?:(?!\\*/)\\S)*", //$NON-NLS-0$ name: "meta.documentation.annotation" //$NON-NLS-0$ }, { - match: "\\<\\S*\\>", //$NON-NLS-0$ + match: "<[^\\s>]*>", //$NON-NLS-0$ name: "meta.documentation.tag" //$NON-NLS-0$ }, { match: "(\\b)(TODO)(\\b)(((?!\\*/).)*)", //$NON-NLS-0$ diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-csharp/syntax.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-csharp/syntax.js index 29363f3..21c26a0 100644 --- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-csharp/syntax.js +++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-csharp/syntax.js @@ -80,7 +80,7 @@ define("orion/editor/stylers/text_x-csharp/syntax", ["orion/editor/stylers/lib/s name: "comment.block.documentation.csharp", //$NON-NLS-0$ patterns: [ { - match: "\\<\\S*\\>", //$NON-NLS-0$ + match: "<[^\\s>]*>", //$NON-NLS-0$ name: "meta.documentation.tag" //$NON-NLS-0$ }, { match: "(\\b)(TODO)(\\b)(((?!\\*/).)*)", //$NON-NLS-0$ @@ -97,15 +97,10 @@ define("orion/editor/stylers/text_x-csharp/syntax", ["orion/editor/stylers/lib/s name: "comment.line.documentation.csharp", //$NON-NLS-0$ patterns: [ { - match: "\\<\\S*\\>", //$NON-NLS-0$ + match: "<[^\\s>]*>", //$NON-NLS-0$ name: "meta.documentation.tag" //$NON-NLS-0$ }, { - match: "(\\b)(TODO)(\\b)(((?!\\*/).)*)", //$NON-NLS-0$ - name: "meta.annotation.task.todo", //$NON-NLS-0$ - captures: { - 2: {name: "keyword.other.documentation.task"}, //$NON-NLS-0$ - 4: {name: "comment.block"} //$NON-NLS-0$ - } + include: "orion.lib#todo_comment_singleLine" //$NON-NLS-0$ } ] } diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-cshtml/syntax.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-cshtml/syntax.js index 7de2db0..1ba5ec4 100644 --- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-cshtml/syntax.js +++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-cshtml/syntax.js @@ -23,14 +23,14 @@ define("orion/editor/stylers/text_x-cshtml/syntax", [ id: "orion.cshtml", //$NON-NLS-0$ contentTypes: ["text/x-cshtml"], //$NON-NLS-0$ patterns: [ - {include: "#comment"}, //$NON-NLS-0$ + {include: "#cshtmlComment"}, //$NON-NLS-0$ {include: "#codeBlock"}, //$NON-NLS-0$ {include: "#expression"}, //$NON-NLS-0$ {include: "#reference"}, //$NON-NLS-0$ {include: "orion.html"}, //$NON-NLS-0$ ], repository: { - comment: { + cshtmlComment: { begin: {match: "@\\*", literal: "@*"}, //$NON-NLS-1$ //$NON-NLS-0$ end: {match: "\\*@", literal: "*@"}, //$NON-NLS-1$ //$NON-NLS-0$ name: "comment.block.cshtml", //$NON-NLS-0$ diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-vb/syntax.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-vb/syntax.js new file mode 100644 index 0000000..5cc1b63 --- /dev/null +++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-vb/syntax.js @@ -0,0 +1,113 @@ +/******************************************************************************* + * @license + * Copyright (c) 2014 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License v1.0 + * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution + * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). + * + * Contributors: IBM Corporation - initial API and implementation + ******************************************************************************/ + +/*eslint-env browser, amd*/ +define("orion/editor/stylers/text_x-vb/syntax", ["orion/editor/stylers/lib/syntax"], function(mLib) { //$NON-NLS-1$ //$NON-NLS-0$ + var keywords = [ + "AddHandler", "AddressOf", "Aggregate", "Alias", "AndAlso", //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "And", "Ansi", "Assembly", "Async", "As", "Auto", "Await", //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Binary", "Boolean", "ByRef", "Byte", "ByVal", //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Call", "Case", "Catch", "CBool", "CByte", "CChar", "CDate", //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "CDbl", "CDec", "Char", "CInt", "Class", "CLng", "CObj", "Compare", //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Const", "CShort", "CSng", "CStr", "CType", "Custom", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Date", "Decimal", "Declare", "Default", "Delegate", "Dim", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "DirectCast", "Distinct", "Double", "Do", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Each", "ElseIf", "Else", "EndIf", "End", "Enum", "Equals", //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Erase", "Error", "Event", "Exit", "Explicit", //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "False", "Finally", "For", "Friend", "From", "Function", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "GetType", "Get", "GoSub", "GoTo", "Group By", "Group Join", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Handles", //$NON-NLS-0$ + "If", "Implements", "Imports", "Inherits", "Integer", "Interface", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Into", "In", "IsFalse", "IsTrue", "Is", "Iterator", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Join", //$NON-NLS-5$ + "Key", //$NON-NLS-5$ + "Let", "Lib", "Like", "Long", "Loop", //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Me", "Mid", "Module", "Mod", "MustInherit", "MustOverride", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "MyBase", "MyClass", //$NON-NLS-1$ //$NON-NLS-0$ + "Namespace", "New", "Next", "Nothing", "NotInheritable", //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "NotOverridable", "Not", //$NON-NLS-1$ //$NON-NLS-0$ + "Object", "Off", "On", "Optional", "Option", "Order By", "OrElse", //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Or", "Overloads", "Overridable", "Overrides", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "ParamArray", "Preserve", "Private", "Property", "Protected", "Public", //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "RaiseEvent", "ReadOnly", "ReDim", "REM", "RemoveHandler", "Resume", "Return", //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Select", "Set", "Shadows", "Shared", "Short", "Single", "Skip While", "Skip", //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Static", "Step", "Stop", "Strict", "String", "Structure", "Sub", "SyncLock", //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Take While", "Take", "Text", "Then", "Throw", "To", "True", "Try", "TypeOf", //$NON-NLS-8$ //$NON-NLS-7$ //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Unicode", "Until", //$NON-NLS-1$ //$NON-NLS-0$ + "Variant", //$NON-NLS-0$ + "Wend", "When", "Where", "While", "WithEvents", "With", "WriteOnly", //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "Xor", //$NON-NLS-0$ + "Yield" //$NON-NLS-0$ + ]; + + var preprocessorDirectives = ["Const", "ElseIf", "Else", "End", "ExternalSource", "If", "Region"]; //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + + var grammars = []; + grammars.push.apply(grammars, mLib.grammars); + grammars.push({ + id: "orion.vb", //$NON-NLS-0$ + contentTypes: ["text/x-vb"], //$NON-NLS-0$ + patterns: [ + {include: "orion.lib#string_doubleQuote"}, //$NON-NLS-0$ + {include: "#doc"}, //$NON-NLS-0$ + {include: "#comment"}, //$NON-NLS-0$ + {include: "orion.lib#brace_open"}, //$NON-NLS-0$ + {include: "orion.lib#brace_close"}, //$NON-NLS-0$ + {include: "orion.lib#bracket_open"}, //$NON-NLS-0$ + {include: "orion.lib#bracket_close"}, //$NON-NLS-0$ + {include: "orion.lib#parenthesis_open"}, //$NON-NLS-0$ + {include: "orion.lib#parenthesis_close"}, //$NON-NLS-0$ + {include: "orion.lib#number_decimal"}, //$NON-NLS-0$ + {include: "#number_hex"}, //$NON-NLS-0$ + { + match: "^\\s*#(?:" + preprocessorDirectives.join("|") + ")\\b[^$]*", //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + name: "meta.preprocessor.vb" //$NON-NLS-0$ + }, + { + match: "\\b(?:" + keywords.join("|") + ")\\b", //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + name: "keyword.control.vb" //$NON-NLS-0$ + } + ], + repository: { + comment: { + begin: {match: "'", literal: "'"}, //$NON-NLS-1$ //$NON-NLS-0$ + end: {match: "$", literal: ""}, //$NON-NLS-0$ + name: "comment.line.vb", //$NON-NLS-0$ + patterns: [ + { + include: "orion.lib#todo_comment_singleLine" //$NON-NLS-0$ + } + ] + }, + doc: { + match: {match: "'''.*", literal: "'''"}, //$NON-NLS-1$ //$NON-NLS-0$ + name: "comment.line.documentation.vb", //$NON-NLS-0$ + patterns: [ + { + match: "<[^\\s>]*>", //$NON-NLS-0$ + name: "meta.documentation.tag" //$NON-NLS-0$ + }, { + include: "orion.lib#todo_comment_singleLine" //$NON-NLS-0$ + } + ] + }, + number_hex: { + match: "&[hH][0-9A-Fa-f]+\\b", //$NON-NLS-0$ + name: "constant.numeric.hex.vb" //$NON-NLS-0$ + }, + } + }); + return { + id: grammars[grammars.length - 1].id, + grammars: grammars, + keywords: keywords + }; +}); diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-vbhtml/syntax.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-vbhtml/syntax.js new file mode 100644 index 0000000..f47199f --- /dev/null +++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-vbhtml/syntax.js @@ -0,0 +1,69 @@ +/******************************************************************************* + * @license + * Copyright (c) 2014 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License v1.0 + * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution + * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). + * + * Contributors: IBM Corporation - initial API and implementation + ******************************************************************************/ + +/*eslint-env browser, amd*/ +define("orion/editor/stylers/text_x-vbhtml/syntax", [ + "orion/editor/stylers/application_xml/syntax", + "orion/editor/stylers/text_html/syntax", + "orion/editor/stylers/text_x-vb/syntax"], function(mXML, mHTML, mVB) { //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + + var grammars = []; + grammars.push.apply(grammars, mXML.grammars); + grammars.push.apply(grammars, mHTML.grammars); + grammars.push.apply(grammars, mVB.grammars); + grammars.push({ + id: "orion.vbhtml", //$NON-NLS-0$ + contentTypes: ["text/x-vbhtml"], //$NON-NLS-0$ + patterns: [ + {include: "#vbhtmlComment"}, //$NON-NLS-0$ + {include: "#codeBlock"}, //$NON-NLS-0$ + {include: "#expression"}, //$NON-NLS-0$ + {include: "#reference"}, //$NON-NLS-0$ + {include: "orion.html"}, //$NON-NLS-0$ + ], + repository: { + vbhtmlComment: { + begin: {match: "@\\*", literal: "@*"}, //$NON-NLS-1$ //$NON-NLS-0$ + end: {match: "\\*@", literal: "*@"}, //$NON-NLS-1$ //$NON-NLS-0$ + name: "comment.block.vbhtml", //$NON-NLS-0$ + }, + codeBlock: { + begin: "(?i)^\\s*@code", //$NON-NLS-0$ + end: "(?i)end code", //$NON-NLS-0$ + captures: { + 0: {name: "entity.name.declaration.vb"} //$NON-NLS-0$ + }, + contentName: "source.vb.embedded.vbhtml", //$NON-NLS-0$ + patterns: [ + {include: "orion.xml#tag"}, //$NON-NLS-0$ + {include: "#reference"}, //$NON-NLS-0$ + {include: "orion.vb"}, //$NON-NLS-0$ + ] + }, + expression: { + match: "(?i)^\\s*@(?!code)[^$]*", //$NON-NLS-0$ + patterns: [ + {include: "#reference"}, //$NON-NLS-0$ + {include: "orion.vb"}, //$NON-NLS-0$ + ] + }, + reference: { + match: "@", //$NON-NLS-0$ + name: "entity.name.declaration.vb" //$NON-NLS-0$ + } + } + }); + return { + id: grammars[grammars.length - 1].id, + grammars: grammars, + keywords: [] + }; +}); diff --git a/bundles/org.eclipse.orion.client.ui/web/defaults.pref b/bundles/org.eclipse.orion.client.ui/web/defaults.pref index 81dbe2c..bafaa1b 100644 --- a/bundles/org.eclipse.orion.client.ui/web/defaults.pref +++ b/bundles/org.eclipse.orion.client.ui/web/defaults.pref @@ -28,6 +28,7 @@ "plugins/languages/python/pythonPlugin.html":true, "plugins/languages/ruby/rubyPlugin.html":true, "plugins/languages/swift/swiftPlugin.html":true, + "plugins/languages/vb/vbPlugin.html":true, "plugins/languages/xml/xmlPlugin.html":true, "plugins/languages/xquery/xqueryPlugin.html":true, "plugins/languages/yaml/yamlPlugin.html":true, diff --git a/bundles/org.eclipse.orion.client.ui/web/plugins/languages/csharp/csharpPlugin.js b/bundles/org.eclipse.orion.client.ui/web/plugins/languages/csharp/csharpPlugin.js index 61a4c5b..f845666 100644 --- a/bundles/org.eclipse.orion.client.ui/web/plugins/languages/csharp/csharpPlugin.js +++ b/bundles/org.eclipse.orion.client.ui/web/plugins/languages/csharp/csharpPlugin.js @@ -23,7 +23,7 @@ define(['orion/plugin', 'orion/editor/stylers/text_x-csharp/syntax', 'orion/edit var provider = new PluginProvider(headers); /** - * Register the C# content type + * Register the C# content types */ provider.registerServiceProvider("orion.core.contenttype", {}, { contentTypes: [ diff --git a/bundles/org.eclipse.orion.client.ui/web/plugins/languages/vb/vbPlugin.html b/bundles/org.eclipse.orion.client.ui/web/plugins/languages/vb/vbPlugin.html new file mode 100644 index 0000000..39c6dd9 --- /dev/null +++ b/bundles/org.eclipse.orion.client.ui/web/plugins/languages/vb/vbPlugin.html @@ -0,0 +1,61 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="UTF-8"> + <meta name="copyright" content="Copyright (c) IBM Corporation and others 2014."> + <title>Orion Visual Basic .NET Support</title> + <script src="../../../requirejs/require.js"></script> + <script type="text/javascript"> + /*eslint-env browser, amd*/ + require({ + baseUrl: '../../../', + paths: { + text: 'requirejs/text', + i18n: 'requirejs/i18n', + domReady: 'requirejs/domReady' + }, + packages: [ + ] + }); + require(["plugins/languages/vb/vbPlugin"]); + </script> +</head> + +<body id="orion-settings" class="orionPage" style="padding: 10px;"> + <h2>Visual Basic .NET Tools Support</h2> + <p> + This plugin provides Visual Basic .NET tooling, including: + </p> + <ul> + <li><em>Editing</em> - an editor with syntax highlighting</li> + </ul> + <p>October 16, 2013</p> + + <div class="split-selection-table"> + <div class="sectionWrapper toolComposite" style="margin: 15px 30px 0px 15px; max-width: 600px;"> + <div class="sectionAnchor sectionTitle layoutLeft"> + License + </div> + </div> + <div class="sections sectionTable" style="margin: 0px 30px 0px 15px; padding-left: 6px; padding-right: 6px; max-width: 600px;"> + <p> + The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise + indicated below, the Content is provided to you under the terms and conditions of the + <a href="http://www.eclipse.org/legal/epl-v10.html">Eclipse Public License Version 1.0</a> + ("EPL"), and the <a href="http://www.eclipse.org/org/documents/edl-v10.html"> + Eclipse Distribution License Version 1.0</a> ("EDL"). + For purposes of the EPL and EDL, "Program" will mean the Content. + </p> + + <p> + If you did not receive this Content directly from the Eclipse Foundation, the Content is + being redistributed by another party ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the Redistributor's license that was + provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise + indicated below, the terms and conditions of the EPL still apply to any source code in the Content + and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>. + </p> + </div> + </div> +</body> +</html> diff --git a/bundles/org.eclipse.orion.client.ui/web/plugins/languages/vb/vbPlugin.js b/bundles/org.eclipse.orion.client.ui/web/plugins/languages/vb/vbPlugin.js new file mode 100644 index 0000000..a59ea49 --- /dev/null +++ b/bundles/org.eclipse.orion.client.ui/web/plugins/languages/vb/vbPlugin.js @@ -0,0 +1,54 @@ +/******************************************************************************* + * @license + * Copyright (c) 2014 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials are made + * available under the terms of the Eclipse Public License v1.0 + * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution + * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +/*eslint-env browser, amd*/ +define(['orion/plugin', 'orion/editor/stylers/text_x-vb/syntax', 'orion/editor/stylers/text_x-vbhtml/syntax'], function(PluginProvider, mVB, mVBHtml) { + + /** + * Plug-in headers + */ + var headers = { + name: "Orion Visual Basic .NET Tool Support", + version: "1.0", + description: "This plugin provides Visual Basic .NET tools support for Orion." + }; + var provider = new PluginProvider(headers); + + /** + * Register the Visual Basic .NET content types + */ + provider.registerServiceProvider("orion.core.contenttype", {}, { + contentTypes: [ + { id: "text/x-vb", + "extends": "text/plain", + name: "Visual Basic .NET", + extension: ["vb"] + } + ] + }); + provider.registerServiceProvider("orion.core.contenttype", {}, { + contentTypes: [ + { id: "text/x-vbhtml", + "extends": "text/plain", + name: "vbhtml", + extension: ["vbhtml"] + } + ] + }); + + /** + * Register syntax styling + */ + provider.registerServiceProvider("orion.edit.highlighter", {}, mVB.grammars[mVB.grammars.length - 1]); + provider.registerServiceProvider("orion.edit.highlighter", {}, mVBHtml.grammars[mVBHtml.grammars.length - 1]); + + provider.connect(); +}); |