diff options
author | Mike Rennie <Michael_Rennie@ca.ibm.com> | 2014-07-02 12:36:17 -0400 |
---|---|---|
committer | Mike Rennie <Michael_Rennie@ca.ibm.com> | 2014-07-02 12:36:17 -0400 |
commit | 63fdada387635adbec22aaae58cd19c3719140ee (patch) | |
tree | fa41bf9e783dd51d74d91423691a5049aee832f2 | |
parent | e39daa51ec38a70b05cc94a64943dad5215843f2 (diff) | |
parent | 46b6b7cd0802f9f8b312999b64c516c57a02c1b8 (diff) | |
download | org.eclipse.orion.client-origin/eslint0.6.2.zip org.eclipse.orion.client-origin/eslint0.6.2.tar.gz org.eclipse.orion.client-origin/eslint0.6.2.tar.bz2 |
Merge commit '46b6b7cd0802f9f8b312999b64c516c57a02c1b8' into eslint0.6.2origin/eslint0.6.2
20 files changed, 443 insertions, 157 deletions
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-erlang/syntax.js b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-erlang/syntax.js new file mode 100644 index 0000000..47cdd3a --- /dev/null +++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-erlang/syntax.js @@ -0,0 +1,105 @@ +/******************************************************************************* + * @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 + ******************************************************************************/ + +/*global define*/ + +define("orion/editor/stylers/text_x-erlang/syntax", ["orion/editor/stylers/lib/syntax"], function(mLib) { //$NON-NLS-1$ //$NON-NLS-0$ + var keywords = [ + "xor", //$NON-NLS-0$ + "when", //$NON-NLS-0$ + "try", //$NON-NLS-0$ + "rem", "receive", //$NON-NLS-1$ //$NON-NLS-0$ + "query", //$NON-NLS-0$ + "orelse", "or", "of", //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "not", //$NON-NLS-0$ + "let", //$NON-NLS-0$ + "if", //$NON-NLS-0$ + "fun", //$NON-NLS-0$ + "end", //$NON-NLS-0$ + "div", //$NON-NLS-0$ + "cond", "catch", "case", //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "bxor", "bsr", "bsl", "bor", "bnot", "begin", "band", //$NON-NLS-6$ //$NON-NLS-5$ //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "andalso", "and", "after" //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + ]; + + // For Preprocessors, Records and so on specified with hyphens + var hyphenKeywords = [ + "vsn", //$NON-NLS-0$ + "undef", //$NON-NLS-0$ + "type", //$NON-NLS-0$ + "spec", //$NON-NLS-0$ + "record", //$NON-NLS-0$ + "on_load", "opaque", //$NON-NLS-1$ //$NON-NLS-0$ + "module", //$NON-NLS-0$ + "include_lib", "include", "import", "ifndef", "ifdef", //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "file", //$NON-NLS-0$ + "export_type", "export", "endif", "else", //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + "define", //$NON-NLS-0$ + "callback", "compile", //$NON-NLS-1$ //$NON-NLS-0$ + "behaviour" //$NON-NLS-0$ + ]; + + var grammars = mLib.grammars; + grammars.push({ + id: "orion.erlang", //$NON-NLS-0$ + contentTypes: ["text/x-erlang"], //$NON-NLS-0$ + patterns: [ + {include: "#comment"}, //$NON-NLS-0$ + {include: "#stringSingleLine"}, //$NON-NLS-0$ + {include: "#stringMultiLine"}, //$NON-NLS-0$ + {include: "#method"}, //$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$ + { + match: "\\b(?:" + keywords.join("|") + ")\\b", //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + name: "keyword.control.erlang" //$NON-NLS-0$ + }, + { + match: "^\\s*-(?:" + hyphenKeywords.join("|") + ")\\b", //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ + name: "keyword.control.erlang" //$NON-NLS-0$ + } + ], + repository: { + comment: { + match: "%.*", //$NON-NLS-0$ + name: "comment.line.erlang", //$NON-NLS-0$ + patterns: [ + { + include: "orion.lib#todo_comment_singleLine" //$NON-NLS-0$ + } + ] + }, + method: { + match: "(^|\\s)[a-zA-Z0-9_.]+(?=\\(|\\s\\()", //$NON-NLS-0$ + name: "entity.name.function.erlang" //$NON-NLS-0$ + }, + stringMultiLine: { + begin: '"(?:\\\\.|[^\\\\"])*$', //$NON-NLS-0$ + end: '^(?:\\\\.|[^\\\\"])*"', //$NON-NLS-0$ + name: "string.quoted.double.erlang" //$NON-NLS-0$ + }, + stringSingleLine: { + match: '"(?:\\\\.|[^\\\\"])*"', //$NON-NLS-0$ + name: "string.quoted.double.erlang" //$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/textstyler.css b/bundles/org.eclipse.orion.client.editor/web/orion/editor/textstyler.css index da5c038..5e430f7 100644 --- a/bundles/org.eclipse.orion.client.editor/web/orion/editor/textstyler.css +++ b/bundles/org.eclipse.orion.client.editor/web/orion/editor/textstyler.css @@ -16,6 +16,7 @@ .entity.name.function, .entity.name.type, .entity-name-function, .entity-name-type { font-weight: bold; + color: #3f7f7f; } .entity.name, .entity-name-tag { diff --git a/bundles/org.eclipse.orion.client.git/web/git/css/git.css b/bundles/org.eclipse.orion.client.git/web/git/css/git.css index 60ec7e4..672609c 100644 --- a/bundles/org.eclipse.orion.client.git/web/git/css/git.css +++ b/bundles/org.eclipse.orion.client.git/web/git/css/git.css @@ -33,90 +33,39 @@ margin-bottom:-10px; } -.gitCommitMessage .orionButton { - margin: 15px; - padding: 15px; - border: 1px solid #DDD; - border-radius: 5px; - width: calc(100% - 10px); - background-color: transparent; - text-align:center; -} - -.gitCommitMessage .orionButton:hover { - background-color: transparent; - box-shadow: none; -} - -.gitCommitMessage .orionButton:focus { - background-color: transparent; - box-shadow: none; -} - -.gitCommitMessage .slideContainerActive + .commitActions { - display: none; -} - .gitCommitMessage .gitCommitMessageTopRow { - width: calc(100% - 10px); + width: calc(100% - 6px); background-color: white; - padding: 5px; - border-top-left-radius: 5px; - border-top-right-radius: 5px; -} - -.gitCommitMessage .slideContainer { - width: 100%; - border-color: #ddd; - background: none repeat scroll 0 0 #f4f4f4; + padding: 0px; + border-radius: 5px; + border: 1px solid #ddd; } .gitCommitMessage .gitCommitMessageTopRow textarea { - width: calc(100% - 16px); - border-width: 0; -} - -.gitCommitMessage .gitCommitMessageBottomRow { width: calc(100% - 10px); - padding: 5px; -} - -.gitCommitMessage .parametersDismiss { - padding:0; -} - -.gitCommitMessage .parameters { - padding: 4px 0px; - vertical-align: middle; + border-width: 0px; } -.gitCommitMessage .dismissButton { - color: rgb(102, 102, 102); - border: 1px solid #dedede; - background-color: #ddd; - border-radius: 3px; - font-size: 9pt; - line-height: 12px; - margin: 4px; - padding: 4px 6px; -} - -.gitCommitMessage .dismissButton:hover, .dismissButton:focus { - background-color: #eee; - box-shadow: 0 1px 2px 0 rgba(0,0,0,0.2); +.gitCommitMessage .gitCommitMessageBottomRow { + width: calc(100% - 6px); + padding: 2px; + overflow: hidden; } -.gitCommitMessage .dismissButton.disabled { - color: #cdcdcd; +.primaryButton { + background-color: #7fa4c0 !important; + color: white !important; + border: 1px solid #7fa4c0 !important; } -.gitCommitMessage .dismissButton.disabled:hover { - background-color: #ddd; - box-shadow: none; +.gitCommitMessage .gitCommitMessageExplorerRow { + width: calc(100% - 6px); + padding: 0px; + overflow: hidden; } .gitCommitListSection { - background-color: #eee; + background-color: #f4f4f4; } .gitCommitListSectionTitle { diff --git a/bundles/org.eclipse.orion.client.git/web/git/git-repository.js b/bundles/org.eclipse.orion.client.git/web/git/git-repository.js index b565c79..b783dc8 100644 --- a/bundles/org.eclipse.orion.client.git/web/git/git-repository.js +++ b/bundles/org.eclipse.orion.client.git/web/git/git-repository.js @@ -74,8 +74,9 @@ mBootstrap.startup().then(function(core) { new KeyBinding.KeyBinding('h', true, true), new mCommandRegistry.URLBinding("openGitCommit", "commitName")); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ //TODO: remove when getting rid of multi repos page - commandRegistry.registerCommandContribution("itemLevelCommandsMini", "eclipse.orion.git.pull", 100); //$NON-NLS-1$ //$NON-NLS-0$ - commandRegistry.registerCommandContribution("itemLevelCommandsMini", "eclipse.git.deleteClone", 200); //$NON-NLS-1$ //$NON-NLS-0$ + commandRegistry.registerCommandContribution("itemLevelCommandsMini", "eclipse.orion.git.applyPatch", 100); //$NON-NLS-0$ + commandRegistry.registerCommandContribution("itemLevelCommandsMini", "eclipse.orion.git.pull", 200); //$NON-NLS-1$ //$NON-NLS-0$ + commandRegistry.registerCommandContribution("itemLevelCommandsMini", "eclipse.git.deleteClone", 300); //$NON-NLS-1$ //$NON-NLS-0$ // object contributions commandRegistry.registerCommandContribution("itemLevelCommands", "eclipse.openCloneContent", 100); //$NON-NLS-1$ //$NON-NLS-0$ diff --git a/bundles/org.eclipse.orion.client.git/web/git/nls/root/gitmessages.js b/bundles/org.eclipse.orion.client.git/web/git/nls/root/gitmessages.js index 638a094..77f7a12 100644 --- a/bundles/org.eclipse.orion.client.git/web/git/nls/root/gitmessages.js +++ b/bundles/org.eclipse.orion.client.git/web/git/nls/root/gitmessages.js @@ -220,6 +220,7 @@ define({ "Type the commit name (sha1):": "Type the commit name (sha1):", "Search": "Search", "Searching...": "Searching...", + "SelectAll": "Select All", "Looking for the commit": "Looking for the commit", "New Branch:": "New Branch:", "No remote selected": "No remote selected", diff --git a/bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js b/bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js index f1d6cc2..d66b5ee 100644 --- a/bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js +++ b/bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js @@ -414,9 +414,9 @@ function(PluginProvider, xhr, mServiceregistry, mGitClient, mSshTools, i18nUtil, Value: clone.GitUrl }, { - Name: "Git Status", - Value: "Git Status", - Href: "{+OrionHome}/git/git-status.html#" + item.Git.StatusLocation + Name: "Git Repository", + Value: "Git Repository", + Href: "{+OrionHome}/git/git-repository.html#" + item.Git.CloneLocation } ] } diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js index f66d616..7849333 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js @@ -1240,6 +1240,7 @@ var exports = {}; var syncCommand = new mCommands.Command({ name : messages["Sync"], tooltip: messages["SyncTooltip"], + extraClass: "primaryButton", //$NON-NLS-0$ // imageClass: "git-sprite-push", //$NON-NLS-0$ // spriteClass: "gitCommandSprite", //$NON-NLS-0$ id : "eclipse.orion.git.sync", //$NON-NLS-0$ @@ -2369,8 +2370,6 @@ var exports = {}; var logic = mGitCommitLogic(commitOptions); var commitCallback = logic.perform; - var commitMessageParameters = logic.createParameters(newLook); - var amendEventListener = logic.amendEventListener; var displayErrorOnStatus = logic.displayErrorOnStatus; function forceArray(item) { @@ -2491,7 +2490,6 @@ var exports = {}; name: newLook ? messages["SmartCommit"] : messages["Commit"], //$NON-NLS-0$ tooltip: newLook ? "" : messages["Commit"], //$NON-NLS-0$ id: "eclipse.orion.git.commitCommand", //$NON-NLS-0$ - parameters: commitMessageParameters, callback: function(data) { commitCallback(data).then(function() { refresh(); @@ -2686,7 +2684,8 @@ var exports = {}; return url; }, visibleWhen: function(item) { - return true; + var items = forceArray(item); + return items.length !== 0; } }); diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js index 0173b9a..bfda8b4 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js @@ -313,6 +313,7 @@ exports.GitRepositoryExplorer = (function() { slideout: true, content: '<div id="branchNode"></div>', //$NON-NLS-0$ canHide: true, + hidden: true, preferenceService: this.preferencesService }); var branchNavigator = new mGitBranchList.GitBranchListExplorer({ @@ -345,7 +346,7 @@ exports.GitRepositoryExplorer = (function() { title: messages["ChangedFiles"], slideout: true, content: '<div id="statusNode"></div>', //$NON-NLS-0$ - canHide: true, + canHide: false, preferenceService: this.preferencesService }); diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/logic/gitCommit.js b/bundles/org.eclipse.orion.client.git/web/orion/git/logic/gitCommit.js index 0f420ef..f931eaa 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/logic/gitCommit.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/logic/gitCommit.js @@ -27,10 +27,10 @@ define(['i18n!git/nls/gitmessages','orion/commandRegistry','orion/Deferred','ori var commandService = dependencies.commandService;
/* Fetches the appropriate commit message when the 'amend' flag is used */
- var amendEventListener = new mCommandRegistry.CommandEventListener('change', function(event, commandInvocation){ //$NON-NLS-0$
+ var amendEventListener = new mCommandRegistry.CommandEventListener('change', function(event, explorer){ //$NON-NLS-0$
var target = event.target;
- var item = commandInvocation.items.status || commandInvocation.handler.status;
- var commitMessageBox = document.getElementById("name" + "parameterCollector"); //$NON-NLS-0$//$NON-NLS-1$
+ var item = explorer.status;
+ var commitMessageBox = explorer.messageTextArea;
if(target.checked){
var progressService = serviceRegistry.getService("orion.page.message"); //$NON-NLS-0$
@@ -172,7 +172,7 @@ define(['i18n!git/nls/gitmessages','orion/commandRegistry','orion/Deferred','ori }
}
- if (body.Message && body.CommitterName && body.CommitterEmail && !data.parameters.optionsRequested) {
+ if (body.Message && body.CommitterName && body.CommitterEmail) {
commitFunction(body);
} else {
var dialog = new mCommit.CommitDialog({
@@ -184,9 +184,9 @@ define(['i18n!git/nls/gitmessages','orion/commandRegistry','orion/Deferred','ori };
var body = {};
- body.Message = data.parameters.valueFor("name"); //$NON-NLS-0$
- body.Amend = data.parameters.valueFor("amend"); //$NON-NLS-0$
- body.ChangeId = data.parameters.valueFor("changeId"); //$NON-NLS-0$
+ body.Message = data.userData.name;
+ body.Amend = data.userData.amend;
+ body.ChangeId = data.userData.changeId;
var config = item.Clone.Config;
if(body.Amend && !body.Message){
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/util.js b/bundles/org.eclipse.orion.client.git/web/orion/git/util.js index 73b58a4..e0c89f1 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/util.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/util.js @@ -20,8 +20,6 @@ define([ var interestedUnstagedGroup = ["Missing", "Modified", "Untracked", "Conflicting"]; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ var interestedStagedGroup = ["Added", "Changed", "Removed"]; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ - var statusUILocation = "git/git-status.html"; //$NON-NLS-0$ - function isStaged(change) { for (var i = 0; i < interestedStagedGroup.length; i++) { if (change.type === interestedStagedGroup[i]) { @@ -136,7 +134,6 @@ define([ } return { - statusUILocation: statusUILocation, isStaged: isStaged, isUnstaged: isUnstaged, isChange: isChange, diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitChangeList.js b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitChangeList.js index 6868afe..5cfeaf8 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitChangeList.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitChangeList.js @@ -13,6 +13,7 @@ define([
'i18n!git/nls/gitmessages',
+ 'orion/i18nUtil',
'orion/Deferred',
'orion/explorers/explorer',
'orion/git/uiUtil',
@@ -21,8 +22,9 @@ define([ 'orion/selection',
'orion/webui/littlelib',
'orion/commands',
+ 'orion/git/logic/gitCommit',
'orion/objects'
-], function(messages, Deferred, mExplorer, mGitUIUtil, mGitUtil, mTooltip, mSelection , lib, mCommands, objects) {
+], function(messages, i18nUtil, Deferred, mExplorer, mGitUIUtil, mGitUtil, mTooltip, mSelection , lib, mCommands, gitCommit, objects) {
var interestedUnstagedGroup = [ "Missing", "Modified", "Untracked", "Conflicting" ]; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
var interestedStagedGroup = [ "Added", "Changed", "Removed" ]; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
@@ -115,6 +117,9 @@ define([ }
var children = parentItem.children = that._sortBlock(that.getGroups(that.prefix));
if (that.prefix === "all") {
+ if (children.length > 0) {
+ children.unshift({Type: "ExplorerSelection", selectable: true});
+ }
children.unshift({Type: "CommitMsg", selectable: false});
}
children.forEach(function(child) {
@@ -153,8 +158,10 @@ define([ return prefix + "Root"; //$NON-NLS-0$
} else if (mGitUIUtil.isChange(item)) {
return prefix + item.type + item.name;
+ } else if (item.Type === "ExplorerSelection" || item.Type === "CommitMsg") {
+ return prefix + item.Type;
} else {
- return prefix + + item.type + item.DiffLocation;
+ return prefix + item.type + item.DiffLocation;
}
},
getModelType: function(groupItem, groupName) {
@@ -190,7 +197,7 @@ define([ // we have the same file at "Modified" ,"Added",
// "Changed","Missing" groups
- if (itemsInDetectGroup.length === (conflictPattern.length - 2)) {
+ if (itemsInDetectGroup.length === Math.max(0, conflictPattern.length - 2)) {
baseGroup[i].Conflicting = conflictPattern[0];
for (var k = 0; k < itemsInDetectGroup.length; k++) {
itemsInDetectGroup[k].Conflicting = "Hide"; //$NON-NLS-0$
@@ -282,7 +289,7 @@ define([ this.handleError = options.handleError;
this.gitClient = options.gitClient;
this.progressService = options.progressService;
- this.commitActionScope = "commitActions"; //$NON-NLS-0$
+ this.explorerSelectionScope = "explorerSelection"; //$NON-NLS-0$
this.createSelection();
this.createCommands();
if (this.prefix !== "all") {
@@ -295,13 +302,9 @@ define([ var deferred = new Deferred();
if (this.prefix === "all") {
var parent = items[0].parent;
- var commitDiv = lib.node("gitCommitMessage");
- var open = lib.$(".slideContainerActive", commitDiv);
- var commitMessage = "";
- if (open) {
- var textarea = lib.$("#nameparameterCollector", commitDiv);
- commitMessage = textarea.value;
- }
+ var name = this.messageTextArea.value;
+ var amend = this.amendCheck.checked;
+ var changeId = this.changeIDCheck.checked;
var that = this;
parent.children = parent.Children = null;
this.model.getChildren(parent, function(children) {
@@ -311,12 +314,9 @@ define([ return that.model.isStaged(item.type);
});
that.selection.setSelections(selection);
- if (open) {
- var commitDiv = lib.node("gitCommitMessage");
- that.commandService.runCommand("eclipse.orion.git.commitCommand", selection, that, null, null, lib.$(".orionButton", commitDiv));
- var textarea = lib.$("#nameparameterCollector", commitDiv);
- textarea.value = commitMessage;
- }
+ that.messageTextArea.value = name;
+ that.amendCheck.checked = amend;
+ that.changeIDCheck.checked = changeId;
deferred.resolve(children);
});
} else {
@@ -355,7 +355,7 @@ define([ model.getRoot(function(root) {
model.getChildren(root, function(children) {
// -1 for the commit message item
- result = children.length - 1;
+ result = Math.max(0, children.length - 2);
});
});
}
@@ -365,9 +365,9 @@ define([ mExplorer.createExplorerCommands(this.commandService);
var actionsNodeScope = this.section.actionsNode.id;
var selectionNodeScope = this.section.selectionNode.id;
- var titleActionsNode = this.section.titleActionsNode.id;
- this.commandService.registerCommandContribution(actionsNodeScope, "orion.explorer.expandAll", 200); //$NON-NLS-0$
- this.commandService.registerCommandContribution(actionsNodeScope, "orion.explorer.collapseAll", 300); //$NON-NLS-0$
+ var explorerSelectionScope = this.explorerSelectionScope;
+ this.commandService.registerCommandContribution(explorerSelectionScope, "orion.explorer.expandAll", 200); //$NON-NLS-0$
+ this.commandService.registerCommandContribution(explorerSelectionScope, "orion.explorer.collapseAll", 300); //$NON-NLS-0$
if (this.prefix === "staged") {
this.commandService.addCommandGroup(actionsNodeScope, "eclipse.gitCommitGroup", 1000, "Commit", null, null, null, "Commit", null, "eclipse.orion.git.commitCommand"); //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$ 549
this.commandService.registerCommandContribution(actionsNodeScope, "eclipse.orion.git.commitCommand", 100, "eclipse.gitCommitGroup"); //$NON-NLS-0$ 550
@@ -380,16 +380,16 @@ define([ this.commandService.registerCommandContribution(selectionNodeScope, "eclipse.orion.git.checkoutCommand", 300); //$NON-NLS-0$
this.commandService.registerCommandContribution("DefaultActionWrapper", "eclipse.orion.git.stageCommand", 100); //$NON-NLS-1$ //$NON-NLS-0$
} else if (this.prefix === "all") {
- this.commandService.registerCommandContribution(selectionNodeScope, "eclipse.orion.git.showStagedPatchCommand", 200); //$NON-NLS-0$
- this.commandService.registerCommandContribution(selectionNodeScope, "eclipse.orion.git.checkoutStagedCommand", 300); //$NON-NLS-0$
- this.commandService.registerCommandContribution(this.commitActionScope, "eclipse.orion.git.commitCommand", 100); //$NON-NLS-0$
- this.commandService.registerCommandContribution(titleActionsNode, "orion.explorer.selectAll", 100); //$NON-NLS-0$
- this.commandService.registerCommandContribution(titleActionsNode, "orion.explorer.deselectAllCommand", 100); //$NON-NLS-0$
- this.commandService.registerCommandContribution(actionsNodeScope, "eclipse.orion.git.applyPatch", 100); //$NON-NLS-0$
-
- this.commandService.renderCommands(this.commitActionScope, this.commitActionScope, [], this, "button"); //$NON-NLS-0$
+ this.commandService.registerCommandContribution(selectionNodeScope, "eclipse.orion.git.showStagedPatchCommand", 100); //$NON-NLS-0$
+ this.commandService.registerCommandContribution(selectionNodeScope, "eclipse.orion.git.checkoutStagedCommand", 200); //$NON-NLS-0$
+ this.commandService.registerCommandContribution(selectionNodeScope, "eclipse.orion.git.precommitCommand", 300); //$NON-NLS-0$
+
+ var node = lib.node(explorerSelectionScope);
+ if (node) {
+ this.commandService.destroy(node);
+ this.commandService.renderCommands(explorerSelectionScope, explorerSelectionScope, this, this, "button"); //$NON-NLS-0$
+ }
this.commandService.renderCommands(selectionNodeScope, selectionNodeScope, [], this, "button", {"Clone" : this.model.repository}); //$NON-NLS-1$ //$NON-NLS-0$
- this.commandService.renderCommands(titleActionsNode, titleActionsNode, this, this, "button"); //$NON-NLS-0$
}
this.commandService.renderCommands(actionsNodeScope, actionsNodeScope, this, this, "button"); //$NON-NLS-0$
@@ -402,7 +402,7 @@ define([ var selectAllCommand = new mCommands.Command({
tooltip : messages["Select all"],
imageClass : "core-sprite-check", //$NON-NLS-0$
- id: "orion.explorer.selectAll", //$NON-NLS-0$
+ id: "orion.explorer.selectAllCommandChangeList", //$NON-NLS-0$
visibleWhen : function(item) {
var result = false;
that.model.getRoot(function(root) {
@@ -426,7 +426,7 @@ define([ var deselectAllCommand = new mCommands.Command({
tooltip : messages["Deselect all"],
imageClass : "core-sprite-check_on", //$NON-NLS-0$
- id: "orion.explorer.deselectAllCommand", //$NON-NLS-0$
+ id: "orion.explorer.deselectAllCommandChangeList", //$NON-NLS-0$
visibleWhen : function(item) {
var result = false;
that.model.getRoot(function(root) {
@@ -434,7 +434,7 @@ define([ var selection = root.children.filter(function(item) {
return that.model.isStaged(item.type);
});
- result = selection.length === (root.children.length - 1);
+ result = selection.length === Math.max(0, root.children.length - 2);
}
});
return result;
@@ -449,6 +449,27 @@ define([ }
});
+ var precommitCommand = new mCommands.Command({
+ tooltip: messages["Commit"], //$NON-NLS-0$
+ id: "eclipse.orion.git.precommitCommand", //$NON-NLS-0$
+ extraClass: "primaryButton", //$NON-NLS-0$
+ callback: function(data) {
+ var name = that.messageTextArea.value.trim();
+ var amend = that.amendCheck.checked;
+ var changeId = that.changeIDCheck.checked;
+ that.commandService.runCommand("eclipse.orion.git.commitCommand", data.items, data.handler, null, {name: name, amend: amend, changeId: changeId});
+ },
+ visibleWhen: function(item) {
+ var items = item;
+ if (!Array.isArray(items)) {
+ items = [items];
+ }
+ precommitCommand.name = i18nUtil.formatMessage(messages['SmartCountCommit'], items.length);
+ return true;
+ }
+ });
+
+ this.commandService.addCommand(precommitCommand);
this.commandService.addCommand(selectAllCommand);
this.commandService.addCommand(deselectAllCommand);
},
@@ -466,10 +487,6 @@ define([ commandService.renderCommands(section.selectionNode.id, selectionTools, event.selections, that, "button", {"Clone" : that.model.repository}); //$NON-NLS-1$ //$NON-NLS-0$
}
if (that.prefix === "all") {
- if (lib.node(that.commitActionScope)) {
- commandService.destroy(that.commitActionScope);
- }
- commandService.renderCommands(that.commitActionScope, that.commitActionScope, event.selections, that, "button"); //$NON-NLS-0$
var titleTools = section.titleActionsNode;
if (titleTools) {
commandService.destroy(titleTools);
@@ -492,7 +509,7 @@ define([ GitChangeListRenderer.prototype = Object.create(mExplorer.SelectionRenderer.prototype);
objects.mixin(GitChangeListRenderer.prototype, {
getCellElement: function(col_no, item, tableRow){
- var div, td, navGridHolder;
+ var div, td, navGridHolder, itemLabel, diffActionWrapper;
var explorer = this.explorer;
switch (col_no) {
case 0:
@@ -501,46 +518,59 @@ define([ div.className = "sectionTableItem"; //$NON-NLS-0$
td.appendChild(div);
if (item.Type === "CommitMsg") {
+ tableRow.classList.add("gitCommitListSection");
var outerDiv = document.createElement("div"); //$NON-NLS-0$
outerDiv.id = "gitCommitMessage";
outerDiv.className = "gitCommitMessage toolComposite";
td.colSpan = 2;
tableRow.classList.remove("selectableNavRow");
- var slideContainer = document.createElement("div");
- slideContainer.id = explorer.commitActionScope + "slideContainer";
- slideContainer.className = "slideParameters slideContainer";
-
var topRow = document.createElement("div");
topRow.className = "gitCommitMessageTopRow";
- var textArea = document.createElement("textarea"); //$NON-NLS-0$
- textArea.rows = 5;
+ var textArea = explorer.messageTextArea = document.createElement("textarea"); //$NON-NLS-0$
+ textArea.rows = 2;
textArea.type = "textarea"; //$NON-NLS-0$
textArea.id = "nameparameterCollector";
textArea.placeholder = messages["SmartCommit"];
+ textArea.classList.add("parameterInput"); //$NON-NLS-0$
topRow.appendChild(textArea);
-
- slideContainer.appendChild(topRow);
var bottomRow = document.createElement("div");
bottomRow.className = "gitCommitMessageBottomRow";
- var bottomLeft = document.createElement("span");
- bottomLeft.className = "layoutLeft parameters";
var bottomRight = document.createElement("span");
- bottomRight.className = "layoutRight parametersDismiss";
-
- bottomRow.appendChild(bottomLeft);
+ bottomRight.className = "layoutRight parameters";
bottomRow.appendChild(bottomRight);
- slideContainer.appendChild(bottomRow);
- outerDiv.appendChild(slideContainer);
+ var amendCheck = explorer.amendCheck = document.createElement("input"); //$NON-NLS-0$
+ amendCheck.type = "checkbox"; //$NON-NLS-0$
+ amendCheck.id = "amendparameterCollector";
+ var listener = gitCommit({serviceRegistry: explorer.registry, commandService: explorer.commandService}).amendEventListener;
+ amendCheck.addEventListener(listener.event, function(evt){
+ return listener.handler(evt, explorer);
+ }, listener.capture);
+ bottomRight.appendChild(amendCheck);
+
+ var amendLabel = document.createElement("label"); //$NON-NLS-0$
+ amendLabel.classList.add("parameterInput"); //$NON-NLS-0$
+ amendLabel.setAttribute("for", amendCheck.id); //$NON-NLS-0$
+ amendLabel.textContent = messages['SmartAmend'];
+ bottomRight.appendChild(amendLabel);
- var commitActions = document.createElement("div");
- commitActions.id = commitActions.className = explorer.commitActionScope;
- outerDiv.appendChild(commitActions);
+ var changeIDCheck = explorer.changeIDCheck = document.createElement("input"); //$NON-NLS-0$
+ changeIDCheck.type = "checkbox"; //$NON-NLS-0$
+ changeIDCheck.id = "changeIDparameterCollector";
+ bottomRight.appendChild(changeIDCheck);
+ var changeIDLabel = document.createElement("label"); //$NON-NLS-0$
+ changeIDLabel.classList.add("parameterInput"); //$NON-NLS-0$
+ changeIDLabel.setAttribute("for", changeIDCheck.id); //$NON-NLS-0$
+ changeIDLabel.textContent = messages['SmartChangeId'];
+ bottomRight.appendChild(changeIDLabel);
+
+ outerDiv.appendChild(topRow);
+ outerDiv.appendChild(bottomRow);
div.appendChild(outerDiv);
}
else if (mGitUIUtil.isChange(item) || item.Type === "Diff") {
@@ -548,7 +578,7 @@ define([ this.getExpandImage(tableRow, div);
navGridHolder = explorer.getNavDict() ? explorer.getNavDict().getGridNavHolder(item, true) : null;
- var diffActionWrapper = document.createElement("span"); //$NON-NLS-0$
+ diffActionWrapper = document.createElement("span"); //$NON-NLS-0$
diffActionWrapper.id = explorer.prefix + item.name + item.type + "DiffActionWrapper"; //$NON-NLS-0$
diffActionWrapper.className = "sectionExplorerActions"; //$NON-NLS-0$
div.appendChild(diffActionWrapper);
@@ -566,9 +596,20 @@ define([ });
div.appendChild(icon);
- var itemLabel = document.createElement("span"); //$NON-NLS-0$
+ itemLabel = document.createElement("span"); //$NON-NLS-0$
itemLabel.textContent = item.name;
div.appendChild(itemLabel);
+ } else if (item.Type === "ExplorerSelection") {
+ td.colSpan = 2;
+ itemLabel = document.createElement("span"); //$NON-NLS-0$
+ itemLabel.textContent = messages["SelectAll"];
+ div.appendChild(itemLabel);
+
+ var actionsArea = document.createElement("div"); //$NON-NLS-0$
+ actionsArea.className = "layoutRight commandList"; //$NON-NLS-0$
+ actionsArea.id = explorer.explorerSelectionScope;
+ div.appendChild(actionsArea);
+ explorer.commandService.renderCommands(actionsArea.id, actionsArea, explorer, explorer, "button"); //$NON-NLS-0$
} else {
// render the compare widget
td.colSpan = 2;
@@ -576,7 +617,7 @@ define([ actionsWrapper.className = "sectionExplorerActions"; //$NON-NLS-0$
div.appendChild(actionsWrapper);
- var diffActionWrapper = document.createElement("span"); //$NON-NLS-0$
+ diffActionWrapper = document.createElement("span"); //$NON-NLS-0$
var prefix = explorer.prefix + item.parent.name + item.parent.type;
diffActionWrapper.id = prefix + "DiffActionWrapperChange"; //$NON-NLS-0$
actionsWrapper.appendChild(diffActionWrapper);
@@ -617,14 +658,26 @@ define([ }
},
onCheckedFunc: function(rowId, checked, manually, item) {
- //stage or unstage
- if (checked) {
- this.explorer.commandService.runCommand("eclipse.orion.git.stageCommand", [item], this.explorer);
+ if (item.Type === "ExplorerSelection") {
+ if (checked) {
+ this.explorer.commandService.runCommand("orion.explorer.selectAllCommandChangeList", this.explorer, this.explorer);
+ } else {
+ this.explorer.commandService.runCommand("orion.explorer.deselectAllCommandChangeList", this.explorer, this.explorer);
+ }
} else {
- this.explorer.commandService.runCommand("eclipse.orion.git.unstageCommand", [item], this.explorer);
+ //stage or unstage
+ if (checked) {
+ this.explorer.commandService.runCommand("eclipse.orion.git.stageCommand", [item], this.explorer);
+ } else {
+ this.explorer.commandService.runCommand("eclipse.orion.git.unstageCommand", [item], this.explorer);
+ }
}
},
getCheckedFunc: function(item){
+ if (item.Type === "ExplorerSelection") {
+ return !this.explorer.commandService.findCommand("orion.explorer.selectAllCommandChangeList").visibleWhen(this.explorer);
+ }
+
return this.explorer.model.isStaged(item.type);
}
});
diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/finder.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/finder.js index 48b6148..38a79ad 100644 --- a/bundles/org.eclipse.orion.client.javascript/web/javascript/finder.js +++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/finder.js @@ -189,6 +189,10 @@ define([ case Estraverse.Syntax.WithStatement: this.checkId(node.object); break; + case Estraverse.Syntax.ThrowStatement: { + this.checkId(node.argument); + break; + } } }, @@ -758,4 +762,4 @@ define([ }; return Finder; -}); +});
\ No newline at end of file diff --git a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js index 93fd924..4ca4035 100644 --- a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js +++ b/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/occurrencesTests.js @@ -1983,5 +1983,52 @@ define([ }); }); + /** + * Tests throw statements + * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=438402 + */ + it('test_throwStatement1', function() { + editorContext.text = "var a; throw a;"; + return occurrences.computeOccurrences(editorContext, setContext(4, 4)).then(function(results) { + try { + assertOccurrences(results, [{start:4, end:5}, {start:13, end:14}]); + } + finally { + tearDown(); + } + }); + }); + + /** + * Tests throw statements + * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=438402 + */ + it('test_throwStatement2', function() { + editorContext.text = "var a; function f() { if(a) { throw a; }}"; + return occurrences.computeOccurrences(editorContext, setContext(25, 25)).then(function(results) { + try { + assertOccurrences(results, [{start:4, end:5}, {start:25, end:26}, {start:36, end:37}]); + } + finally { + tearDown(); + } + }); + }); + + /** + * Tests throw statements + * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=438402 + */ + it('test_throwStatement3', function() { + editorContext.text = "var a; function f() { if(a) { throw a; }}"; + return occurrences.computeOccurrences(editorContext, setContext(36, 36)).then(function(results) { + try { + assertOccurrences(results, [{start:4, end:5}, {start:25, end:26}, {start:36, end:37}]); + } + finally { + tearDown(); + } + }); + }); }); });
\ No newline at end of file diff --git a/bundles/org.eclipse.orion.client.ui/web/defaults.pref b/bundles/org.eclipse.orion.client.ui/web/defaults.pref index 25c2062..43568ff 100644 --- a/bundles/org.eclipse.orion.client.ui/web/defaults.pref +++ b/bundles/org.eclipse.orion.client.ui/web/defaults.pref @@ -13,6 +13,7 @@ "plugins/languages/arduino/arduinoPlugin.html":true, "plugins/languages/c/cPlugin.html":true, "plugins/languages/cpp/cppPlugin.html":true, + "plugins/languages/erlang/erlangPlugin.html":true, "plugins/languages/java/javaPlugin.html":true, "plugins/languages/lua/luaPlugin.html":true,
"plugins/languages/php/phpPlugin.html":true, diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js b/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js index dbb4929..1242bd3 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js @@ -1007,7 +1007,7 @@ define([ var self = this; menuButton.onclick = function(evt){ var bounds = lib.bounds(dropdownArrow); - if (evt.clientX >= bounds.left && created.dropdown) { + if ((evt.clientX >= bounds.left && created.dropdown) || pretendDefaultActionId === true) { created.dropdown.toggle(evt); } else { self._invoke(defaultInvocation); diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/commands.js b/bundles/org.eclipse.orion.client.ui/web/orion/commands.js index 06639df..38758cb 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/commands.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/commands.js @@ -372,6 +372,9 @@ define([ } else { element = document.createElement("button"); //$NON-NLS-0$ element.className = "orionButton"; //$NON-NLS-0$ + if (command.extraClass) { + element.classList.add(command.extraClass); + } if (useImage) { if (command.hasImage()) { _addImageToElement(command, element, id); @@ -622,6 +625,7 @@ define([ this.imageClass = options.imageClass; // points to the location in a sprite this.addImageClassToElement = options.addImageClassToElement; // optional boolean if true will add the image class to the // element's class list + this.extraClass = options.extraClass; this.selectionClass = options.selectionClass; this.spriteClass = options.spriteClass || "commandSprite"; // defines the background image containing sprites //$NON-NLS-0$ this.visibleWhen = options.visibleWhen; diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/webui/SideMenu.js b/bundles/org.eclipse.orion.client.ui/web/orion/webui/SideMenu.js index a53229d..0818b94 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/webui/SideMenu.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/webui/SideMenu.js @@ -141,7 +141,13 @@ define(['orion/webui/littlelib', 'orion/PageUtil', 'orion/URL-shim'], function(l }, this); this._updateCategoryAnchors(); - this._parentNode.appendChild(sideMenuList); + this._show = function() { + this._parentNode.appendChild(sideMenuList); + this._show = SideMenu.prototype._show; + }; + window.setTimeout(function() { + this._show(); // this._show can be re-assigned + }.bind(this), 1000); // we delay rendering to give a chance to set related links } if (this._state === CLOSED_STATE) { @@ -190,7 +196,15 @@ define(['orion/webui/littlelib', 'orion/PageUtil', 'orion/URL-shim'], function(l } this.render(); }, - _updateCategoryAnchors: function() { + _updateCategoryAnchors: function() { + // treat *-scm and git categories as singleton if a related link exists + var scmInScope = []; + Object.keys(this._categorizedRelatedLinks).forEach(function(category) { + if (category === "git" || category.match(/-scm$/)) { + scmInScope.push(category); + } + }); + Object.keys(this._categorizedAnchors).forEach(function(category) { var anchor = this._categorizedAnchors[category]; var links = []; @@ -210,7 +224,7 @@ define(['orion/webui/littlelib', 'orion/PageUtil', 'orion/URL-shim'], function(l if (this._categorizedRelatedLinks[category]) { links.push.apply(links, this._categorizedRelatedLinks[category]); } - if (links.length === 0) { + if (links.length === 0 || (scmInScope.length !== 0 && (category === "git" || category.match(/-scm$/)) && scmInScope.indexOf(category) === -1)) { anchor.href = ""; anchor.title = anchor.parentElement.categoryName; anchor.parentElement.style.display = "none"; @@ -229,6 +243,7 @@ define(['orion/webui/littlelib', 'orion/PageUtil', 'orion/URL-shim'], function(l anchor.title = bestLink.title; } }, this); + this._show(); }, _updateCategoryNotifications: function() { clearTimeout(this._notificationTimeout); @@ -261,6 +276,8 @@ define(['orion/webui/littlelib', 'orion/PageUtil', 'orion/URL-shim'], function(l }); } }, this); + }, + _show : function(){ } }; return SideMenu; diff --git a/bundles/org.eclipse.orion.client.ui/web/plugins/languages/erlang/erlangPlugin.html b/bundles/org.eclipse.orion.client.ui/web/plugins/languages/erlang/erlangPlugin.html new file mode 100644 index 0000000..5ae3b73 --- /dev/null +++ b/bundles/org.eclipse.orion.client.ui/web/plugins/languages/erlang/erlangPlugin.html @@ -0,0 +1,62 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="UTF-8"> + <meta name="copyright" content="Copyright (c) IBM Corporation and others 2014."> + <title>Orion Erlang Support</title> + <link rel="stylesheet" type="text/css" href="/settings/settings.css"/> + <script src="../../../requirejs/require.js"></script> + <script type="text/javascript"> + /*global require*/ + require({ + baseUrl: '../../../', + paths: { + text: 'requirejs/text', + i18n: 'requirejs/i18n', + domReady: 'requirejs/domReady' + }, + packages: [ + ] + }); + require(["erlangPlugin.js"]); + </script> +</head> + +<body id="orion-settings" class="orionPage" style="padding: 10px;"> + <h2>Erlang Tools Support</h2> + <p> + This plugin provides Erlang 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/erlang/erlangPlugin.js b/bundles/org.eclipse.orion.client.ui/web/plugins/languages/erlang/erlangPlugin.js new file mode 100644 index 0000000..b8cb9ea --- /dev/null +++ b/bundles/org.eclipse.orion.client.ui/web/plugins/languages/erlang/erlangPlugin.js @@ -0,0 +1,43 @@ +/******************************************************************************* + * @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 + *******************************************************************************/ +/*global esprima*/ +/*jslint amd:true*/ +define(['orion/plugin', 'orion/editor/stylers/text_x-erlang/syntax'], function(PluginProvider, mErlang) { + /** + * Plug-in headers + */ + var headers = { + name: "Orion Erlang Tool Support", + version: "1.0", + description: "This plugin provides Erlang tools support for Orion." + }; + var provider = new PluginProvider(headers); + + /** + * Register the XQuery content types + */ + provider.registerServiceProvider("orion.core.contenttype", {}, { + contentTypes: [ + { id: "text/x-erlang", + "extends": "text/plain", + name: "Erlang", + extension: ["erl", "hrl"] + } + ] + }); + + /** + * Register syntax styling + */ + provider.registerServiceProvider("orion.edit.highlighter", {}, mErlang.grammars[mErlang.grammars.length - 1]); + provider.connect(); +}); diff --git a/modules/orionode/lib/orionode.client/defaults.pref b/modules/orionode/lib/orionode.client/defaults.pref index ccb40a5..b2210fb 100644 --- a/modules/orionode/lib/orionode.client/defaults.pref +++ b/modules/orionode/lib/orionode.client/defaults.pref @@ -8,6 +8,7 @@ "plugins/languages/arduino/arduinoPlugin.html":true, "plugins/languages/c/cPlugin.html":true, "plugins/languages/cpp/cppPlugin.html":true, + "plugins/languages/erlang/erlangPlugin.html":true, "plugins/languages/java/javaPlugin.html":true, "plugins/languages/lua/luaPlugin.html":true,
"plugins/languages/php/phpPlugin.html":true, |