Skip to content

Commit

Permalink
Merge pull request #23 from replit/th-update-to-1.1.328
Browse files Browse the repository at this point in the history
Update to 1.1.328 -> 2.0.6
  • Loading branch information
airportyh authored Sep 20, 2023
2 parents b4380e9 + 7b96921 commit 1c35349
Show file tree
Hide file tree
Showing 241 changed files with 4,113 additions and 1,892 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "1.1.325",
"version": "1.1.328",
"command": {
"version": {
"push": false,
Expand Down
4 changes: 2 additions & 2 deletions packages/pyright-internal/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/pyright-internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pyright-internal",
"displayName": "pyright",
"description": "Type checker for the Python language",
"version": "1.1.325",
"version": "1.1.328",
"license": "MIT",
"private": true,
"files": [
Expand Down
13 changes: 9 additions & 4 deletions packages/pyright-internal/src/analyzer/binder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1934,7 +1934,7 @@ export class Binder extends ParseTreeWalker {
loadSymbolsFromPath: true,
range: getEmptyRange(),
usesLocalName: false,
moduleName: this._fileInfo.moduleName,
moduleName: this._formatModuleName(node.module.nameParts),
isInExceptSuite: this._isInExceptSuite,
};

Expand All @@ -1961,7 +1961,7 @@ export class Binder extends ParseTreeWalker {
symbolName: importedName,
submoduleFallback,
range: convertTextRangeToRange(nameNode, this._fileInfo.lines),
moduleName: this._fileInfo.moduleName,
moduleName: this._formatModuleName(node.module.nameParts),
isInExceptSuite: this._isInExceptSuite,
isNativeLib: importInfo?.isNativeLib,
};
Expand Down Expand Up @@ -2336,6 +2336,11 @@ export class Binder extends ParseTreeWalker {
return true;
}

private _formatModuleName(nameParts: NameNode[]): string {
// Ignore the leading dots for purposes of module name formatting.
return nameParts.map((name) => name.value).join('.');
}

private _removeActiveTypeParameters(node: TypeParameterListNode) {
node.parameters.forEach((typeParamNode) => {
const entry = this._activeTypeParams.get(typeParamNode.name.value);
Expand Down Expand Up @@ -2539,7 +2544,7 @@ export class Binder extends ParseTreeWalker {
loadSymbolsFromPath: false,
range: getEmptyRange(),
usesLocalName: !!importAlias,
moduleName: firstNamePartValue,
moduleName: importAlias ? this._formatModuleName(node.module.nameParts) : firstNamePartValue,
firstNamePart: firstNamePartValue,
isInExceptSuite: this._isInExceptSuite,
};
Expand All @@ -2555,7 +2560,7 @@ export class Binder extends ParseTreeWalker {
range: getEmptyRange(),
usesLocalName: !!importAlias,
moduleName: importInfo?.importName ?? '',
firstNamePart: firstNamePartValue,
firstNamePart: importAlias ? this._formatModuleName(node.module.nameParts) : firstNamePartValue,
isUnresolved: true,
isInExceptSuite: this._isInExceptSuite,
};
Expand Down
Loading

0 comments on commit 1c35349

Please sign in to comment.