Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加 lua文件的 正则方式 exclude 条件 #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/context/ExMgr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class EXMgr {
public static templateDir: string
public static templateDefine: Map<string, string>
public static excludes: Array<string>
public static excludesRegex: Array<string>
public static formatHex: boolean
public static enableDiagnostic: boolean
public static typescriptDefine: Map<string, string>
Expand Down Expand Up @@ -194,6 +195,14 @@ export class EXMgr {
EXMgr.excludes.push(path.normalize(path.join(vscode.workspace.rootPath, v)))
})
}
EXMgr.excludesRegex = new Array<string>()
var excludesRegexs: Array<string> = config.get<Array<string>>("excludesRegex");
if (excludesRegexs) {
excludesRegexs.forEach((v) => {
EXMgr.excludesRegex.push(v);
})
}


EXMgr.formatHex = config.get<boolean>("formatHex")
if (EXMgr.formatHex == null) {
Expand Down Expand Up @@ -231,7 +240,17 @@ export class EXMgr {
}
}
return false
} else {
}
else if (EXMgr.excludesRegex && EXMgr.excludesRegex.length > 0) {
for (var i = 0; i < EXMgr.excludesRegex.length; i++) {
var exclude = EXMgr.excludesRegex[i]
if (file.search(exclude) > -1) {
return true
}
}
return false
}
else {
return false
}
}
Expand Down