Skip to content

Commit

Permalink
Fixed #141: The pyright VS Code extension will no longer automaticall…
Browse files Browse the repository at this point in the history
…y analyze all files under the project root if there is no config file found. The command-line version will still analyze all files present if no files or directories are specified.
  • Loading branch information
msfterictraut committed May 30, 2019
1 parent ff4c060 commit f8e7726
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions server/src/analyzer/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,10 @@ export class AnalyzerService {
configOptions.include.push(...commandLineOptions.fileSpecs);
} else if (!configFilePath) {
// If no config file was found and there are no explicit include
// paths specified, assume the caller wants to analyze everything
// under the execution root path.
if (commandLineOptions.executionRoot) {
// paths specified and this is the command-line version of the tool
// (versus the VS Code extension), assume the caller wants to analyze
// everything under the execution root path.
if (commandLineOptions.executionRoot && !commandLineOptions.fromVsCodeExtension) {
configOptions.include.push(commandLineOptions.executionRoot);
}
}
Expand All @@ -233,7 +234,7 @@ export class AnalyzerService {
}

const reportDuplicateSetting = (settingName: string) => {
const settingSource = commandLineOptions.fromVsCodeSettings ?
const settingSource = commandLineOptions.fromVsCodeExtension ?
'the VS Code settings' : 'a command-line option';
this._console.log(
`The ${ settingName } has been specified in both the config file and ` +
Expand Down
6 changes: 3 additions & 3 deletions server/src/common/commandLineOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

// Some options can be specified by command line.
export class CommandLineOptions {
constructor(executionRoot: string, fromVsCodeSettings: boolean) {
constructor(executionRoot: string, fromVsCodeExtension: boolean) {
this.executionRoot = executionRoot;
this.fromVsCodeSettings = fromVsCodeSettings;
this.fromVsCodeExtension = fromVsCodeExtension;
}

// A list of file specs to include in the analysis. Can contain
Expand Down Expand Up @@ -46,5 +46,5 @@ export class CommandLineOptions {
// Indicates that the settings came from VS Code rather than
// from the command-line. Useful for providing clearer error
// messages.
fromVsCodeSettings: boolean;
fromVsCodeExtension: boolean;
}

0 comments on commit f8e7726

Please sign in to comment.