Fix typos

This commit is contained in:
Bruno P. Kinoshita 2019-03-24 17:06:26 +13:00
parent 4be74b54d2
commit a862c98c6f
17 changed files with 31 additions and 31 deletions

View File

@ -18,7 +18,7 @@ Pyright offers flexible configuration options specified in a JSON-formatted text
**venv** [string, optional]: Used in conjunction with the venvPath, specifies the virtual environment to use. Individual execution environments may override this setting.
**pythonVersion** [string, optional]: Specifies the verison of Python that will be used to execute the source code. The version should be specified as a string in the format "M.m" where M is the major version and m is the minor (e.g. `"3.0"` or `"3.6"`). If a version is provided, pyright will generate errors if the source code makes use of language features that are not supported in that version. It will also tailor its use of type stub files, which conditionalize type definitions based on the version.
**pythonVersion** [string, optional]: Specifies the version of Python that will be used to execute the source code. The version should be specified as a string in the format "M.m" where M is the major version and m is the minor (e.g. `"3.0"` or `"3.6"`). If a version is provided, pyright will generate errors if the source code makes use of language features that are not supported in that version. It will also tailor its use of type stub files, which conditionalize type definitions based on the version.
**pythonPlatform** [string, optional]: Specifies the target platform that will be used to execute the source code. Should be one of `"Windows"`, `"Darwin"` or `"Linux"`. If specified, pyright will tailor its use of type stub files, which conditionalize type definitions based on the platform.
@ -34,7 +34,7 @@ The following settings control pyright's diagnostic output (warnings or errors).
## Execution Environment Options
Pyright allows multiple “execution environments” to be defined for different portions of your source tree. For example, a subtree may be designed to run with a different PYTHON_PATH or a different version of the python interpeter than the rest of the source base.
Pyright allows multiple “execution environments” to be defined for different portions of your source tree. For example, a subtree may be designed to run with a different PYTHON_PATH or a different version of the python interpreter than the rest of the source base.
The following settings can be specified for each execution environment.

View File

@ -4,7 +4,7 @@
Pyright implements a [service](https://github.com/Microsoft/pyright/blob/master/server/src/analyzer/service.ts), a persistent in-memory singleton object that controls the order of analysis and provides an interface for the language server.
The service owns an instance of a [program](https://github.com/Microsoft/pyright/blob/master/server/src/analyzer/program.ts), which trakcs the configuration file and all of the source files that make up the source base that is to be analyzed. A source file can be added to a program if it is a) referenced by the config file, b) currently open in the editor, or c) imported directly or indirectly by another source file. The program object is responsible for setting up file system watchers and updating the program as files are added, deleted, or edited. The program is also responsible for prioritizing all phases of analysis for all files, favoring files that are open in the editor (and their import dependencies).
The service owns an instance of a [program](https://github.com/Microsoft/pyright/blob/master/server/src/analyzer/program.ts), which tracks the configuration file and all of the source files that make up the source base that is to be analyzed. A source file can be added to a program if it is a) referenced by the config file, b) currently open in the editor, or c) imported directly or indirectly by another source file. The program object is responsible for setting up file system watchers and updating the program as files are added, deleted, or edited. The program is also responsible for prioritizing all phases of analysis for all files, favoring files that are open in the editor (and their import dependencies).
The program tracks multiple [sourceFile](https://github.com/Microsoft/pyright/blob/master/server/src/analyzer/sourceFile.ts) objects. Each source file represents the contents of one Python source file on disk. It tracks the status of analysis for the file, including any intermediate or final results of the analysis and the diagnostics (errors and warnings) that result.

View File

@ -1,8 +1,8 @@
{
"name": "pyright",
"displayName": "Pyright",
"description": "VS Code language support and type checking for Python",
"version": "1.0.0",
"description": "VS Code language support and type checking for Python",
"version": "1.0.0",
"scripts": {
"postinstall": "cd server && npm install && cd ../client && npm install && cd ..",
"build": "npm run build:client && npm run build:server",

View File

@ -61,7 +61,7 @@ export class AnalyzerNodeInfo {
//---------------------------------------------------------------
// Cleans out all fields that are added by the anlyzer phases
// Cleans out all fields that are added by the analyzer phases
// (after the post-parse walker).
static cleanNodeAnalysisInfo(node: ParseNode) {
const analyzerNode = node as AnalyzerNodeInfo;

View File

@ -525,7 +525,7 @@ export class ExpressionEvaluator {
if (!(flags & MemberAccessFlags.SkipGetAttributeCheck)) {
// See if the class has a "__getattribute__" or "__getattr__" method.
// If so, aribrary members are supported.
// If so, arbitrary members are supported.
let getAttribMember = TypeUtils.lookUpClassMember(classType, '__getattribute__', false);
if (getAttribMember && getAttribMember.class) {
const isObjectClass = getAttribMember.class.isBuiltIn() &&
@ -1151,12 +1151,12 @@ export class ExpressionEvaluator {
private _createNamedTupleType(node: CallExpressionNode, includesTypes: boolean): ClassType {
let className = 'namedtuple';
if (node.arguments.length === 0) {
this._addError('Expected named tuple class name as firat parameter',
this._addError('Expected named tuple class name as first parameter',
node.leftExpression);
} else {
const nameArg = node.arguments[0];
if (nameArg.argumentCategory !== ArgumentCategory.Simple) {
this._addError('Expected named tuple class name as firat parameter',
this._addError('Expected named tuple class name as first parameter',
node.arguments[0].valueExpression);
} else if (nameArg.valueExpression instanceof StringNode) {
className = nameArg.valueExpression.getValue();
@ -1602,7 +1602,7 @@ export class ExpressionEvaluator {
// Specializes the specified (potentially generic) class type using
// the specified type arguments, reporting errors as appropriate.
// Returns the specialized type and a boolean indicating whether
// the type indiciates a class type (true) or an object type (false).
// the type indicates a class type (true) or an object type (false).
private _createSpecializeClassType(classType: ClassType, typeArgs: TypeResult[],
errorNode: ExpressionNode, flags: EvaluatorFlags): Type {

View File

@ -4,7 +4,7 @@
* Licensed under the MIT license.
* Author: Eric Traut
*
* A parse tree walker that's used immediatley after generating
* A parse tree walker that's used immediately after generating
* the parse tree, effectively as an extension of the parser.
* It does the following:
* Adds parent links to all parse tree nodes

View File

@ -5,7 +5,7 @@
* Author: Eric Traut
*
* Represents a symbolic scope and its defined symbols. Unlike
* a "Namesspace", a scope object tracks dynamic (runtime)
* a "Namespace", a scope object tracks dynamic (runtime)
* bindings between names types. The analyzer stores these types
* in the scope as it walks through the program, effective doing
* what the Python interpreter will do.

View File

@ -567,7 +567,7 @@ export abstract class SemanticAnalyzer extends ParseTreeWalker {
}
// Don't report unbound error in stub files, which support out-of-order
// delcarations of classes.
// declarations of classes.
if (isReallyUnbound && !this._fileInfo.isStubFile) {
this._addError(`'${ node.nameToken.value }' is not bound`, node.nameToken);
}

View File

@ -83,7 +83,7 @@ export class SourceFile {
private readonly _isCollectionsStubFile: boolean;
// Latest analysis job that has completed at least one phase
// of anlaysis.
// of analysis.
private _analysisJob: AnalysisJob = {
fileContentsVersion: -1,
nextPhaseToRun: AnalysisPhase.SemanticAnalysis,
@ -365,7 +365,7 @@ export class SourceFile {
this._diagnosticVersion++;
});
// Prepare for the next stage of the anlaysis.
// Prepare for the next stage of the analysis.
this._analysisJob.typeAnalysisPassNumber = 1;
this._analysisJob.isTypeAnalysisPassNeeded = true;
this._analysisJob.isTypeAnalysisFinalized = false;

View File

@ -67,7 +67,7 @@ export class TypeAnalyzer extends ParseTreeWalker {
// call analyze() until this returns false.
private _didAnalysisChange: boolean;
// Analysis verison is incremented each time an analyzer pass
// Analysis version is incremented each time an analyzer pass
// is performed. It allows the code to determine when cached
// type information needs to be regenerated because it was
// from a previous pass.

View File

@ -91,7 +91,7 @@ export class TruthyTypeConstraint extends TypeConstraint {
} else if (type instanceof NoneType) {
// TODO - we may want to return a "never" type in
// this case to indicate that the condition will
// always evalutate to false.
// always evaluate to false.
return NoneType.create();
}
} else {
@ -100,7 +100,7 @@ export class TruthyTypeConstraint extends TypeConstraint {
if (remainingTypes.length === 0) {
// TODO - we may want to return a "never" type in
// this case to indicate that the condition will
// always evalutate to false.
// always evaluate to false.
return NoneType.create();
} else {
return TypeUtils.combineTypesArray(remainingTypes);
@ -140,7 +140,7 @@ export class IsNoneTypeConstraint extends TypeConstraint {
if (remainingTypes.length === 0) {
// TODO - we may want to return a "never" type in
// this case to indicate that the condition will
// always evalutate to false.
// always evaluate to false.
return NoneType.create();
}
@ -149,7 +149,7 @@ export class IsNoneTypeConstraint extends TypeConstraint {
if (!this.isPositiveTest()) {
// TODO - we may want to return a "never" type in
// this case to indicate that the condition will
// always evalutate to false.
// always evaluate to false.
return NoneType.create();
}
}
@ -206,7 +206,7 @@ export class InstanceOfTypeConstraint extends TypeConstraint {
if (remainingTypes.length === 0) {
// TODO - we may want to return a "never" type in
// this case to indicate that the condition will
// always evalutate to false.
// always evaluate to false.
return NoneType.create();
}
@ -223,7 +223,7 @@ export class InstanceOfTypeConstraint extends TypeConstraint {
} else {
// TODO - we may want to return a "never" type in
// this case to indicate that the condition will
// always evalutate to false.
// always evaluate to false.
return NoneType.create();
}
}

View File

@ -95,7 +95,7 @@ export class TypeUtils {
if (srcType instanceof TypeVarType) {
// This should happen only if we have a bug and forgot to specialize
// the source type or the code being analyzed contains a bug where
// a return type uses a type var that is not referenced elswhere
// a return type uses a type var that is not referenced elsewhere
// in a function.
return false;
}
@ -606,7 +606,7 @@ export class TypeUtils {
}
// Looks up a member in a class using the multiple-inheritance rules
// defined by Python. For more detials, see this note on method resolution
// defined by Python. For more details, see this note on method resolution
// order: https://www.python.org/download/releases/2.3/mro/.
static lookUpClassMember(classType: Type, memberName: string,
includeInstanceFields = true, searchBaseClasses = true): ClassMember | undefined {

View File

@ -18,7 +18,7 @@ export enum TypeCategory {
// Name is not bound to a value of any type.
Unbound,
// Type exists but is not currenlty known by the
// Type exists but is not currently known by the
// type analyzer (e.g. there is no available typings file).
// Unknown types are treated the same as "Any" at analysis time.
Unknown,
@ -32,7 +32,7 @@ export enum TypeCategory {
// Immutable sequence of typed values.
Tuple,
// Callable type with typed intput parameters and return parameter.
// Callable type with typed input parameters and return parameter.
Function,
// Functions defined with @overload decorator in stub files that
@ -995,7 +995,7 @@ export class UnionType extends Type {
}
// The types do not have a particular order, so we need to
// do the comparison in an order-indepdendent manner.
// do the comparison in an order-independent manner.
return this._types.find(t => !type2.containsType(t)) === undefined;
}

View File

@ -5,7 +5,7 @@
* Author: Eric Traut
*
* A simple class that allows a caller to cancel an async operation.
* The async operation needs to cooperatively check for cancelation.
* The async operation needs to cooperatively check for cancellation.
*/
export class CancelError extends Error {

View File

@ -15,7 +15,7 @@ export class CommandLineOptions {
this.executionRoot = executionRoot;
}
// A list of file specs to include in the anlaysis. Can contain
// A list of file specs to include in the analysis. Can contain
// directories, in which case all "*.py" files within those directories
// are included.
fileSpecs: string[] = [];

View File

@ -8,7 +8,7 @@
* function or lambda). Note that only the the names are tracked here, not
* the values to which they are bound at runtime. By default, names declared
* within a scope (via a parameter, assignment, class, or function) have local
* binding. This default can be overriden through the use of a "global"
* binding. This default can be overridden through the use of a "global"
* or "nonlocal" statement, as long as that statement comes before an implied
* local binding within the block. It is an error condition for a name to have
* inconsistent bindings, and this module is used to detect that condition.

View File

@ -4,7 +4,7 @@
* Licensed under the MIT license.
* Author: Eric Traut
*
* Definition of parse nodes that make up the Python asbtract
* Definition of parse nodes that make up the Python abstract
* syntax tree (AST).
*/