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 499665 | Differences between
and this patch

Collapse All | Expand All

(-)a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/load-rules-async.js (-41 / +157 lines)
Lines 2006-2053 define([ Link Here
2006
		},
2006
		},
2007
		/** @callback */
2007
		/** @callback */
2008
		"semi": function(context) {
2008
		"semi": function(context) {
2009
        		/**
2010
		         * @description Check the given node for a trailing semicolon
2011
		         * @param {Object} node The AST node
2012
		         */
2013
		        function checkForSemicolon(node) {
2014
    				var tokens = context.getTokens(node);
2015
    				var len = tokens.length;
2016
    				var t = tokens[len - 1];
2017
    				if (t && t.type === "Punctuator" && (t.value === ";" || t.value === '.')) {
2018
    					return;
2019
    				}
2020
    				context.report(node, ProblemMessages['semi'], null, t /* expose the bad token */);
2021
        		}
2022
        		/**
2023
		         * @description Check the variable decl node for trailing semicolon
2024
		         * @param {Object} node The AST node
2025
		         */
2026
		        function checkVariableDeclaration(node) {
2027
    				var ancestors = context.getAncestors(node),
2028
    				    parent = ancestors[ancestors.length - 1],
2029
    				    parentType = parent.type;
2030
    				if ((parentType === "ForStatement" && parent.init === node) || (parentType === "ForInStatement" && parent.left === node)
2031
    					|| parentType === "ForOfStatement" && parent.left === node) {
2032
    					// One of these cases, no semicolon token is required after the VariableDeclaration:
2033
    					// for(var x;;)
2034
    					// for(var x in y)
2035
    					// for(var x of n)
2036
    					return;
2037
    				}
2038
    				checkForSemicolon(node);
2039
        		}
2040
2009
2041
        		return {
2010
			var OPT_OUT_PATTERN = /[\[\(\/\+\-]/; // One of [(/+-
2042
        			"VariableDeclaration": checkVariableDeclaration,
2011
			var options = context.options[1];
2043
        			"ExpressionStatement": checkForSemicolon,
2012
			var never = context.options[0] === "never",
2044
        			"ReturnStatement": checkForSemicolon,
2013
				exceptOneLine = options && options.omitLastInOneLineBlock === true,
2045
        			"ThrowStatement": checkForSemicolon,
2014
				sourceCode = context.getSourceCode();
2046
        			"BreakStatement": checkForSemicolon,
2015
2047
        			"ContinueStatement": checkForSemicolon
2016
			//--------------------------------------------------------------------------
2048
        		};
2017
			// Helpers
2049
        },
2018
			//--------------------------------------------------------------------------
2050
        /** @callback */
2019
2020
			/**
2021
			 * Reports a semicolon error with appropriate location and message.
2022
			 * @param {ASTNode} node The node with an extra or missing semicolon.
2023
			 * @param {boolean} missing True if the semicolon is missing.
2024
			 * @returns {void}
2025
			 */
2026
			function report(node, missing) {
2027
				var message,
2028
					lastToken = sourceCode.getLastToken(node),
2029
					data = Object.create(null);
2030
2031
				if (!missing) {
2032
					message = ProblemMessages["semi-missing"];
2033
					data.kind = "missing";
2034
				} else {
2035
					message = ProblemMessages["semi-extra"];
2036
					data.kind = "extra";
2037
				}
2038
2039
				context.report(node, message, {data: data}, lastToken);
2040
			}
2041
			/**
2042
			 * Checks whether a token is a semicolon punctuator.
2043
			 * @param {Token} token The token.
2044
			 * @returns {boolean} True if token is a semicolon punctuator.
2045
			 */
2046
			function isSemicolon(token) {
2047
				return token.type === "Punctuator" && token.value === ";";
2048
			}
2049
2050
			/**
2051
			 * Check if a semicolon is unnecessary, only true if:
2052
			 *   - next token is on a new line and is not one of the opt-out tokens
2053
			 *   - next token is a valid statement divider
2054
			 * @param {Token} lastToken last token of current node.
2055
			 * @returns {boolean} whether the semicolon is unnecessary.
2056
			 */
2057
			function isUnnecessarySemicolon(lastToken) {
2058
				var isDivider, isOptOutToken, lastTokenLine, nextToken, nextTokenLine;
2059
2060
				if (!isSemicolon(lastToken)) {
2061
					return false;
2062
				}
2063
2064
				nextToken = sourceCode.getTokenAfter(lastToken);
2065
2066
				if (!nextToken) {
2067
					return true;
2068
				}
2069
2070
				lastTokenLine = lastToken.loc.end.line;
2071
				nextTokenLine = nextToken.loc.start.line;
2072
				isOptOutToken = OPT_OUT_PATTERN.test(nextToken.value);
2073
				isDivider = nextToken.value === "}" || nextToken.value === ";";
2074
2075
				return (lastTokenLine !== nextTokenLine && !isOptOutToken) || isDivider;
2076
			}
2077
2078
			/**
2079
			 * Checks a node to see if it's in a one-liner block statement.
2080
			 * @param {ASTNode} node The node to check.
2081
			 * @returns {boolean} whether the node is in a one-liner block statement.
2082
			 */
2083
			function isOneLinerBlock(node) {
2084
				var nextToken = sourceCode.getTokenAfter(node);
2085
2086
				if (!nextToken || nextToken.value !== "}") {
2087
					return false;
2088
				}
2089
2090
				var parent = node.parent;
2091
2092
				return parent && parent.type === "BlockStatement" &&
2093
					parent.loc.start.line === parent.loc.end.line;
2094
			}
2095
2096
			/**
2097
			 * Checks a node to see if it's followed by a semicolon.
2098
			 * @param {ASTNode} node The node to check.
2099
			 * @returns {void}
2100
			 */
2101
			function checkForSemicolon(node) {
2102
				var lastToken = sourceCode.getLastToken(node);
2103
2104
				if (never) {
2105
					if (isUnnecessarySemicolon(lastToken)) {
2106
						report(node, true);
2107
					}
2108
				} else {
2109
					if (!isSemicolon(lastToken)) {
2110
						if (!exceptOneLine || !isOneLinerBlock(node)) {
2111
							report(node);
2112
						}
2113
					} else {
2114
						if (exceptOneLine && isOneLinerBlock(node)) {
2115
							report(node, true);
2116
						}
2117
					}
2118
				}
2119
			}
2120
2121
			/**
2122
			 * Checks to see if there's a semicolon after a variable declaration.
2123
			 * @param {ASTNode} node The node to check.
2124
			 * @returns {void}
2125
			 */
2126
			function checkForSemicolonForVariableDeclaration(node) {
2127
				var ancestors = context.getAncestors(),
2128
					parentIndex = ancestors.length - 1,
2129
					parent = ancestors[parentIndex];
2130
2131
				if ((parent.type !== "ForStatement" || parent.init !== node) &&
2132
					(!/^For(?:In|Of)Statement/.test(parent.type) || parent.left !== node)
2133
				) {
2134
					checkForSemicolon(node);
2135
				}
2136
			}
2137
2138
			//--------------------------------------------------------------------------
2139
			// Public API
2140
			//--------------------------------------------------------------------------
2141
2142
			return {
2143
				VariableDeclaration: checkForSemicolonForVariableDeclaration,
2144
				ExpressionStatement: checkForSemicolon,
2145
				ReturnStatement: checkForSemicolon,
2146
				ThrowStatement: checkForSemicolon,
2147
				DoWhileStatement: checkForSemicolon,
2148
				DebuggerStatement: checkForSemicolon,
2149
				BreakStatement: checkForSemicolon,
2150
				ContinueStatement: checkForSemicolon,
2151
				ImportDeclaration: checkForSemicolon,
2152
				ExportAllDeclaration: checkForSemicolon,
2153
				ExportNamedDeclaration: function(node) {
2154
					if (!node.declaration) {
2155
						checkForSemicolon(node);
2156
					}
2157
				},
2158
				ExportDefaultDeclaration: function(node) {
2159
					if (!/(?:Class|Function)Declaration/.test(node.declaration.type)) {
2160
						checkForSemicolon(node);
2161
					}
2162
				}
2163
			};
2164
2165
		},
2166
		/** @callback */
2051
        "unknown-require": function(context) {
2167
        "unknown-require": function(context) {
2052
        	var directive;
2168
        	var directive;
2053
        	function checkDirective(node) {
2169
        	function checkDirective(node) {
(-)a/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/problems.js (-2 / +3 lines)
Lines 104-111 define({ Link Here
104
	'unknown-require-missing-env': 'The \'${0}\' entry is missing from the eslint-env directive',
104
	'unknown-require-missing-env': 'The \'${0}\' entry is missing from the eslint-env directive',
105
	'missing-requirejs': 'To use AMD, the \'requirejs\' plug-in needs to be running.',
105
	'missing-requirejs': 'To use AMD, the \'requirejs\' plug-in needs to be running.',
106
	'radix-description': 'Warn when parseInt() is called without the \'radix\' parameter.',
106
	'radix-description': 'Warn when parseInt() is called without the \'radix\' parameter.',
107
	'semi': 'Missing semicolon.',
107
	'semi-missing': 'Missing semicolon.',
108
	'semi-description': 'Warn about missing semicolons.',
108
	'semi-extra': 'Extra semicolon.',
109
	'semi-description': 'Warn about missing or extra semicolons.',
109
	'unnecessary-nls' : 'Unnecessary $NON-NLS$ tag.',
110
	'unnecessary-nls' : 'Unnecessary $NON-NLS$ tag.',
110
	'unnecessary-nls-description': 'Disallow unnecessary non-NLS comments.',
111
	'unnecessary-nls-description': 'Disallow unnecessary non-NLS comments.',
111
	'use-isnan': 'Use the isNaN function to compare with NaN.',
112
	'use-isnan': 'Use the isNaN function to compare with NaN.',
(-)a/bundles/org.eclipse.orion.client.javascript/web/javascript/ruleData.js (-1 / +1 lines)
Lines 86-92 define([ Link Here
86
			"no-with" : 1,
86
			"no-with" : 1,
87
			"quotes" : [1, "double", {avoidEscape: false, allowTemplateLiterals: false}],
87
			"quotes" : [1, "double", {avoidEscape: false, allowTemplateLiterals: false}],
88
			"radix" : 1,
88
			"radix" : 1,
89
			"semi" : 1,
89
			"semi" : [1, "always", {omitLastInOneLineBlock: false}],
90
			"type-checked-consistent-return" : 0,
90
			"type-checked-consistent-return" : 0,
91
			"unnecessary-nls" : 0,
91
			"unnecessary-nls" : 0,
92
			"unknown-require": 1,
92
			"unknown-require": 1,
(-)a/bundles/org.eclipse.orion.client.javascript/web/javascript/ternPlugins/quickfixes.js (-10 / +21 lines)
Lines 922-937 define([ Link Here
922
		 * @function 
922
		 * @function 
923
		 * @callback
923
		 * @callback
924
		 */
924
		 */
925
        "semi": function(annotation, annotations, file) {
925
		"semi": function(annotation, annotations, file) {
926
        	return applySingleFixToAll(annotations, function(annot){
926
			return applySingleFixToAll(annotations, function(annot) {
927
	            return {
927
				if (annot.data) {
928
	            	text: ';',
928
					switch (annot.data.kind) {
929
	            	start: annot.end,
929
						case 'missing':
930
	            	end: annot.end
930
							return {
931
	            };
931
								text: ';',
932
            });
932
								start: annot.end,
933
        },
933
								end: annot.end
934
        /** 
934
							};
935
						case 'extra':
936
							return {
937
								text: '',
938
								start: annot.start,
939
								end: annot.end
940
							};
941
					}
942
				}
943
			});
944
		},
945
		/** 
935
		 * @description fix for the 'unnecessary-nl' rule
946
		 * @description fix for the 'unnecessary-nl' rule
936
		 * @function 
947
		 * @function 
937
		 * @callback
948
		 * @callback
(-)a/bundles/org.eclipse.orion.client.javascript/web/javascript/nls/root/messages.js (-7 / +11 lines)
Lines 28-39 define({ Link Here
28
	'curlyFixName': 'Enclose statement in braces',
28
	'curlyFixName': 'Enclose statement in braces',
29
	'noCaller' : 'Discouraged \'arguments.caller\' or \'arguments.callee\' use:',
29
	'noCaller' : 'Discouraged \'arguments.caller\' or \'arguments.callee\' use:',
30
	'noCommaDangle' : 'Trailing commas in object expressions:',
30
	'noCommaDangle' : 'Trailing commas in object expressions:',
31
    'noCondAssign' : 'Assignments in conditional expressions:',
31
	'noCondAssign' : 'Assignments in conditional expressions:',
32
    'noConsole' : 'Discouraged console use in browser code:',
32
	'noConsole' : 'Discouraged console use in browser code:',
33
    'noConstantCondition' : 'Constant as conditional expression:',
33
	'noConstantCondition' : 'Constant as conditional expression:',
34
    'noRegexSpaces' : 'Multiple spaces in regular expressions:',
34
	'noRegexSpaces' : 'Multiple spaces in regular expressions:',
35
    'noReservedKeys' : 'Reserved words used as property keys:',
35
	'noReservedKeys' : 'Reserved words used as property keys:',
36
    'noReservedKeysFixName': 'Surround key with quotes',
36
	'noReservedKeysFixName': 'Surround key with quotes',
37
	'noEqeqeq' : 'Discouraged \'==\' use:',
37
	'noEqeqeq' : 'Discouraged \'==\' use:',
38
	"unknownRequire": "Unknown required library:",
38
	"unknownRequire": "Unknown required library:",
39
	'noDebugger' : 'Discouraged \'debugger\' statement use:',
39
	'noDebugger' : 'Discouraged \'debugger\' statement use:',
Lines 68-73 define({ Link Here
68
	'noNewWrappersFixName': 'Remove \'new\' keyword',
68
	'noNewWrappersFixName': 'Remove \'new\' keyword',
69
	'noMixedSpacesAndTabs' : 'Mixed spaces and tabs:',
69
	'noMixedSpacesAndTabs' : 'Mixed spaces and tabs:',
70
	'missingSemi' : 'Missing semicolons:',
70
	'missingSemi' : 'Missing semicolons:',
71
	'missingSemiFineGrained' : 'Kinds:',
72
	'missingSemiOmitLastInOneLineBlock' : 'Omit the last semicolon in a one-line block:',
71
	'unusedVars' : 'Unused variables:',
73
	'unusedVars' : 'Unused variables:',
72
	'varRedecl' : 'Variable re-declarations:',
74
	'varRedecl' : 'Variable re-declarations:',
73
	'varShadow': 'Variable shadowing:',
75
	'varShadow': 'Variable shadowing:',
Lines 116-122 define({ Link Here
116
	'eqeqeqFixName': 'Update operator',
118
	'eqeqeqFixName': 'Update operator',
117
	'unreachableFixName': 'Remove unreachable code',
119
	'unreachableFixName': 'Remove unreachable code',
118
	'sparseArrayFixName': 'Convert to normal array',
120
	'sparseArrayFixName': 'Convert to normal array',
119
	'semiFixName': 'Add missing \';\'',
121
	'semiFixName': 'Add missing \';\' or remove extra \';\'',
120
	'unknownRequirePluginFixName': 'Update project settings',
122
	'unknownRequirePluginFixName': 'Update project settings',
121
	'radix': 'Missing radix parameter to parseInt():',
123
	'radix': 'Missing radix parameter to parseInt():',
122
	'radixFixName': 'Add default radix',
124
	'radixFixName': 'Add default radix',
Lines 183-188 define({ Link Here
183
	'backtickQuote' : 'backtick (`)',
185
	'backtickQuote' : 'backtick (`)',
184
	'quoteFixName' : 'Fix quotes',
186
	'quoteFixName' : 'Fix quotes',
185
	'yoda' : 'Require or disallow Yoda conditions:',
187
	'yoda' : 'Require or disallow Yoda conditions:',
188
	'always' : 'Always',
189
	'never' : 'Never',
186
	'yodaKind' : 'Kinds:',
190
	'yodaKind' : 'Kinds:',
187
	'yodaExceptRange' : 'Except for range comparisons:',
191
	'yodaExceptRange' : 'Except for range comparisons:',
188
	'yodaOnlyEquality' : 'Check only for \'==\' and \'===\' operators:',
192
	'yodaOnlyEquality' : 'Check only for \'==\' and \'===\' operators:',
(-)a/bundles/org.eclipse.orion.client.javascript/web/js-tests/javascript/validatorTests.js (-2 / +117 lines)
Lines 335-341 define([ Link Here
335
							{start: 43,
335
							{start: 43,
336
							 end: 44,
336
							 end: 44,
337
							 severity: 'warning',
337
							 severity: 'warning',
338
							 description: i18nUtil.formatMessage.call(null, messages['semi'], {})
338
							 description: i18nUtil.formatMessage.call(null, messages['semi-missing'], {})
339
							}
339
							}
340
						]);
340
						]);
341
					}, function (error) {
341
					}, function (error) {
Lines 10691-10696 define([ Link Here
10691
										id: RULE_ID,
10691
										id: RULE_ID,
10692
										severity: 'warning',
10692
										severity: 'warning',
10693
										description: "Missing semicolon.",
10693
										description: "Missing semicolon.",
10694
										nodeType: "VariableDeclaration"
10695
									},
10696
									{
10697
										id: RULE_ID,
10698
										severity: 'warning',
10699
										description: "Missing semicolon.",
10694
										nodeType: "ExpressionStatement"
10700
										nodeType: "ExpressionStatement"
10695
									}]);
10701
									}]);
10696
								},
10702
								},
Lines 11264-11269 define([ Link Here
11264
									worker.getTestState().callback(error);
11270
									worker.getTestState().callback(error);
11265
								});
11271
								});
11266
						});
11272
						});
11273
						it("should not flag missing semi when 'never' is used", function(callback) {
11274
							var topic = "var name = \"ESLint\"";
11275
							var config = { rules: {} };
11276
							config.rules[RULE_ID] = [2, "never"];
11277
							validate({buffer: topic, callback: callback, config: config}).then(
11278
								function (problems) {
11279
									assertProblems(problems, []);
11280
								},
11281
								function (error) {
11282
									worker.getTestState().callback(error);
11283
								});
11284
						});
11285
						it("should not flag missing semi when 'never' is used with omitLastInOneLineBlock = true", function(callback) {
11286
							var topic = "if (foo) { bar() }";
11287
							var config = { rules: {} };
11288
							config.rules[RULE_ID] = [2, "always", {omitLastInOneLineBlock: true}];
11289
							validate({buffer: topic, callback: callback, config: config}).then(
11290
								function (problems) {
11291
									assertProblems(problems, []);
11292
								},
11293
								function (error) {
11294
									worker.getTestState().callback(error);
11295
								});
11296
						});
11297
						it("should not flag missing semi when 'never' is used with omitLastInOneLineBlock = true 2", function(callback) {
11298
							var topic = "if (foo) { bar(); baz() }";
11299
							var config = { rules: {} };
11300
							config.rules[RULE_ID] = [2, "always", {omitLastInOneLineBlock: true}];
11301
							validate({buffer: topic, callback: callback, config: config}).then(
11302
								function (problems) {
11303
									assertProblems(problems, []);
11304
								},
11305
								function (error) {
11306
									worker.getTestState().callback(error);
11307
								});
11308
						});
11309
						it("should flag missing semi when 'never' is used with omitLastInOneLineBlock = true", function(callback) {
11310
							var topic =
11311
								"if (foo) {\n" +
11312
								"    bar()\n" +
11313
								"}";
11314
							var config = { rules: {} };
11315
							config.rules[RULE_ID] = [2, "always", {omitLastInOneLineBlock: true}];
11316
							validate({buffer: topic, callback: callback, config: config}).then(
11317
								function (problems) {
11318
									assertProblems(problems, [
11319
									{
11320
										id: RULE_ID,
11321
										severity: 'error',
11322
										start: 19,
11323
										end: 20
11324
									}]);
11325
								},
11326
								function (error) {
11327
									worker.getTestState().callback(error);
11328
								});
11329
						});
11330
						it("should flag missing semi when 'never' is used with omitLastInOneLineBlock = true 2", function(callback) {
11331
							var topic =
11332
								"if (foo) { bar(); }";
11333
							var config = { rules: {} };
11334
							config.rules[RULE_ID] = [2, "always", {omitLastInOneLineBlock: true}];
11335
							validate({buffer: topic, callback: callback, config: config}).then(
11336
								function (problems) {
11337
									assertProblems(problems, [
11338
									{
11339
										id: RULE_ID,
11340
										severity: 'error',
11341
										start: 16,
11342
										end: 17
11343
									}]);
11344
								},
11345
								function (error) {
11346
									worker.getTestState().callback(error);
11347
								});
11348
						});
11349
						it("should flag semi when 'never' is set", function(callback) {
11350
							var topic = "if (foo) { bar(); }";
11351
							var config = { rules: {} };
11352
							config.rules[RULE_ID] = [2, "never"];
11353
							validate({buffer: topic, callback: callback, config: config}).then(
11354
								function (problems) {
11355
									assertProblems(problems, [
11356
									{
11357
										id: RULE_ID,
11358
										severity: 'error',
11359
										start: 16,
11360
										end: 17
11361
									}]);
11362
								},
11363
								function (error) {
11364
									worker.getTestState().callback(error);
11365
								});
11366
						});
11367
						it("should not flag semi when 'never' is set", function(callback) {
11368
							var topic = 
11369
								"var name = \"ESLint\"\n" +
11370
								";(function() {\n" +
11371
								"})()";
11372
							var config = { rules: {} };
11373
							config.rules[RULE_ID] = [2, "never"];
11374
							validate({buffer: topic, callback: callback, config: config}).then(
11375
								function (problems) {
11376
									assertProblems(problems, []);
11377
								},
11378
								function (error) {
11379
									worker.getTestState().callback(error);
11380
								});
11381
						});
11267
					});
11382
					});
11268
			
11383
			
11269
					//USE-ISNAN --------------------------------------------------------
11384
					//USE-ISNAN --------------------------------------------------------
Lines 13293-13299 define([ Link Here
13293
						it("flag invalid import/export", function(callback) {
13408
						it("flag invalid import/export", function(callback) {
13294
							var topic = "import * as test from \"./files/es_modules_dep1\"";
13409
							var topic = "import * as test from \"./files/es_modules_dep1\"";
13295
							var config = { rules: {} };
13410
							var config = { rules: {} };
13296
							config.rules[RULE_ID] = 2;
13411
							config.rules[RULE_ID] = [2, "never"];
13297
							var features = Object.create(null);
13412
							var features = Object.create(null);
13298
							features.modules = false;
13413
							features.modules = false;
13299
							config.ecmaFeatures = features;
13414
							config.ecmaFeatures = features;
(-)a/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/javascriptPlugin.js (-23 / +36 lines)
Lines 1465-1489 define([ Link Here
1465
    	 * ESLint settings
1465
    	 * ESLint settings
1466
    	 */
1466
    	 */
1467
    	var ignore = 0, warning = 1, error = 2, severities = [
1467
    	var ignore = 0, warning = 1, error = 2, severities = [
1468
    	                                                      {label: javascriptMessages.ignore,  value: ignore},
1468
    	                                                      {label: javascriptMessages['ignore'],  value: ignore},
1469
    	                                                      {label: javascriptMessages.warning, value: warning},
1469
    	                                                      {label: javascriptMessages['warning'], value: warning},
1470
    	                                                      {label: javascriptMessages.error,   value: error}
1470
    	                                                      {label: javascriptMessages['error'], value: error}
1471
    	                                                      ];
1471
    	                                                      ];
1472
    	                                                      
1472
    	                                                      
1473
		var doubleQuote = 'double';
1473
		var doubleQuote = 'double';
1474
		var singleQuote = 'single';
1474
		var singleQuote = 'single';
1475
		var backTick = 'backtick';
1475
		var backTick = 'backtick';
1476
		var quotes = [
1476
		var quotes = [
1477
			{ label: javascriptMessages.singleQuote, value: singleQuote },
1477
			{ label: javascriptMessages['singleQuote'], value: singleQuote },
1478
			{ label: javascriptMessages.doubleQuote, value: doubleQuote },
1478
			{ label: javascriptMessages['doubleQuote'], value: doubleQuote },
1479
			{ label: javascriptMessages.backtickQuote, value: backTick }
1479
			{ label: javascriptMessages['backtickQuote'], value: backTick }
1480
		];
1480
		];
1481
		
1481
		
1482
		var Never = 'never';
1482
		var Never = 'never';
1483
		var Always = 'always';
1483
		var Always = 'always';
1484
		var yodaKinds = [
1484
		var kinds = [
1485
			{ label: javascriptMessages.yodayAlways, value: Always },
1485
			{ label: javascriptMessages['always'], value: Always },
1486
			{ label: javascriptMessages.yodaNever, value: Never },
1486
			{ label: javascriptMessages['never'], value: Never },
1487
		];
1487
		];
1488
    	provider.registerService("orion.core.setting",  //$NON-NLS-1$
1488
    	provider.registerService("orion.core.setting",  //$NON-NLS-1$
1489
    			{},
1489
    			{},
Lines 1959-1965 define([ Link Here
1959
    			 	        	                	name: javascriptMessages["yodaKind"],
1959
    			 	        	                	name: javascriptMessages["yodaKind"],
1960
    			 	        	                	type: "string",  //$NON-NLS-1$
1960
    			 	        	                	type: "string",  //$NON-NLS-1$
1961
    			 	        	                	defaultValue: Never,
1961
    			 	        	                	defaultValue: Never,
1962
    			 	        	                	options: yodaKinds
1962
    			 	        	                	options: kinds
1963
    			 	        	                },
1963
    			 	        	                },
1964
 				 	        	            	{
1964
 				 	        	            	{
1965
	 				 	        	            	id: "yoda:exceptRange",  //$NON-NLS-1$
1965
	 				 	        	            	id: "yoda:exceptRange",  //$NON-NLS-1$
Lines 2057-2062 define([ Link Here
2057
				 	        	                	defaultValue: warning,
2057
				 	        	                	defaultValue: warning,
2058
				 	        	                	options: severities
2058
				 	        	                	options: severities
2059
				 	        	                },
2059
				 	        	                },
2060
				 	        	                {	id: "semi!1",  //$NON-NLS-1$
2061
				 	        	                	dependsOn: "semi",
2062
				 	        	                	name: javascriptMessages["missingSemiFineGrained"],
2063
				 	        	                	type: "string",  //$NON-NLS-1$
2064
				 	        	                	defaultValue: Always,
2065
				 	        	                	options: kinds
2066
				 	        	                },
2067
				 	        	                {	id: "semi:omitLastInOneLineBlock",  //$NON-NLS-1$
2068
				 	        	                	dependsOn: "semi",
2069
				 	        	                	name: javascriptMessages["missingSemiOmitLastInOneLineBlock"],
2070
				 	        	                	type: "boolean",  //$NON-NLS-1$
2071
				 	        	                	defaultValue: false
2072
				 	        	                },
2060
				 	        	                {	id: "no-mixed-spaces-and-tabs",  //$NON-NLS-1$
2073
				 	        	                {	id: "no-mixed-spaces-and-tabs",  //$NON-NLS-1$
2061
				 	        	                	name: javascriptMessages["noMixedSpacesAndTabs"],
2074
				 	        	                	name: javascriptMessages["noMixedSpacesAndTabs"],
2062
				 	        	                	type: "number",  //$NON-NLS-1$
2075
				 	        	                	type: "number",  //$NON-NLS-1$
Lines 2126-2150 define([ Link Here
2126
		var mac = "\r";
2139
		var mac = "\r";
2127
		var windows = "\n\r";
2140
		var windows = "\n\r";
2128
		var eof_characters = [
2141
		var eof_characters = [
2129
			{label: javascriptMessages.indentation_unix,  value: unix},
2142
			{label: javascriptMessages['indentation_unix'],  value: unix},
2130
			{label: javascriptMessages.indentation_mac, value: mac},
2143
			{label: javascriptMessages['indentation_mac'], value: mac},
2131
			{label: javascriptMessages.indentation_windows, value: windows}
2144
			{label: javascriptMessages['indentation_windows'], value: windows}
2132
		];
2145
		];
2133
2146
2134
		var space = ' ';
2147
		var space = ' ';
2135
		var tab= '\t';
2148
		var tab= '\t';
2136
		var indentation_characters = [
2149
		var indentation_characters = [
2137
			{label: javascriptMessages.indentation_space,  value: space},
2150
			{label: javascriptMessages['indentation_space'],  value: space},
2138
			{label: javascriptMessages.indentation_tab,  value: tab},
2151
			{label: javascriptMessages['indentation_tab'],  value: tab},
2139
		];
2152
		];
2140
		
2153
		
2141
		var before_newline = 'before-newline';
2154
		var before_newline = 'before-newline';
2142
		var after_newline = 'after-newline';
2155
		var after_newline = 'after-newline';
2143
		var preserve_newline = 'preserve-newline';
2156
		var preserve_newline = 'preserve-newline';
2144
		var operator_positions = [
2157
		var operator_positions = [
2145
			{ label: javascriptMessages.before_newline, value: before_newline},
2158
			{ label: javascriptMessages['before_newline'], value: before_newline},
2146
			{ label: javascriptMessages.after_newline, value: after_newline},
2159
			{ label: javascriptMessages['after_newline'], value: after_newline},
2147
			{ label: javascriptMessages.preserve_newline, value: preserve_newline},
2160
			{ label: javascriptMessages['preserve_newline'], value: preserve_newline},
2148
		];
2161
		];
2149
		
2162
		
2150
		var collapse_preserve_inline = 'collapse-preserve-inline';
2163
		var collapse_preserve_inline = 'collapse-preserve-inline';
Lines 2153-2163 define([ Link Here
2153
		var end_expand = 'end-expand';
2166
		var end_expand = 'end-expand';
2154
		var none = 'none';
2167
		var none = 'none';
2155
		var brace_styles = [
2168
		var brace_styles = [
2156
			{ label: javascriptMessages.collapse_preserve_inline , value: collapse_preserve_inline},
2169
			{ label: javascriptMessages['collapse_preserve_inline'], value: collapse_preserve_inline},
2157
			{ label: javascriptMessages.collapse , value: collapse},
2170
			{ label: javascriptMessages['collapse'], value: collapse},
2158
			{ label: javascriptMessages.expand , value: expand},
2171
			{ label: javascriptMessages['expand'], value: expand},
2159
			{ label: javascriptMessages.end_expand , value: end_expand},
2172
			{ label: javascriptMessages['end_expand'], value: end_expand},
2160
			{ label: javascriptMessages.none , value: none},
2173
			{ label: javascriptMessages['none'], value: none},
2161
		];
2174
		];
2162
		provider.registerServiceProvider("orion.core.setting", {}, {
2175
		provider.registerServiceProvider("orion.core.setting", {}, {
2163
			settings: [
2176
			settings: [

Return to bug 499665