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 #6068 from adobe/dangoor/6067-reading-all-files
Browse files Browse the repository at this point in the history
Filter out dotfiles in code hints
  • Loading branch information
gruehle authored and jasonsanjose committed Dec 3, 2013
1 parent efbd1dc commit 8aff0b1
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/extensions/default/JavaScriptCodeHints/ScopeManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,20 @@ define(function (require, exports, module) {
* @return {boolean} true if excluded, false otherwise.
*/
function isFileExcluded(file) {
if (file.name[0] === ".") {
return true;
}

var languageID = LanguageManager.getLanguageForPath(file.fullPath).getId();
if (languageID !== HintUtils.LANGUAGE_ID) {
return true;
}

var excludes = preferences.getExcludedFiles();

if (!excludes) {
return false;
}

return excludes.test(file.name);
}

Expand Down Expand Up @@ -900,11 +908,8 @@ define(function (require, exports, module) {
FileSystem.resolve(dir, function (err, directory) {
function visitor(entry) {
if (entry.isFile) {
if (!isFileExcluded(entry) && entry.name.indexOf(".") !== 0) { // ignore .dotfiles
var languageID = LanguageManager.getLanguageForPath(entry.fullPath).getId();
if (languageID === HintUtils.LANGUAGE_ID) {
addFilesToTern([entry.fullPath]);
}
if (!isFileExcluded(entry)) { // ignore .dotfiles and non-.js files
addFilesToTern([entry.fullPath]);
}
} else {
return !isDirectoryExcluded(entry.fullPath) &&
Expand Down

0 comments on commit 8aff0b1

Please sign in to comment.