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

Commit

Permalink
Merge pull request #3322 from adobe/pflynn/quickopen-deprecation-noise
Browse files Browse the repository at this point in the history
Allow Quick Open plugins to specify both fileTypes and languageIds
  • Loading branch information
DennisKehrig committed Apr 4, 2013
2 parents d81450b + 7871704 commit 5fdee03
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/search/QuickOpen.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ define(function (require, exports, module) {
* cancels Quick Open (via Esc), those changes are automatically reverted.
*/
function addQuickOpenPlugin(pluginDef) {
if (pluginDef.fileTypes) {
// Backwards compatibility (for now) for old fileTypes field, if newer languageIds not specified
if (pluginDef.fileTypes && !pluginDef.languageIds) {
console.warn("Using fileTypes for QuickOpen plugins is deprecated. Use languageIds instead.");
pluginDef.languageIds = pluginDef.fileTypes.map(function (extension) {
return LanguageManager.getLanguageForPath("file." + extension).getId();
Expand Down Expand Up @@ -543,8 +544,8 @@ define(function (require, exports, module) {
var i;
for (i = 0; i < plugins.length; i++) {
var plugin = plugins[i];
var LanguageIdMatch = plugin.languageIds.indexOf(languageId) !== -1 || plugin.languageIds.length === 0;
if (LanguageIdMatch && plugin.match && plugin.match(query)) {
var languageIdMatch = plugin.languageIds.indexOf(languageId) !== -1 || plugin.languageIds.length === 0;
if (languageIdMatch && plugin.match && plugin.match(query)) {
currentPlugin = plugin;

// Look up the StringMatcher for this plugin.
Expand Down

0 comments on commit 5fdee03

Please sign in to comment.