Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 434029
Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/application_erl/syntax.js (-121 lines)
Lines 1-121 Link Here
1
/*******************************************************************************
2
 * @license
3
 * Copyright (c) 2014 IBM Corporation and others.
4
 * All rights reserved. This program and the accompanying materials are made 
5
 * available under the terms of the Eclipse Public License v1.0 
6
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
7
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
8
 * 
9
 * Contributors: IBM Corporation - initial API and implementation
10
 ******************************************************************************/
11
12
/*global define*/
13
14
define("orion/editor/stylers/application_erl/syntax", ["orion/editor/stylers/lib/syntax"], function(mLib) { //$NON-NLS-1$ //$NON-NLS-0$
15
	var keywords = [
16
		"fun",
17
		"when",
18
		"end",
19
		"receive",
20
		"case", 
21
		"of",
22
		"if",
23
		"after",
24
		"catch",
25
		"try",
26
		"begin", 
27
		"orelse",
28
		"andalso"
29
30
	];
31
32
	// For Preprocessors, Records and so on specified with hyphens
33
	var hyphenStuff = [
34
		"module",
35
		"export",
36
		"import",
37
		"compile",
38
		"vsn",
39
		"on_load",
40
		"spec",
41
		"record",
42
		"include",
43
		"include_lib",
44
		"define",
45
		"file",
46
		"type",
47
		"opaque",
48
		"export_type",
49
		"undef",
50
		"ifdef",
51
		"ifndef",
52
		"else",
53
		"endif"
54
	];
55
56
	var signs = [
57
		"#",
58
		":",
59
		"::"
60
	];
61
62
	var grammars = mLib.grammars;
63
	grammars.push({
64
		id: "orion.erl", //$NON-NLS-0$
65
		contentTypes: ["application/erl"], //$NON-NLS-0$ // Connection to erlPlugin.js
66
		patterns: [
67
			{include: "#comment"},
68
			{include: "#arrow"},
69
			{include: "orion.xq#variable"}, 
70
			{include: "orion.lib#string_doubleQuote"}, //$NON-NLS-0$
71
			{include: "orion.lib#string_singleQuote"}, //$NON-NLS-0$
72
			{include: "orion.lib#doc_block"}, //$NON-NLS-0$
73
			{include: "orion.lib#brace_open"}, //$NON-NLS-0$
74
			{include: "orion.lib#brace_close"}, //$NON-NLS-0$
75
			{include: "orion.lib#bracket_open"}, //$NON-NLS-0$
76
			{include: "orion.lib#bracket_close"}, //$NON-NLS-0$
77
			{include: "orion.lib#parenthesis_open"}, //$NON-NLS-0$
78
			{include: "orion.lib#parenthesis_close"}, //$NON-NLS-0$
79
			{include: "orion.lib#number_decimal"}, //$NON-NLS-0$
80
			{include: "orion.lib#number_hex"}, //$NON-NLS-0$
81
			{
82
				match: "\\b(?:" + keywords.join("|") + ")\\b", //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
83
				name: "keyword.control.js" //$NON-NLS-0$
84
			},
85
			{
86
				match: "-\\b(?:" + hyphenStuff.join("|") + ")\\b", //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
87
				name: "hyphen.erl" //$NON-NLS-0$
88
			},
89
			{
90
				match: signs.join("|"),
91
				name: "sign.erl"
92
			}
93
		],
94
		repository: {
95
			
96
			comment: {
97
				match: "%.*", //$NON-NLS-0$
98
				name: "comment.line.erl", //$NON-NLS-0$
99
				patterns: [
100
					{
101
						include: "orion.lib#todo_comment_singleLine" //$NON-NLS-0$
102
					}
103
				]
104
			},
105
			arrow: {
106
				match: "->|=>", //$NON-NLS-0$
107
				name: "arrow.erl" //$NON-NLS-0$
108
			},
109
			method: {
110
				match: "[a-zA-Z0-9_.]+(?=\\(|\\s\\()",
111
			    name: "method.erl"
112
			}
113
		}
114
115
	});
116
	return {
117
		id: grammars[grammars.length - 1].id,
118
		grammars: grammars,
119
		keywords: keywords
120
	};
121
});
(-)a/bundles/org.eclipse.orion.client.editor/web/orion/editor/stylers/text_x-erlang/syntax.js (+120 lines)
Added Link Here
1
/*******************************************************************************
2
 * @license
3
 * Copyright (c) 2014 IBM Corporation and others.
4
 * All rights reserved. This program and the accompanying materials are made 
5
 * available under the terms of the Eclipse Public License v1.0 
6
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
7
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
8
 * 
9
 * Contributors: IBM Corporation - initial API and implementation
10
 ******************************************************************************/
11
12
/*global define*/
13
14
define("orion/editor/stylers/text_x-erlang/syntax", ["orion/editor/stylers/lib/syntax"], function(mLib) { //$NON-NLS-1$ //$NON-NLS-0$
15
	var keywords = [
16
		"fun",
17
		"when",
18
		"end",
19
		"receive",
20
		"case", 
21
		"of",
22
		"if",
23
		"after",
24
		"catch",
25
		"try",
26
		"begin", 
27
		"orelse",
28
		"andalso"
29
30
	];
31
32
	// For Preprocessors, Records and so on specified with hyphens
33
	var hyphenStuff = [
34
		"module",
35
		"export",
36
		"import",
37
		"compile",
38
		"vsn",
39
		"on_load",
40
		"spec",
41
		"record",
42
		"include",
43
		"include_lib",
44
		"define",
45
		"file",
46
		"type",
47
		"opaque",
48
		"export_type",
49
		"undef",
50
		"ifdef",
51
		"ifndef",
52
		"else",
53
		"endif"
54
	];
55
56
	var signs = [
57
		"#",
58
		":",
59
		"::"
60
	];
61
62
	var grammars = mLib.grammars;
63
	grammars.push({
64
		id: "orion.erlang", //$NON-NLS-0$
65
		contentTypes: ["text/x-erlang"], //$NON-NLS-0$ // Connection to erlangPlugin.js
66
		patterns: [
67
			{include: "#comment"},
68
			{include: "#arrow"},
69
			{include: "orion.xq#variable"}, 
70
			{include: "orion.lib#string_doubleQuote"}, //$NON-NLS-0$
71
			{include: "orion.lib#string_singleQuote"}, //$NON-NLS-0$
72
			{include: "orion.lib#doc_block"}, //$NON-NLS-0$
73
			{include: "orion.lib#brace_open"}, //$NON-NLS-0$
74
			{include: "orion.lib#brace_close"}, //$NON-NLS-0$
75
			{include: "orion.lib#bracket_open"}, //$NON-NLS-0$
76
			{include: "orion.lib#bracket_close"}, //$NON-NLS-0$
77
			{include: "orion.lib#parenthesis_open"}, //$NON-NLS-0$
78
			{include: "orion.lib#parenthesis_close"}, //$NON-NLS-0$
79
			{include: "orion.lib#number_decimal"}, //$NON-NLS-0$
80
			{include: "orion.lib#number_hex"}, //$NON-NLS-0$
81
			{
82
				match: "\\b(?:" + keywords.join("|") + ")\\b", //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
83
				name: "keyword.control.erlang" //$NON-NLS-0$
84
			},
85
			{
86
				match: "-\\b(?:" + hyphenStuff.join("|") + ")\\b", //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
87
				name: "keyword.control.erlang" //$NON-NLS-0$
88
			},
89
			{
90
				match: signs.join("|"),
91
				name: "sign.erl"
92
			}
93
		],
94
		repository: {
95
			comment: {
96
				match: {match: "%.*", literal: "%"}, //$NON-NLS-1$ //$NON-NLS-0$
97
				name: "comment.line.erlang", //$NON-NLS-0$
98
				patterns: [
99
					{
100
						include: "orion.lib#todo_comment_singleLine" //$NON-NLS-0$
101
					}
102
				]
103
			},
104
			arrow: {
105
				match: "->|=>", //$NON-NLS-0$
106
				name: "arrow.erl" //$NON-NLS-0$
107
			},
108
			method: {
109
				match: "[a-zA-Z0-9_.]+(?=\\(|\\s\\()",
110
			    name: "method.erl"
111
			}
112
		}
113
114
	});
115
	return {
116
		id: grammars[grammars.length - 1].id,
117
		grammars: grammars,
118
		keywords: keywords
119
	};
120
});
(-)a/bundles/org.eclipse.orion.client.ui/web/defaults.pref (+1 lines)
Lines 13-18 Link Here
13
		"plugins/languages/arduino/arduinoPlugin.html":true,
13
		"plugins/languages/arduino/arduinoPlugin.html":true,
14
		"plugins/languages/c/cPlugin.html":true,
14
		"plugins/languages/c/cPlugin.html":true,
15
		"plugins/languages/cpp/cppPlugin.html":true,
15
		"plugins/languages/cpp/cppPlugin.html":true,
16
		"plugins/languages/erlang/erlangPlugin.html":true,
16
		"plugins/languages/java/javaPlugin.html":true,
17
		"plugins/languages/java/javaPlugin.html":true,
17
		"plugins/languages/lua/luaPlugin.html":true,
18
		"plugins/languages/lua/luaPlugin.html":true,
18
		"plugins/languages/php/phpPlugin.html":true,
19
		"plugins/languages/php/phpPlugin.html":true,
(-)a/bundles/org.eclipse.orion.client.ui/web/plugins/languages/erl/erlPlugin.html (-62 lines)
Lines 1-62 Link Here
1
<!DOCTYPE html>
2
<html>
3
<head>
4
	<meta charset="UTF-8">
5
    <meta name="copyright" content="Copyright (c) IBM Corporation and others 2014.">
6
    <title>Orion XQuery Support</title>
7
    <link rel="stylesheet" type="text/css" href="/settings/settings.css"/>
8
	<script src="../../../requirejs/require.js"></script>
9
	<script type="text/javascript">
10
		/*global require*/
11
		require({
12
			baseUrl: '../../../',
13
			paths: {
14
				text: 'requirejs/text',
15
				i18n: 'requirejs/i18n',
16
				domReady: 'requirejs/domReady'
17
			},
18
			packages: [
19
			]
20
		});
21
		require(["erlPlugin.js"]);
22
	</script>
23
</head>
24
25
<body id="orion-settings" class="orionPage" style="padding: 10px;">
26
	<h2>XQ Tools Support</h2>
27
	<p>
28
		This plugin provides XQ tooling, including:
29
	</p>
30
	<ul>
31
		<li><em>Editing</em> - an editor with syntax highlighting</li>
32
	</ul>
33
	<p>October 16, 2013</p>	
34
	
35
	<div class="split-selection-table">
36
	<div class="sectionWrapper toolComposite" style="margin: 15px 30px 0px 15px; max-width: 600px;">
37
		<div class="sectionAnchor sectionTitle layoutLeft">
38
			License
39
		</div>
40
	</div>
41
	<div class="sections sectionTable" style="margin: 0px 30px 0px 15px; padding-left: 6px; padding-right: 6px; max-width: 600px;">
42
		<p>
43
		The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
44
		indicated below, the Content is provided to you under the terms and conditions of the
45
		<a href="http://www.eclipse.org/legal/epl-v10.html">Eclipse Public License Version 1.0</a>
46
		(&quot;EPL&quot;), and the <a href="http://www.eclipse.org/org/documents/edl-v10.html">
47
		Eclipse Distribution License Version 1.0</a> (&quot;EDL&quot;).
48
		For purposes of the EPL and EDL, &quot;Program&quot; will mean the Content.
49
		</p>
50
		
51
		<p>
52
		If you did not receive this Content directly from the Eclipse Foundation, the Content is 
53
		being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
54
		apply to your use of any object code in the Content.  Check the Redistributor's license that was 
55
		provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
56
		indicated below, the terms and conditions of the EPL still apply to any source code in the Content
57
		and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.
58
		</p>
59
	</div>
60
	</div>
61
</body>	
62
</html>
(-)a/bundles/org.eclipse.orion.client.ui/web/plugins/languages/erl/erlPlugin.js (-43 lines)
Lines 1-43 Link Here
1
/*******************************************************************************
2
 * @license
3
 * Copyright (c) 2014 IBM Corporation and others.
4
 * All rights reserved. This program and the accompanying materials are made 
5
 * available under the terms of the Eclipse Public License v1.0 
6
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
7
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
8
 *
9
 * Contributors:
10
 *     IBM Corporation - initial API and implementation
11
 *******************************************************************************/
12
/*global esprima*/
13
/*jslint amd:true*/
14
define(['orion/plugin', 'orion/editor/stylers/application_erl/syntax'], function(PluginProvider, mERL) {	
15
	/**
16
	 * Plug-in headers
17
	 */
18
	var headers = {
19
		name: "Orion Erlang Tool Support",
20
		version: "1.0",
21
		description: "This plugin provides Erlang tools support for Orion."
22
	};
23
	var provider = new PluginProvider(headers);
24
25
	/**
26
	 * Register the XQuery content types
27
	 */
28
	provider.registerServiceProvider("orion.core.contenttype", {}, {
29
		contentTypes: [
30
			{	id: "application/erl",
31
				"extends": "text/plain",
32
				name: "ERL",
33
				extension: ["erl"]
34
			}
35
		] 
36
	});
37
38
	/**
39
	 * Register syntax styling
40
	 */
41
	provider.registerServiceProvider("orion.edit.highlighter", {}, mERL.grammars[mERL.grammars.length - 1]);
42
	provider.connect();
43
});
(-)a/bundles/org.eclipse.orion.client.ui/web/plugins/languages/erlang/erlangPlugin.html (+62 lines)
Added Link Here
1
<!DOCTYPE html>
2
<html>
3
<head>
4
	<meta charset="UTF-8">
5
    <meta name="copyright" content="Copyright (c) IBM Corporation and others 2014.">
6
    <title>Orion Erlang Support</title>
7
    <link rel="stylesheet" type="text/css" href="/settings/settings.css"/>
8
	<script src="../../../requirejs/require.js"></script>
9
	<script type="text/javascript">
10
		/*global require*/
11
		require({
12
			baseUrl: '../../../',
13
			paths: {
14
				text: 'requirejs/text',
15
				i18n: 'requirejs/i18n',
16
				domReady: 'requirejs/domReady'
17
			},
18
			packages: [
19
			]
20
		});
21
		require(["erlangPlugin.js"]);
22
	</script>
23
</head>
24
25
<body id="orion-settings" class="orionPage" style="padding: 10px;">
26
	<h2>Erlang Tools Support</h2>
27
	<p>
28
		This plugin provides Erlang tooling, including:
29
	</p>
30
	<ul>
31
		<li><em>Editing</em> - an editor with syntax highlighting</li>
32
	</ul>
33
	<p>October 16, 2013</p>	
34
	
35
	<div class="split-selection-table">
36
	<div class="sectionWrapper toolComposite" style="margin: 15px 30px 0px 15px; max-width: 600px;">
37
		<div class="sectionAnchor sectionTitle layoutLeft">
38
			License
39
		</div>
40
	</div>
41
	<div class="sections sectionTable" style="margin: 0px 30px 0px 15px; padding-left: 6px; padding-right: 6px; max-width: 600px;">
42
		<p>
43
		The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).  Unless otherwise 
44
		indicated below, the Content is provided to you under the terms and conditions of the
45
		<a href="http://www.eclipse.org/legal/epl-v10.html">Eclipse Public License Version 1.0</a>
46
		(&quot;EPL&quot;), and the <a href="http://www.eclipse.org/org/documents/edl-v10.html">
47
		Eclipse Distribution License Version 1.0</a> (&quot;EDL&quot;).
48
		For purposes of the EPL and EDL, &quot;Program&quot; will mean the Content.
49
		</p>
50
		
51
		<p>
52
		If you did not receive this Content directly from the Eclipse Foundation, the Content is 
53
		being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
54
		apply to your use of any object code in the Content.  Check the Redistributor's license that was 
55
		provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
56
		indicated below, the terms and conditions of the EPL still apply to any source code in the Content
57
		and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.
58
		</p>
59
	</div>
60
	</div>
61
</body>	
62
</html>
(-)a/bundles/org.eclipse.orion.client.ui/web/plugins/languages/erlang/erlangPlugin.js (+43 lines)
Added Link Here
1
/*******************************************************************************
2
 * @license
3
 * Copyright (c) 2014 IBM Corporation and others.
4
 * All rights reserved. This program and the accompanying materials are made 
5
 * available under the terms of the Eclipse Public License v1.0 
6
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
7
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
8
 *
9
 * Contributors:
10
 *     IBM Corporation - initial API and implementation
11
 *******************************************************************************/
12
/*global esprima*/
13
/*jslint amd:true*/
14
define(['orion/plugin', 'orion/editor/stylers/text_x-erlang/syntax'], function(PluginProvider, mErlang) {	
15
	/**
16
	 * Plug-in headers
17
	 */
18
	var headers = {
19
		name: "Orion Erlang Tool Support",
20
		version: "1.0",
21
		description: "This plugin provides Erlang tools support for Orion."
22
	};
23
	var provider = new PluginProvider(headers);
24
25
	/**
26
	 * Register the XQuery content types
27
	 */
28
	provider.registerServiceProvider("orion.core.contenttype", {}, {
29
		contentTypes: [
30
			{	id: "text/x-erlang",
31
				"extends": "text/plain",
32
				name: "Erlang",
33
				extension: ["erl", "hrl"]
34
			}
35
		] 
36
	});
37
38
	/**
39
	 * Register syntax styling
40
	 */
41
	provider.registerServiceProvider("orion.edit.highlighter", {}, mErlang.grammars[mErlang.grammars.length - 1]);
42
	provider.connect();
43
});
(-)a/modules/orionode/lib/orionode.client/defaults.pref (+1 lines)
Lines 8-13 Link Here
8
		"plugins/languages/arduino/arduinoPlugin.html":true,
8
		"plugins/languages/arduino/arduinoPlugin.html":true,
9
		"plugins/languages/c/cPlugin.html":true,
9
		"plugins/languages/c/cPlugin.html":true,
10
		"plugins/languages/cpp/cppPlugin.html":true,
10
		"plugins/languages/cpp/cppPlugin.html":true,
11
		"plugins/languages/erlang/erlangPlugin.html":true,
11
		"plugins/languages/java/javaPlugin.html":true,
12
		"plugins/languages/java/javaPlugin.html":true,
12
		"plugins/languages/lua/luaPlugin.html":true,
13
		"plugins/languages/lua/luaPlugin.html":true,
13
		"plugins/languages/php/phpPlugin.html":true,
14
		"plugins/languages/php/phpPlugin.html":true,

Return to bug 434029