diff --git a/docs/command-line.md b/docs/command-line.md index 80258ac65..695784261 100644 --- a/docs/command-line.md +++ b/docs/command-line.md @@ -7,6 +7,7 @@ Pyright can be run as either a VS Code extension or as a node-based command-line | --createstub IMPORT | Create type stub file(s) for import | | --dependencies | Emit import dependency information | | -h, --help | Show help message | +| --lib | Use library code for types when stubs are missing | | --outputjson | Output results in JSON format | | -p, --project FILE OR DIRECTORY | Use the configuration file at this location | | --stats | Print detailed performance stats | diff --git a/server/src/pyright.ts b/server/src/pyright.ts index c1cef4cd2..eda3a18b8 100644 --- a/server/src/pyright.ts +++ b/server/src/pyright.ts @@ -65,6 +65,7 @@ function processArgs() { { name: 'dependencies', type: Boolean }, { name: 'files', type: String, multiple: true, defaultOption: true }, { name: 'help', alias: 'h', type: Boolean }, + { name: 'lib', type: Boolean }, { name: 'outputjson', type: Boolean }, { name: 'project', alias: 'p', type: String }, { name: 'stats' }, @@ -143,7 +144,7 @@ function processArgs() { options.verboseOutput = !!args.verbose; options.checkOnlyOpenFiles = false; - options.useLibraryCodeForTypes = false; + options.useLibraryCodeForTypes = !!args.lib; const watch = args.watch !== undefined; options.watch = watch; @@ -230,6 +231,7 @@ function printUsage() { ' --createstub IMPORT Create type stub file(s) for import\n' + ' --dependencies Emit import dependency information\n' + ' -h,--help Show this help message\n' + + ' --lib Use library code to infer types when stubs are missing' + ' --outputjson Output results in JSON format\n' + ' -p,--project FILE OR DIRECTORY Use the configuration file at this location\n' + ' --stats Print detailed performance stats\n' +