Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit fb0183f

Browse files
committed
Address review comments.
- Rename 'preferredOnly' to 'usePreferredOnly'. - Get rid of 'firstOnly' altogether. - Fix tests.
1 parent 509417c commit fb0183f

3 files changed

Lines changed: 3 additions & 22 deletions

File tree

.brackets.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"language": {
1212
"javascript": {
1313
"linting.prefer": ["JSLint", "JSHint"],
14-
"linting.preferredOnly": true,
15-
"linting.firstOnly": false
14+
"linting.usePreferredOnly": true
1615
}
1716
},
1817
"path": {

src/language/CodeInspection.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ define(function (require, exports, module) {
7979
PREF_COLLAPSED = "collapsed",
8080
PREF_ASYNC_TIMEOUT = "asyncTimeout",
8181
PREF_PREFER_PROVIDERS = "prefer",
82-
PREF_PREFERRED_ONLY = "preferredOnly",
83-
PREF_FIRST_ONLY = "firstOnly";
82+
PREF_PREFERRED_ONLY = "usePreferredOnly";
8483

8584
var prefs = PreferencesManager.getExtensionPrefs("linting");
8685

@@ -171,7 +170,6 @@ define(function (require, exports, module) {
171170

172171
prefPreferredProviderNames = prefs.get(PREF_PREFER_PROVIDERS, context),
173172
prefPreferredOnly = prefs.get(PREF_PREFERRED_ONLY, context),
174-
prefFirstOnly = prefs.get(PREF_FIRST_ONLY, context),
175173

176174
providers;
177175

@@ -197,9 +195,6 @@ define(function (require, exports, module) {
197195
} else {
198196
providers = installedProviders;
199197
}
200-
if (prefFirstOnly === true) { // implies suppressing others
201-
return providers.slice(0, 1);
202-
}
203198
return providers;
204199
}
205200

@@ -676,7 +671,6 @@ define(function (require, exports, module) {
676671
exports._PREF_ASYNC_TIMEOUT = PREF_ASYNC_TIMEOUT;
677672
exports._PREF_PREFER_PROVIDERS = PREF_PREFER_PROVIDERS;
678673
exports._PREF_PREFERRED_ONLY = PREF_PREFERRED_ONLY;
679-
exports._PREF_FIRST_ONLY = PREF_FIRST_ONLY;
680674

681675
// Public API
682676
exports.register = register;

test/spec/CodeInspection-test.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -334,35 +334,23 @@ define(function (require, exports, module) {
334334
expect(providers).toNotBe(null);
335335
expect(_.pluck(providers, "name")).toEqual(["html5", "html1", "html2", "html3", "html4"]);
336336

337-
setAtLocation(CodeInspection._PREF_FIRST_ONLY, true);
338-
providers = CodeInspection.getProvidersForPath("index.html");
339-
expect(providers).toNotBe(null);
340-
expect(_.pluck(providers, "name")).toEqual(["html5"]);
341-
342337
setAtLocation(CodeInspection._PREF_PREFER_PROVIDERS, ["html19", "html100"]);
343-
setAtLocation(CodeInspection._PREF_FIRST_ONLY, true);
344338
providers = CodeInspection.getProvidersForPath("index.html");
345339
expect(providers).toNotBe(null);
346-
expect(_.pluck(providers, "name")).toEqual(["html1"]);
340+
expect(_.pluck(providers, "name")).toEqual(["html1", "html2", "html3", "html4", "html5"]);
347341

348342
setAtLocation(CodeInspection._PREF_PREFERRED_ONLY, true);
349343
providers = CodeInspection.getProvidersForPath("test.html");
350344
expect(providers).toEqual([]);
351345

352346
setAtLocation(CodeInspection._PREF_PREFER_PROVIDERS, ["html2", "html1"]);
353347
setAtLocation(CodeInspection._PREF_PREFERRED_ONLY, true);
354-
setAtLocation(CodeInspection._PREF_FIRST_ONLY, false);
355348
providers = CodeInspection.getProvidersForPath("c:/temp/another.html");
356349
expect(providers).toNotBe(null);
357350
expect(_.pluck(providers, "name")).toEqual(["html2", "html1"]);
358351

359352
setAtLocation(CodeInspection._PREF_PREFER_PROVIDERS, undefined);
360353
setAtLocation(CodeInspection._PREF_PREFERRED_ONLY, undefined);
361-
setAtLocation(CodeInspection._PREF_FIRST_ONLY, true);
362-
providers = CodeInspection.getProvidersForPath("test/index.html");
363-
expect(_.pluck(providers, "name")).toEqual(["html1"]);
364-
365-
setAtLocation(CodeInspection._PREF_FIRST_ONLY, undefined);
366354
providers = CodeInspection.getProvidersForPath("index.html");
367355
expect(providers).toNotBe(null);
368356
expect(_.pluck(providers, "name")).toEqual(["html1", "html2", "html3", "html4", "html5"]);

0 commit comments

Comments
 (0)