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

Pass a semicolon-delimited list of files excluded from VS Code. #2171

Merged
merged 8 commits into from
May 29, 2019
Merged
Show file tree
Hide file tree
Changes from 2 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
19 changes: 17 additions & 2 deletions src/omnisharp/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export class Options {
public useFormatting?: boolean,
public showReferencesCodeLens?: boolean,
public showTestsCodeLens?: boolean,
public disableCodeActions?: boolean) { }
public disableCodeActions?: boolean,
public excludedFiles?: string) { }

public static Read(): Options {
// Extra effort is taken below to ensure that legacy versions of options
Expand Down Expand Up @@ -59,6 +60,19 @@ export class Options {

const disableCodeActions = csharpConfig.get<boolean>('disableCodeActions', false);

let excludeFilesOption = vscode.workspace.getConfiguration().get<{[i: string] : boolean }>('files.exclude');
let excludeFilesString = "";
for (let field in excludeFilesOption)
{
if (excludeFilesOption[field])
{
excludeFilesString += field;
excludeFilesString += ";"
}
}

const excludedFiles = excludeFilesString;

return new Options(path,
useMono,
waitForDebugger,
Expand All @@ -70,6 +84,7 @@ export class Options {
useFormatting,
showReferencesCodeLens,
showTestsCodeLens,
disableCodeActions);
disableCodeActions,
excludedFiles);
}
}
2 changes: 2 additions & 0 deletions src/omnisharp/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ export class OmniSharpServer {
args.push('--debug');
}

args.push("--ignore", this._options.excludedFiles || "");

let launchPath: string;
if (this._options.path) {
try {
Expand Down