Skip to content

Commit a31a655

Browse files
committed
Merge branch 'name4' into alt
2 parents 9e0bdcf + 987dde1 commit a31a655

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

server/src/project/parser/vbaListener.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ export class VbaListener extends vbaListener {
376376
if (this.verbose) Services.logger.debug(`${source}: ${ctx.getText()}`, this.parserStateStack.length);
377377
const nameElement = this.parserState.nameElements.at(-1);
378378
if (!nameElement) {
379-
Services.logger.error(`Cannot add name ${ctx.getText()}`, this.parserStateStack.length);
379+
Services.logger.error(`Cannot add name ${ctx.getText()} in ${this.document.name}`, this.parserStateStack.length);
380380
return;
381381
}
382382

server/src/utils/helpers.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ export function walk(dirOrUri: string, pattern?: RegExp, files: Map<string, stri
5353
const logger = Services.logger;
5454
logger.debug(`Walking ${dirOrUri}`);
5555

56+
const excludedDirectories = new Set([
57+
'.git',
58+
'.svn',
59+
'node_modules',
60+
'.vscode',
61+
'.vs'
62+
]);
63+
5664
// Walk the contents of the directory.
5765
const dir = dirOrUri.toFilePath();
5866
for (const name of fs.readdirSync(dir)) {
@@ -63,6 +71,10 @@ export function walk(dirOrUri: string, pattern?: RegExp, files: Map<string, stri
6371
try { pIsDirectory = fs.statSync(p).isDirectory(); }
6472
catch (e) { logger.warn(`The OS threw an exception checking whether ${p} is a directory.`, 0, e); }
6573
if (pIsDirectory) {
74+
if (excludedDirectories.has(name) || name.startsWith('.')) {
75+
logger.debug(`Skipping excluded directory: ${p}`, 1);
76+
continue;
77+
}
6678
// Recursive call for directories.
6779
walk(p, pattern, files);
6880
} else if (pattern?.test(name) ?? true) {

0 commit comments

Comments
 (0)