coc-pyright 1.1.395 → 1.1.398
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/index.js +859 -614
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -518,6 +518,7 @@ var require_core = __commonJS({
|
|
|
518
518
|
exports2.isDefined = isDefined;
|
|
519
519
|
exports2.getEnumNames = getEnumNames;
|
|
520
520
|
exports2.containsOnlyWhitespace = containsOnlyWhitespace;
|
|
521
|
+
exports2.cloneStr = cloneStr;
|
|
521
522
|
var textRange_1 = require_textRange();
|
|
522
523
|
var Comparison;
|
|
523
524
|
(function(Comparison2) {
|
|
@@ -606,6 +607,9 @@ var require_core = __commonJS({
|
|
|
606
607
|
}
|
|
607
608
|
return /^\s*$/.test(text);
|
|
608
609
|
}
|
|
610
|
+
function cloneStr(str) {
|
|
611
|
+
return Buffer.from(str, "utf8").toString("utf8");
|
|
612
|
+
}
|
|
609
613
|
var Disposable;
|
|
610
614
|
(function(Disposable2) {
|
|
611
615
|
function is(value) {
|
|
@@ -2155,6 +2159,7 @@ var require_serviceKeys = __commonJS({
|
|
|
2155
2159
|
ServiceKeys2.docStringService = new serviceProvider_1.ServiceKey();
|
|
2156
2160
|
ServiceKeys2.windowService = new serviceProvider_1.ServiceKey();
|
|
2157
2161
|
ServiceKeys2.commandService = new serviceProvider_1.ServiceKey();
|
|
2162
|
+
ServiceKeys2.cancellationProvider = new serviceProvider_1.ServiceKey();
|
|
2158
2163
|
})(ServiceKeys || (exports2.ServiceKeys = ServiceKeys = {}));
|
|
2159
2164
|
}
|
|
2160
2165
|
});
|
|
@@ -3201,6 +3206,7 @@ var require_diagnostic = __commonJS({
|
|
|
3201
3206
|
this.range = range;
|
|
3202
3207
|
this.priority = priority;
|
|
3203
3208
|
this._relatedInfo = [];
|
|
3209
|
+
this._data = null;
|
|
3204
3210
|
}
|
|
3205
3211
|
toJsonObj() {
|
|
3206
3212
|
return {
|
|
@@ -3210,6 +3216,7 @@ var require_diagnostic = __commonJS({
|
|
|
3210
3216
|
priority: this.priority,
|
|
3211
3217
|
actions: this._actions,
|
|
3212
3218
|
rule: this._rule,
|
|
3219
|
+
data: this._data,
|
|
3213
3220
|
relatedInfo: this._relatedInfo.map((info) => DiagnosticRelatedInfo.toJsonObj(info))
|
|
3214
3221
|
};
|
|
3215
3222
|
}
|
|
@@ -3218,6 +3225,7 @@ var require_diagnostic = __commonJS({
|
|
|
3218
3225
|
diag._actions = obj.actions;
|
|
3219
3226
|
diag._rule = obj.rule;
|
|
3220
3227
|
diag._relatedInfo = obj.relatedInfo.map((info) => DiagnosticRelatedInfo.fromJsonObj(info));
|
|
3228
|
+
diag._data = obj.data;
|
|
3221
3229
|
return diag;
|
|
3222
3230
|
}
|
|
3223
3231
|
addAction(action) {
|
|
@@ -3227,6 +3235,12 @@ var require_diagnostic = __commonJS({
|
|
|
3227
3235
|
this._actions.push(action);
|
|
3228
3236
|
}
|
|
3229
3237
|
}
|
|
3238
|
+
setData(data) {
|
|
3239
|
+
this._data = data;
|
|
3240
|
+
}
|
|
3241
|
+
getData() {
|
|
3242
|
+
return this._data;
|
|
3243
|
+
}
|
|
3230
3244
|
getActions() {
|
|
3231
3245
|
return this._actions;
|
|
3232
3246
|
}
|
|
@@ -12564,7 +12578,7 @@ var require_cancellationUtils = __commonJS({
|
|
|
12564
12578
|
"node_modules/@zzzen/pyright-internal/dist/common/cancellationUtils.js"(exports2) {
|
|
12565
12579
|
"use strict";
|
|
12566
12580
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
12567
|
-
exports2.CancellationThrottle = exports2.FileBasedToken = exports2.DefaultCancellationProvider = exports2.OperationCanceledException = void 0;
|
|
12581
|
+
exports2.CancellationThrottle = exports2.FileBasedToken = exports2.CancelledTokenId = exports2.DefaultCancellationProvider = exports2.OperationCanceledException = exports2.CancellationProvider = void 0;
|
|
12568
12582
|
exports2.getCancellationFolderName = getCancellationFolderName;
|
|
12569
12583
|
exports2.setCancellationFolderName = setCancellationFolderName;
|
|
12570
12584
|
exports2.invalidateTypeCacheIfCanceled = invalidateTypeCacheIfCanceled;
|
|
@@ -12579,6 +12593,13 @@ var require_cancellationUtils = __commonJS({
|
|
|
12579
12593
|
var vscode_languageserver_1 = require_api3();
|
|
12580
12594
|
var core_1 = require_core();
|
|
12581
12595
|
var uriUtils_1 = require_uriUtils();
|
|
12596
|
+
var CancellationProvider;
|
|
12597
|
+
(function(CancellationProvider2) {
|
|
12598
|
+
function is(value) {
|
|
12599
|
+
return value && !!value.createCancellationTokenSource;
|
|
12600
|
+
}
|
|
12601
|
+
CancellationProvider2.is = is;
|
|
12602
|
+
})(CancellationProvider || (exports2.CancellationProvider = CancellationProvider = {}));
|
|
12582
12603
|
var cancellationFolderName;
|
|
12583
12604
|
function getCancellationFolderName() {
|
|
12584
12605
|
return cancellationFolderName;
|
|
@@ -12654,7 +12675,11 @@ var require_cancellationUtils = __commonJS({
|
|
|
12654
12675
|
}
|
|
12655
12676
|
};
|
|
12656
12677
|
exports2.DefaultCancellationProvider = DefaultCancellationProvider;
|
|
12678
|
+
exports2.CancelledTokenId = "cancelled";
|
|
12657
12679
|
function getCancellationTokenId(token) {
|
|
12680
|
+
if (token === vscode_languageserver_1.CancellationToken.Cancelled) {
|
|
12681
|
+
return exports2.CancelledTokenId;
|
|
12682
|
+
}
|
|
12658
12683
|
return token instanceof FileBasedToken ? token.id : void 0;
|
|
12659
12684
|
}
|
|
12660
12685
|
var FileBasedToken = class {
|
|
@@ -15052,63 +15077,127 @@ var require_programTypes = __commonJS({
|
|
|
15052
15077
|
}
|
|
15053
15078
|
});
|
|
15054
15079
|
|
|
15055
|
-
// node_modules/@zzzen/pyright-internal/dist/
|
|
15056
|
-
var
|
|
15057
|
-
"node_modules/@zzzen/pyright-internal/dist/
|
|
15080
|
+
// node_modules/@zzzen/pyright-internal/dist/analyzer/pyTypedUtils.js
|
|
15081
|
+
var require_pyTypedUtils = __commonJS({
|
|
15082
|
+
"node_modules/@zzzen/pyright-internal/dist/analyzer/pyTypedUtils.js"(exports2) {
|
|
15058
15083
|
"use strict";
|
|
15059
15084
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15060
|
-
exports2.
|
|
15061
|
-
|
|
15062
|
-
(
|
|
15063
|
-
|
|
15064
|
-
|
|
15065
|
-
|
|
15066
|
-
FileSystem2.is = is;
|
|
15067
|
-
})(FileSystem || (exports2.FileSystem = FileSystem = {}));
|
|
15068
|
-
var TempFile;
|
|
15069
|
-
(function(TempFile2) {
|
|
15070
|
-
function is(value) {
|
|
15071
|
-
return value.tmpdir && value.tmpfile;
|
|
15085
|
+
exports2.getPyTypedInfo = getPyTypedInfo;
|
|
15086
|
+
exports2.getPyTypedInfoForPyTypedFile = getPyTypedInfoForPyTypedFile;
|
|
15087
|
+
var uriUtils_1 = require_uriUtils();
|
|
15088
|
+
function getPyTypedInfo(fileSystem, dirPath) {
|
|
15089
|
+
if (!fileSystem.existsSync(dirPath) || !(0, uriUtils_1.isDirectory)(fileSystem, dirPath)) {
|
|
15090
|
+
return void 0;
|
|
15072
15091
|
}
|
|
15073
|
-
|
|
15074
|
-
|
|
15075
|
-
|
|
15076
|
-
constructor(name, _file, parentPath) {
|
|
15077
|
-
this.name = name;
|
|
15078
|
-
this._file = _file;
|
|
15079
|
-
this.parentPath = parentPath;
|
|
15092
|
+
const pyTypedPath = dirPath.pytypedUri;
|
|
15093
|
+
if (!fileSystem.existsSync(pyTypedPath) || !(0, uriUtils_1.isFile)(fileSystem, pyTypedPath)) {
|
|
15094
|
+
return void 0;
|
|
15080
15095
|
}
|
|
15081
|
-
|
|
15082
|
-
|
|
15083
|
-
|
|
15084
|
-
|
|
15085
|
-
|
|
15086
|
-
|
|
15087
|
-
|
|
15096
|
+
return getPyTypedInfoForPyTypedFile(fileSystem, pyTypedPath);
|
|
15097
|
+
}
|
|
15098
|
+
function getPyTypedInfoForPyTypedFile(fileSystem, pyTypedPath) {
|
|
15099
|
+
let isPartiallyTyped = false;
|
|
15100
|
+
const fileStats = fileSystem.statSync(pyTypedPath);
|
|
15101
|
+
if (fileStats.size > 0 && fileStats.size < 64 * 1024) {
|
|
15102
|
+
const pyTypedContents = fileSystem.readFileSync(pyTypedPath, "utf8");
|
|
15103
|
+
if (pyTypedContents.match(/partial\n/) || pyTypedContents.match(/partial\r\n/)) {
|
|
15104
|
+
isPartiallyTyped = true;
|
|
15105
|
+
}
|
|
15088
15106
|
}
|
|
15089
|
-
|
|
15090
|
-
|
|
15107
|
+
return {
|
|
15108
|
+
pyTypedPath,
|
|
15109
|
+
isPartiallyTyped
|
|
15110
|
+
};
|
|
15111
|
+
}
|
|
15112
|
+
}
|
|
15113
|
+
});
|
|
15114
|
+
|
|
15115
|
+
// node_modules/@zzzen/pyright-internal/dist/partialStubService.js
|
|
15116
|
+
var require_partialStubService = __commonJS({
|
|
15117
|
+
"node_modules/@zzzen/pyright-internal/dist/partialStubService.js"(exports2) {
|
|
15118
|
+
"use strict";
|
|
15119
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15120
|
+
exports2.PartialStubService = exports2.SupportPartialStubs = void 0;
|
|
15121
|
+
var pyTypedUtils_1 = require_pyTypedUtils();
|
|
15122
|
+
var pathConsts_1 = require_pathConsts();
|
|
15123
|
+
var uriUtils_1 = require_uriUtils();
|
|
15124
|
+
var SupportPartialStubs;
|
|
15125
|
+
(function(SupportPartialStubs2) {
|
|
15126
|
+
function is(value) {
|
|
15127
|
+
return value.isPartialStubPackagesScanned && value.isPathScanned && value.processPartialStubPackages && value.clearPartialStubs;
|
|
15091
15128
|
}
|
|
15092
|
-
|
|
15093
|
-
|
|
15129
|
+
SupportPartialStubs2.is = is;
|
|
15130
|
+
})(SupportPartialStubs || (exports2.SupportPartialStubs = SupportPartialStubs = {}));
|
|
15131
|
+
var PartialStubService = class {
|
|
15132
|
+
constructor(_realFs) {
|
|
15133
|
+
this._realFs = _realFs;
|
|
15134
|
+
this._rootSearched = /* @__PURE__ */ new Set();
|
|
15135
|
+
this._partialStubPackagePaths = /* @__PURE__ */ new Set();
|
|
15136
|
+
this._movedDirectories = [];
|
|
15094
15137
|
}
|
|
15095
|
-
|
|
15096
|
-
return false;
|
|
15138
|
+
isPartialStubPackagesScanned(execEnv) {
|
|
15139
|
+
return execEnv.root ? this.isPathScanned(execEnv.root) : false;
|
|
15097
15140
|
}
|
|
15098
|
-
|
|
15099
|
-
return
|
|
15141
|
+
isPathScanned(uri) {
|
|
15142
|
+
return this._rootSearched.has(uri.key);
|
|
15100
15143
|
}
|
|
15101
|
-
|
|
15102
|
-
|
|
15144
|
+
processPartialStubPackages(paths, roots, bundledStubPath, allowMoving) {
|
|
15145
|
+
var _a;
|
|
15146
|
+
const allowMovingFn = allowMoving ?? this._allowMoving.bind(this);
|
|
15147
|
+
for (const path13 of paths) {
|
|
15148
|
+
this._rootSearched.add(path13.key);
|
|
15149
|
+
if (!this._realFs.existsSync(path13) || !(0, uriUtils_1.isDirectory)(this._realFs, path13)) {
|
|
15150
|
+
continue;
|
|
15151
|
+
}
|
|
15152
|
+
let dirEntries = [];
|
|
15153
|
+
try {
|
|
15154
|
+
dirEntries = this._realFs.readdirEntriesSync(path13);
|
|
15155
|
+
} catch {
|
|
15156
|
+
}
|
|
15157
|
+
const isBundledStub = path13.equals(bundledStubPath);
|
|
15158
|
+
for (const entry of dirEntries) {
|
|
15159
|
+
const partialStubPackagePath = path13.combinePaths(entry.name);
|
|
15160
|
+
const isDirectory = !entry.isSymbolicLink() ? entry.isDirectory() : !!((_a = (0, uriUtils_1.tryStat)(this._realFs, partialStubPackagePath)) == null ? void 0 : _a.isDirectory());
|
|
15161
|
+
if (!isDirectory || !entry.name.endsWith(pathConsts_1.stubsSuffix)) {
|
|
15162
|
+
continue;
|
|
15163
|
+
}
|
|
15164
|
+
const pyTypedInfo = (0, pyTypedUtils_1.getPyTypedInfo)(this._realFs, partialStubPackagePath);
|
|
15165
|
+
if (!pyTypedInfo || !pyTypedInfo.isPartiallyTyped) {
|
|
15166
|
+
continue;
|
|
15167
|
+
}
|
|
15168
|
+
this._partialStubPackagePaths.add(partialStubPackagePath.key);
|
|
15169
|
+
const packageName = entry.name.substr(0, entry.name.length - pathConsts_1.stubsSuffix.length);
|
|
15170
|
+
for (const root of roots) {
|
|
15171
|
+
const packagePath = root.combinePaths(packageName);
|
|
15172
|
+
try {
|
|
15173
|
+
const stat = (0, uriUtils_1.tryStat)(this._realFs, packagePath);
|
|
15174
|
+
if (!(stat == null ? void 0 : stat.isDirectory())) {
|
|
15175
|
+
continue;
|
|
15176
|
+
}
|
|
15177
|
+
if (!allowMovingFn(isBundledStub, (0, pyTypedUtils_1.getPyTypedInfo)(this._realFs, packagePath), pyTypedInfo)) {
|
|
15178
|
+
continue;
|
|
15179
|
+
}
|
|
15180
|
+
this._movedDirectories.push(this._realFs.mapDirectory(packagePath, partialStubPackagePath, (u, fs8) => u.hasExtension(".pyi") || fs8.existsSync(u) && fs8.statSync(u).isDirectory()));
|
|
15181
|
+
} catch {
|
|
15182
|
+
}
|
|
15183
|
+
}
|
|
15184
|
+
}
|
|
15185
|
+
}
|
|
15103
15186
|
}
|
|
15104
|
-
|
|
15105
|
-
|
|
15187
|
+
clearPartialStubs() {
|
|
15188
|
+
this._rootSearched.clear();
|
|
15189
|
+
this._partialStubPackagePaths.clear();
|
|
15190
|
+
this._movedDirectories.forEach((d) => d.dispose());
|
|
15191
|
+
this._movedDirectories = [];
|
|
15106
15192
|
}
|
|
15107
|
-
|
|
15108
|
-
|
|
15193
|
+
_allowMoving(isBundled, packagePyTyped, _stubPyTyped) {
|
|
15194
|
+
if (!isBundled) {
|
|
15195
|
+
return true;
|
|
15196
|
+
}
|
|
15197
|
+
return !packagePyTyped || packagePyTyped.isPartiallyTyped;
|
|
15109
15198
|
}
|
|
15110
15199
|
};
|
|
15111
|
-
exports2.
|
|
15200
|
+
exports2.PartialStubService = PartialStubService;
|
|
15112
15201
|
}
|
|
15113
15202
|
});
|
|
15114
15203
|
|
|
@@ -15831,6 +15920,66 @@ var require_docStringService = __commonJS({
|
|
|
15831
15920
|
}
|
|
15832
15921
|
});
|
|
15833
15922
|
|
|
15923
|
+
// node_modules/@zzzen/pyright-internal/dist/common/fileSystem.js
|
|
15924
|
+
var require_fileSystem = __commonJS({
|
|
15925
|
+
"node_modules/@zzzen/pyright-internal/dist/common/fileSystem.js"(exports2) {
|
|
15926
|
+
"use strict";
|
|
15927
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15928
|
+
exports2.VirtualDirent = exports2.TempFile = exports2.FileSystem = void 0;
|
|
15929
|
+
var FileSystem;
|
|
15930
|
+
(function(FileSystem2) {
|
|
15931
|
+
function is(value) {
|
|
15932
|
+
return value.createFileSystemWatcher && value.createReadStream && value.createWriteStream && value.copyFileSync;
|
|
15933
|
+
}
|
|
15934
|
+
FileSystem2.is = is;
|
|
15935
|
+
})(FileSystem || (exports2.FileSystem = FileSystem = {}));
|
|
15936
|
+
var TempFile;
|
|
15937
|
+
(function(TempFile2) {
|
|
15938
|
+
function is(value) {
|
|
15939
|
+
return value.tmpdir && value.tmpfile;
|
|
15940
|
+
}
|
|
15941
|
+
TempFile2.is = is;
|
|
15942
|
+
})(TempFile || (exports2.TempFile = TempFile = {}));
|
|
15943
|
+
var VirtualDirent = class {
|
|
15944
|
+
constructor(name, _file, parentPath) {
|
|
15945
|
+
this.name = name;
|
|
15946
|
+
this._file = _file;
|
|
15947
|
+
this.parentPath = parentPath;
|
|
15948
|
+
}
|
|
15949
|
+
/**
|
|
15950
|
+
* Alias for `dirent.parentPath`.
|
|
15951
|
+
* @since v20.1.0
|
|
15952
|
+
* @deprecated Since v20.12.0
|
|
15953
|
+
*/
|
|
15954
|
+
get path() {
|
|
15955
|
+
return this.parentPath;
|
|
15956
|
+
}
|
|
15957
|
+
isFile() {
|
|
15958
|
+
return this._file;
|
|
15959
|
+
}
|
|
15960
|
+
isDirectory() {
|
|
15961
|
+
return !this._file;
|
|
15962
|
+
}
|
|
15963
|
+
isBlockDevice() {
|
|
15964
|
+
return false;
|
|
15965
|
+
}
|
|
15966
|
+
isCharacterDevice() {
|
|
15967
|
+
return false;
|
|
15968
|
+
}
|
|
15969
|
+
isSymbolicLink() {
|
|
15970
|
+
return false;
|
|
15971
|
+
}
|
|
15972
|
+
isFIFO() {
|
|
15973
|
+
return false;
|
|
15974
|
+
}
|
|
15975
|
+
isSocket() {
|
|
15976
|
+
return false;
|
|
15977
|
+
}
|
|
15978
|
+
};
|
|
15979
|
+
exports2.VirtualDirent = VirtualDirent;
|
|
15980
|
+
}
|
|
15981
|
+
});
|
|
15982
|
+
|
|
15834
15983
|
// node_modules/@zzzen/pyright-internal/dist/common/languageServerInterface.js
|
|
15835
15984
|
var require_languageServerInterface = __commonJS({
|
|
15836
15985
|
"node_modules/@zzzen/pyright-internal/dist/common/languageServerInterface.js"(exports2) {
|
|
@@ -15861,158 +16010,6 @@ var require_languageServerInterface = __commonJS({
|
|
|
15861
16010
|
}
|
|
15862
16011
|
});
|
|
15863
16012
|
|
|
15864
|
-
// node_modules/@zzzen/pyright-internal/dist/analyzer/pyTypedUtils.js
|
|
15865
|
-
var require_pyTypedUtils = __commonJS({
|
|
15866
|
-
"node_modules/@zzzen/pyright-internal/dist/analyzer/pyTypedUtils.js"(exports2) {
|
|
15867
|
-
"use strict";
|
|
15868
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15869
|
-
exports2.getPyTypedInfo = getPyTypedInfo;
|
|
15870
|
-
exports2.getPyTypedInfoForPyTypedFile = getPyTypedInfoForPyTypedFile;
|
|
15871
|
-
var uriUtils_1 = require_uriUtils();
|
|
15872
|
-
function getPyTypedInfo(fileSystem, dirPath) {
|
|
15873
|
-
if (!fileSystem.existsSync(dirPath) || !(0, uriUtils_1.isDirectory)(fileSystem, dirPath)) {
|
|
15874
|
-
return void 0;
|
|
15875
|
-
}
|
|
15876
|
-
const pyTypedPath = dirPath.pytypedUri;
|
|
15877
|
-
if (!fileSystem.existsSync(pyTypedPath) || !(0, uriUtils_1.isFile)(fileSystem, pyTypedPath)) {
|
|
15878
|
-
return void 0;
|
|
15879
|
-
}
|
|
15880
|
-
return getPyTypedInfoForPyTypedFile(fileSystem, pyTypedPath);
|
|
15881
|
-
}
|
|
15882
|
-
function getPyTypedInfoForPyTypedFile(fileSystem, pyTypedPath) {
|
|
15883
|
-
let isPartiallyTyped = false;
|
|
15884
|
-
const fileStats = fileSystem.statSync(pyTypedPath);
|
|
15885
|
-
if (fileStats.size > 0 && fileStats.size < 64 * 1024) {
|
|
15886
|
-
const pyTypedContents = fileSystem.readFileSync(pyTypedPath, "utf8");
|
|
15887
|
-
if (pyTypedContents.match(/partial\n/) || pyTypedContents.match(/partial\r\n/)) {
|
|
15888
|
-
isPartiallyTyped = true;
|
|
15889
|
-
}
|
|
15890
|
-
}
|
|
15891
|
-
return {
|
|
15892
|
-
pyTypedPath,
|
|
15893
|
-
isPartiallyTyped
|
|
15894
|
-
};
|
|
15895
|
-
}
|
|
15896
|
-
}
|
|
15897
|
-
});
|
|
15898
|
-
|
|
15899
|
-
// node_modules/@zzzen/pyright-internal/dist/partialStubService.js
|
|
15900
|
-
var require_partialStubService = __commonJS({
|
|
15901
|
-
"node_modules/@zzzen/pyright-internal/dist/partialStubService.js"(exports2) {
|
|
15902
|
-
"use strict";
|
|
15903
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15904
|
-
exports2.PartialStubService = exports2.SupportPartialStubs = void 0;
|
|
15905
|
-
var pyTypedUtils_1 = require_pyTypedUtils();
|
|
15906
|
-
var pathConsts_1 = require_pathConsts();
|
|
15907
|
-
var uriUtils_1 = require_uriUtils();
|
|
15908
|
-
var SupportPartialStubs;
|
|
15909
|
-
(function(SupportPartialStubs2) {
|
|
15910
|
-
function is(value) {
|
|
15911
|
-
return value.isPartialStubPackagesScanned && value.isPathScanned && value.processPartialStubPackages && value.clearPartialStubs;
|
|
15912
|
-
}
|
|
15913
|
-
SupportPartialStubs2.is = is;
|
|
15914
|
-
})(SupportPartialStubs || (exports2.SupportPartialStubs = SupportPartialStubs = {}));
|
|
15915
|
-
var PartialStubService = class {
|
|
15916
|
-
constructor(_realFs) {
|
|
15917
|
-
this._realFs = _realFs;
|
|
15918
|
-
this._rootSearched = /* @__PURE__ */ new Set();
|
|
15919
|
-
this._partialStubPackagePaths = /* @__PURE__ */ new Set();
|
|
15920
|
-
this._movedDirectories = [];
|
|
15921
|
-
}
|
|
15922
|
-
isPartialStubPackagesScanned(execEnv) {
|
|
15923
|
-
return execEnv.root ? this.isPathScanned(execEnv.root) : false;
|
|
15924
|
-
}
|
|
15925
|
-
isPathScanned(uri) {
|
|
15926
|
-
return this._rootSearched.has(uri.key);
|
|
15927
|
-
}
|
|
15928
|
-
processPartialStubPackages(paths, roots, bundledStubPath, allowMoving) {
|
|
15929
|
-
var _a;
|
|
15930
|
-
const allowMovingFn = allowMoving ?? this._allowMoving.bind(this);
|
|
15931
|
-
for (const path13 of paths) {
|
|
15932
|
-
this._rootSearched.add(path13.key);
|
|
15933
|
-
if (!this._realFs.existsSync(path13) || !(0, uriUtils_1.isDirectory)(this._realFs, path13)) {
|
|
15934
|
-
continue;
|
|
15935
|
-
}
|
|
15936
|
-
let dirEntries = [];
|
|
15937
|
-
try {
|
|
15938
|
-
dirEntries = this._realFs.readdirEntriesSync(path13);
|
|
15939
|
-
} catch {
|
|
15940
|
-
}
|
|
15941
|
-
const isBundledStub = path13.equals(bundledStubPath);
|
|
15942
|
-
for (const entry of dirEntries) {
|
|
15943
|
-
const partialStubPackagePath = path13.combinePaths(entry.name);
|
|
15944
|
-
const isDirectory = !entry.isSymbolicLink() ? entry.isDirectory() : !!((_a = (0, uriUtils_1.tryStat)(this._realFs, partialStubPackagePath)) == null ? void 0 : _a.isDirectory());
|
|
15945
|
-
if (!isDirectory || !entry.name.endsWith(pathConsts_1.stubsSuffix)) {
|
|
15946
|
-
continue;
|
|
15947
|
-
}
|
|
15948
|
-
const pyTypedInfo = (0, pyTypedUtils_1.getPyTypedInfo)(this._realFs, partialStubPackagePath);
|
|
15949
|
-
if (!pyTypedInfo || !pyTypedInfo.isPartiallyTyped) {
|
|
15950
|
-
continue;
|
|
15951
|
-
}
|
|
15952
|
-
this._partialStubPackagePaths.add(partialStubPackagePath.key);
|
|
15953
|
-
const packageName = entry.name.substr(0, entry.name.length - pathConsts_1.stubsSuffix.length);
|
|
15954
|
-
for (const root of roots) {
|
|
15955
|
-
const packagePath = root.combinePaths(packageName);
|
|
15956
|
-
try {
|
|
15957
|
-
const stat = (0, uriUtils_1.tryStat)(this._realFs, packagePath);
|
|
15958
|
-
if (!(stat == null ? void 0 : stat.isDirectory())) {
|
|
15959
|
-
continue;
|
|
15960
|
-
}
|
|
15961
|
-
if (!allowMovingFn(isBundledStub, (0, pyTypedUtils_1.getPyTypedInfo)(this._realFs, packagePath), pyTypedInfo)) {
|
|
15962
|
-
continue;
|
|
15963
|
-
}
|
|
15964
|
-
this._movedDirectories.push(this._realFs.mapDirectory(packagePath, partialStubPackagePath, (u, fs8) => u.hasExtension(".pyi") || fs8.existsSync(u) && fs8.statSync(u).isDirectory()));
|
|
15965
|
-
} catch {
|
|
15966
|
-
}
|
|
15967
|
-
}
|
|
15968
|
-
}
|
|
15969
|
-
}
|
|
15970
|
-
}
|
|
15971
|
-
clearPartialStubs() {
|
|
15972
|
-
this._rootSearched.clear();
|
|
15973
|
-
this._partialStubPackagePaths.clear();
|
|
15974
|
-
this._movedDirectories.forEach((d) => d.dispose());
|
|
15975
|
-
this._movedDirectories = [];
|
|
15976
|
-
}
|
|
15977
|
-
_allowMoving(isBundled, packagePyTyped, _stubPyTyped) {
|
|
15978
|
-
if (!isBundled) {
|
|
15979
|
-
return true;
|
|
15980
|
-
}
|
|
15981
|
-
return !packagePyTyped || packagePyTyped.isPartiallyTyped;
|
|
15982
|
-
}
|
|
15983
|
-
_getRelativePathPartialStubs(partialStubPath) {
|
|
15984
|
-
const relativePaths = [];
|
|
15985
|
-
const searchAllStubs = (uri) => {
|
|
15986
|
-
for (const entry of this._realFs.readdirEntriesSync(uri)) {
|
|
15987
|
-
const filePath = uri.combinePaths(entry.name);
|
|
15988
|
-
let isDirectory = entry.isDirectory();
|
|
15989
|
-
let isFile = entry.isFile();
|
|
15990
|
-
if (entry.isSymbolicLink()) {
|
|
15991
|
-
const stat = (0, uriUtils_1.tryStat)(this._realFs, filePath);
|
|
15992
|
-
if (stat) {
|
|
15993
|
-
isDirectory = stat.isDirectory();
|
|
15994
|
-
isFile = stat.isFile();
|
|
15995
|
-
}
|
|
15996
|
-
}
|
|
15997
|
-
if (isDirectory) {
|
|
15998
|
-
searchAllStubs(filePath);
|
|
15999
|
-
}
|
|
16000
|
-
if (isFile && entry.name.endsWith(".pyi")) {
|
|
16001
|
-
const relative = partialStubPath.getRelativePathComponents(filePath).join("/");
|
|
16002
|
-
if (relative) {
|
|
16003
|
-
relativePaths.push(relative);
|
|
16004
|
-
}
|
|
16005
|
-
}
|
|
16006
|
-
}
|
|
16007
|
-
};
|
|
16008
|
-
searchAllStubs(partialStubPath);
|
|
16009
|
-
return relativePaths;
|
|
16010
|
-
}
|
|
16011
|
-
};
|
|
16012
|
-
exports2.PartialStubService = PartialStubService;
|
|
16013
|
-
}
|
|
16014
|
-
});
|
|
16015
|
-
|
|
16016
16013
|
// node_modules/@zzzen/pyright-internal/dist/common/serviceProviderExtensions.js
|
|
16017
16014
|
var require_serviceProviderExtensions = __commonJS({
|
|
16018
16015
|
"node_modules/@zzzen/pyright-internal/dist/common/serviceProviderExtensions.js"(exports2) {
|
|
@@ -16022,14 +16019,15 @@ var require_serviceProviderExtensions = __commonJS({
|
|
|
16022
16019
|
var cacheManager_1 = require_cacheManager();
|
|
16023
16020
|
var programTypes_1 = require_programTypes();
|
|
16024
16021
|
var sourceFile_1 = require_sourceFile();
|
|
16025
|
-
var
|
|
16022
|
+
var partialStubService_1 = require_partialStubService();
|
|
16023
|
+
var cancellationUtils_1 = require_cancellationUtils();
|
|
16026
16024
|
var caseSensitivityDetector_1 = require_caseSensitivityDetector();
|
|
16027
16025
|
var console_1 = require_console();
|
|
16028
|
-
var fileSystem_1 = require_fileSystem();
|
|
16029
|
-
var serviceProvider_1 = require_serviceProvider();
|
|
16030
16026
|
var docStringService_1 = require_docStringService();
|
|
16027
|
+
var fileSystem_1 = require_fileSystem();
|
|
16031
16028
|
var languageServerInterface_1 = require_languageServerInterface();
|
|
16032
|
-
var
|
|
16029
|
+
var serviceKeys_1 = require_serviceKeys();
|
|
16030
|
+
var serviceProvider_1 = require_serviceProvider();
|
|
16033
16031
|
function createServiceProvider(...services2) {
|
|
16034
16032
|
const sp = new serviceProvider_1.ServiceProvider();
|
|
16035
16033
|
services2.forEach((service) => {
|
|
@@ -16063,6 +16061,9 @@ var require_serviceProviderExtensions = __commonJS({
|
|
|
16063
16061
|
if (languageServerInterface_1.CommandService.is(service)) {
|
|
16064
16062
|
sp.add(serviceKeys_1.ServiceKeys.commandService, service);
|
|
16065
16063
|
}
|
|
16064
|
+
if (cancellationUtils_1.CancellationProvider.is(service)) {
|
|
16065
|
+
sp.add(serviceKeys_1.ServiceKeys.cancellationProvider, service);
|
|
16066
|
+
}
|
|
16066
16067
|
});
|
|
16067
16068
|
return sp;
|
|
16068
16069
|
}
|
|
@@ -16073,11 +16074,18 @@ var require_serviceProviderExtensions = __commonJS({
|
|
|
16073
16074
|
return this.get(serviceKeys_1.ServiceKeys.console);
|
|
16074
16075
|
};
|
|
16075
16076
|
serviceProvider_1.ServiceProvider.prototype.partialStubs = function() {
|
|
16077
|
+
const result = this.tryGet(serviceKeys_1.ServiceKeys.partialStubs);
|
|
16078
|
+
if (!result) {
|
|
16079
|
+
this.add(serviceKeys_1.ServiceKeys.partialStubs, new partialStubService_1.PartialStubService(this.fs()));
|
|
16080
|
+
}
|
|
16076
16081
|
return this.get(serviceKeys_1.ServiceKeys.partialStubs);
|
|
16077
16082
|
};
|
|
16078
16083
|
serviceProvider_1.ServiceProvider.prototype.tmp = function() {
|
|
16079
16084
|
return this.tryGet(serviceKeys_1.ServiceKeys.tempFile);
|
|
16080
16085
|
};
|
|
16086
|
+
serviceProvider_1.ServiceProvider.prototype.cancellationProvider = function() {
|
|
16087
|
+
return this.tryGet(serviceKeys_1.ServiceKeys.cancellationProvider) ?? new cancellationUtils_1.DefaultCancellationProvider();
|
|
16088
|
+
};
|
|
16081
16089
|
serviceProvider_1.ServiceProvider.prototype.sourceFileFactory = function() {
|
|
16082
16090
|
const result = this.tryGet(serviceKeys_1.ServiceKeys.sourceFileFactory);
|
|
16083
16091
|
return result || DefaultSourceFileFactory;
|
|
@@ -16091,8 +16099,8 @@ var require_serviceProviderExtensions = __commonJS({
|
|
|
16091
16099
|
return result;
|
|
16092
16100
|
};
|
|
16093
16101
|
var DefaultSourceFileFactory = {
|
|
16094
|
-
createSourceFile(serviceProvider, fileUri, moduleName, isThirdPartyImport, isThirdPartyPyTypedPresent, editMode, console2, logTracker, ipythonMode) {
|
|
16095
|
-
return new sourceFile_1.SourceFile(serviceProvider, fileUri, moduleName, isThirdPartyImport, isThirdPartyPyTypedPresent, editMode, console2, logTracker, ipythonMode);
|
|
16102
|
+
createSourceFile(serviceProvider, fileUri, moduleName, isThirdPartyImport, isThirdPartyPyTypedPresent, isModulePrivate, editMode, console2, logTracker, ipythonMode) {
|
|
16103
|
+
return new sourceFile_1.SourceFile(serviceProvider, fileUri, moduleName, isThirdPartyImport, isThirdPartyPyTypedPresent, isModulePrivate, editMode, console2, logTracker, ipythonMode);
|
|
16096
16104
|
}
|
|
16097
16105
|
};
|
|
16098
16106
|
}
|
|
@@ -16291,6 +16299,7 @@ var require_package_nls_cs = __commonJS({
|
|
|
16291
16299
|
baseClassUnknown: "Typ z\xE1kladn\xED t\u0159\xEDdy je nezn\xE1m\xFD, co zakr\xFDv\xE1 typ odvozen\xE9 t\u0159\xEDdy",
|
|
16292
16300
|
baseClassVariableTypeIncompatible: "Z\xE1kladn\xED t\u0159\xEDdy pro t\u0159\xEDdu {classType} definuj\xED prom\u011Bnnou {name} nekompatibiln\xEDm zp\u016Fsobem",
|
|
16293
16301
|
binaryOperationNotAllowed: "Ve v\xFDrazu typu nen\xED povolen\xFD bin\xE1rn\xED oper\xE1tor.",
|
|
16302
|
+
bindParamMissing: "Nepovedlo se vytvo\u0159it vazbu metody {methodName}, proto\u017Ee chyb\xED parametr self nebo cls",
|
|
16294
16303
|
bindTypeMismatch: "Nepovedlo se vytvo\u0159it vazbu metody \u201E{methodName}\u201C, proto\u017Ee \u201E{type}\u201C nejde p\u0159i\u0159adit k parametru \u201E{paramName}\u201C",
|
|
16295
16304
|
breakInExceptionGroup: "V bloku except* nen\xED povolen\xE1 mo\u017Enost break.",
|
|
16296
16305
|
breakOutsideLoop: "\u201Ebreak\u201C se d\xE1 pou\u017E\xEDt jenom ve smy\u010Dce",
|
|
@@ -16722,6 +16731,7 @@ var require_package_nls_cs = __commonJS({
|
|
|
16722
16731
|
typeAliasRedeclared: "\u201E{name}\u201C se deklaruje jako TypeAlias a d\xE1 se p\u0159i\u0159adit jenom jednou.",
|
|
16723
16732
|
typeAliasStatementBadScope: "P\u0159\xEDkaz type se d\xE1 pou\u017E\xEDt jenom v r\xE1mci oboru modulu nebo t\u0159\xEDdy.",
|
|
16724
16733
|
typeAliasStatementIllegal: "P\u0159\xEDkaz alias typu vy\u017Eaduje Python 3.12 nebo nov\u011Bj\u0161\xED",
|
|
16734
|
+
typeAliasTypeBadScope: "Alias typu se d\xE1 definovat jenom v r\xE1mci oboru modulu nebo t\u0159\xEDdy",
|
|
16725
16735
|
typeAliasTypeBaseClass: 'Alias typu definovan\xFD v p\u0159\xEDkazu "type" nejde pou\u017E\xEDt jako z\xE1kladn\xED t\u0159\xEDdu.',
|
|
16726
16736
|
typeAliasTypeMustBeAssigned: "Typ TypeAliasType mus\xED b\xFDt p\u0159i\u0159azen prom\u011Bnn\xE9 se stejn\xFDm n\xE1zvem jako alias typu",
|
|
16727
16737
|
typeAliasTypeNameArg: "Prvn\xED argument TypeAliasType mus\xED b\xFDt \u0159et\u011Bzcov\xFD liter\xE1l p\u0159edstavuj\xEDc\xED n\xE1zev aliasu typu.",
|
|
@@ -17130,6 +17140,7 @@ var require_package_nls_de = __commonJS({
|
|
|
17130
17140
|
baseClassUnknown: "Der Basisklassentyp ist unbekannt, sodass der Typ der abgeleiteten Klasse verdeckt wird.",
|
|
17131
17141
|
baseClassVariableTypeIncompatible: 'Basisklassen f\xFCr die Klasse "{classType}" definieren die Variable "{name}" auf inkompatible Weise.',
|
|
17132
17142
|
binaryOperationNotAllowed: "Der bin\xE4rer Operator ist im Typausdruck nicht zul\xE4ssig",
|
|
17143
|
+
bindParamMissing: "Die Methode \u201E{methodName}\u201C konnte nicht gebunden werden, weil der Parameter \u201Eself\u201C oder \u201Ecls\u201C fehlt.",
|
|
17133
17144
|
bindTypeMismatch: 'Die Methode "{methodName}" konnte nicht gebunden werden, da "{type}" dem Parameter "{paramName}" nicht zugewiesen werden kann.',
|
|
17134
17145
|
breakInExceptionGroup: "\u201Ebreak\u201C ist in einem \u201Eexcept*\u201C Block nicht zul\xE4ssig.",
|
|
17135
17146
|
breakOutsideLoop: '"break" kann nur innerhalb einer Schleife verwendet werden.',
|
|
@@ -17561,6 +17572,7 @@ var require_package_nls_de = __commonJS({
|
|
|
17561
17572
|
typeAliasRedeclared: '"{name}" ist als TypeAlias deklariert und kann nur einmal zugewiesen werden.',
|
|
17562
17573
|
typeAliasStatementBadScope: "Eine type Anweisung kann nur innerhalb eines Moduls oder Klassenbereichs verwendet werden.",
|
|
17563
17574
|
typeAliasStatementIllegal: "Die Typaliasanweisung erfordert Python 3.12 oder h\xF6her.",
|
|
17575
|
+
typeAliasTypeBadScope: "Ein Typalias kann nur innerhalb eines Modul- oder Klassenbereichs definiert werden.",
|
|
17564
17576
|
typeAliasTypeBaseClass: 'Ein in einer "type"-Anweisung definierter type Alias kann nicht als Basisklasse verwendet werden.',
|
|
17565
17577
|
typeAliasTypeMustBeAssigned: "TypeAliasType muss einer Variablen mit dem gleichen Namen wie der Typalias zugewiesen werden.",
|
|
17566
17578
|
typeAliasTypeNameArg: "Das erste Argument f\xFCr TypeAliasType muss ein Zeichenfolgenliteral sein, das den Namen des Typalias darstellt.",
|
|
@@ -17656,11 +17668,11 @@ var require_package_nls_de = __commonJS({
|
|
|
17656
17668
|
typedDictSecondArgDict: "Es wird ein dict- oder Schl\xFCsselwortparameter als zweiter Parameter erwartet.",
|
|
17657
17669
|
typedDictSecondArgDictEntry: "Einfacher W\xF6rterbucheintrag erwartet",
|
|
17658
17670
|
typedDictSet: "Element konnte in TypedDict nicht zugewiesen werden.",
|
|
17659
|
-
unaccessedClass: 'Auf
|
|
17660
|
-
unaccessedFunction: 'Auf
|
|
17661
|
-
unaccessedImport: 'Auf
|
|
17662
|
-
unaccessedSymbol: 'Auf "{name}"
|
|
17663
|
-
unaccessedVariable: 'Auf
|
|
17671
|
+
unaccessedClass: 'Auf Klasse "{name}" wird nicht zugegriffen',
|
|
17672
|
+
unaccessedFunction: 'Auf Funktion "{name}" wird nicht zugegriffen',
|
|
17673
|
+
unaccessedImport: 'Auf Import "{name}" wird nicht zugegriffen',
|
|
17674
|
+
unaccessedSymbol: 'Auf "{name}" wird nicht zugegriffen',
|
|
17675
|
+
unaccessedVariable: 'Auf Variable "{name}" wird nicht zugegriffen',
|
|
17664
17676
|
unannotatedFunctionSkipped: 'Die Analyse der Funktion "{name}" wird \xFCbersprungen, da sie nicht kommentiert wurde.',
|
|
17665
17677
|
unaryOperationNotAllowed: "Der un\xE4re Operator ist im Typausdruck nicht zul\xE4ssig",
|
|
17666
17678
|
unexpectedAsyncToken: 'Es wurde erwartet, dass "def", "with" oder "for" auf "async" folgt.',
|
|
@@ -20085,6 +20097,7 @@ var require_package_nls_es = __commonJS({
|
|
|
20085
20097
|
baseClassUnknown: "Se desconoce el tipo de la clase base, lo que oculta el tipo de la clase derivada.",
|
|
20086
20098
|
baseClassVariableTypeIncompatible: 'Las clases base para la clase "{classType}" definen la variable "{name}" de forma incompatible',
|
|
20087
20099
|
binaryOperationNotAllowed: "Operador binario no permitido en la expresi\xF3n de tipo",
|
|
20100
|
+
bindParamMissing: 'No se pudo enlazar el m\xE9todo "{methodName}" porque falta un par\xE1metro "self" o "cls"',
|
|
20088
20101
|
bindTypeMismatch: 'No se pudo enlazar el m\xE9todo "{methodName}" porque "{type}" no se puede asignar al par\xE1metro "{paramName}"',
|
|
20089
20102
|
breakInExceptionGroup: 'No se permite "break" en un bloque "except*"',
|
|
20090
20103
|
breakOutsideLoop: '"break" solo se puede usar dentro de un bucle',
|
|
@@ -20516,6 +20529,7 @@ var require_package_nls_es = __commonJS({
|
|
|
20516
20529
|
typeAliasRedeclared: '"{name}" se declara como TypeAlias y solo puede asignarse una vez',
|
|
20517
20530
|
typeAliasStatementBadScope: "Una instrucci\xF3n de type solo se puede usar en el \xE1mbito de un m\xF3dulo o de una clase",
|
|
20518
20531
|
typeAliasStatementIllegal: "La sentencia Type alias requiere Python 3.12 o posterior",
|
|
20532
|
+
typeAliasTypeBadScope: "Un alias de tipo solo se puede definir dentro de un \xE1mbito de m\xF3dulo o clase",
|
|
20519
20533
|
typeAliasTypeBaseClass: 'Un alias de tipo definido en una instrucci\xF3n "type" no se puede usar como clase base',
|
|
20520
20534
|
typeAliasTypeMustBeAssigned: "TypeAliasType debe asignarse a una variable con el mismo nombre que el alias de tipo",
|
|
20521
20535
|
typeAliasTypeNameArg: "El primer argumento de TypeAliasType debe ser un literal de cadena que represente el nombre del alias de tipo",
|
|
@@ -20924,6 +20938,7 @@ var require_package_nls_fr = __commonJS({
|
|
|
20924
20938
|
baseClassUnknown: "Le type de classe de base est inconnu, ce qui masque le type de classe d\xE9riv\xE9e",
|
|
20925
20939
|
baseClassVariableTypeIncompatible: "Les classes de base de la classe \xAB\xA0{classType}\xA0\xBB d\xE9finissent la variable \xAB\xA0{name}\xA0\xBB de mani\xE8re incompatible",
|
|
20926
20940
|
binaryOperationNotAllowed: "Op\xE9rateur binaire non autoris\xE9 dans l'expression de type",
|
|
20941
|
+
bindParamMissing: "Impossible de lier la m\xE9thode \xAB\xA0{methodName}\xA0\xBB, car il manque un param\xE8tre \xAB\xA0self\xA0\xBB ou \xAB\xA0cls\xA0\xBB",
|
|
20927
20942
|
bindTypeMismatch: `Impossible de lier la m\xE9thode "{methodName}" car "{type}" n'est pas attribuable au param\xE8tre "{paramName}"`,
|
|
20928
20943
|
breakInExceptionGroup: "\xAB\xA0break\xA0\xBB n\u2019est pas autoris\xE9 dans un bloc \xAB\xA0except*\xA0\xBB",
|
|
20929
20944
|
breakOutsideLoop: `"break" ne peut \xEAtre utilis\xE9 qu'\xE0 l'int\xE9rieur d'une boucle`,
|
|
@@ -21355,6 +21370,7 @@ var require_package_nls_fr = __commonJS({
|
|
|
21355
21370
|
typeAliasRedeclared: "\xAB {name} \xBB est d\xE9clar\xE9 en tant que TypeAlias et ne peut \xEAtre attribu\xE9 qu\u2019une seule fois",
|
|
21356
21371
|
typeAliasStatementBadScope: "Une instruction de type ne peut \xEAtre utilis\xE9e que dans une \xE9tendue de module ou de classe",
|
|
21357
21372
|
typeAliasStatementIllegal: "L\u2019instruction d\u2019alias de type n\xE9cessite Python 3.12 ou version ult\xE9rieure",
|
|
21373
|
+
typeAliasTypeBadScope: "Vous ne pouvez d\xE9finir un alias de type qu\u2019au sein d\u2019un module ou d\u2019une \xE9tendue de classe",
|
|
21358
21374
|
typeAliasTypeBaseClass: 'A type alias defined in a "type" statement cannot be used as a base class',
|
|
21359
21375
|
typeAliasTypeMustBeAssigned: "TypeAliasType doit \xEAtre affect\xE9 \xE0 une variable portant le m\xEAme nom que l'alias de type",
|
|
21360
21376
|
typeAliasTypeNameArg: "Le premier argument de TypeAliasType doit \xEAtre un litt\xE9ral de cha\xEEne repr\xE9sentant le nom de l'alias de type",
|
|
@@ -21763,6 +21779,7 @@ var require_package_nls_it = __commonJS({
|
|
|
21763
21779
|
baseClassUnknown: "Il tipo della classe di base \xE8 sconosciuto. \xC8 in corso il tentativo di determinare il tipo della classe derivata",
|
|
21764
21780
|
baseClassVariableTypeIncompatible: 'Le classi di base per la classe "{classType}" definiscono la variabile "{name}" in modo incompatibile',
|
|
21765
21781
|
binaryOperationNotAllowed: "Operatore binario non consentito nell'espressione di tipo",
|
|
21782
|
+
bindParamMissing: 'Impossibile associare il metodo "{methodName}" dal momento che il parametro "self" o "cls" risulta mancante',
|
|
21766
21783
|
bindTypeMismatch: 'Non \xE8 stato possibile associare il metodo "{methodName}" perch\xE9 non \xE8 possibile assegnare"{type}" al parametro "{paramName}"',
|
|
21767
21784
|
breakInExceptionGroup: '"break" non consentito in un blocco "except*"',
|
|
21768
21785
|
breakOutsideLoop: `"break" pu\xF2 essere usato solo all'interno di un ciclo`,
|
|
@@ -22194,6 +22211,7 @@ var require_package_nls_it = __commonJS({
|
|
|
22194
22211
|
typeAliasRedeclared: '"{name}" \xE8 dichiarato come TypeAlias e pu\xF2 essere assegnato una sola volta',
|
|
22195
22212
|
typeAliasStatementBadScope: "Un'istruzione type pu\xF2 essere usata solo all'interno di un modulo o di un ambito della classe",
|
|
22196
22213
|
typeAliasStatementIllegal: "L'istruzione alias di tipo richiede Python 3.12 o versione successiva",
|
|
22214
|
+
typeAliasTypeBadScope: "\xC8 possibile definire un alias di tipo solo all'interno di un ambito classe o modulo",
|
|
22197
22215
|
typeAliasTypeBaseClass: `Impossibile utilizzare come classe di base un alias di tipo definito in un'istruzione "type"`,
|
|
22198
22216
|
typeAliasTypeMustBeAssigned: "TypeAliasType deve essere assegnato a una variabile con lo stesso nome dell'alias di tipo",
|
|
22199
22217
|
typeAliasTypeNameArg: "Il primo argomento di TypeAliasType deve essere un valore letterale stringa che rappresenta il nome dell'alias di tipo",
|
|
@@ -22602,6 +22620,7 @@ var require_package_nls_ja = __commonJS({
|
|
|
22602
22620
|
baseClassUnknown: "\u57FA\u5E95\u30AF\u30E9\u30B9\u306E\u578B\u304C\u4E0D\u660E\u3067\u3001\u6D3E\u751F\u30AF\u30E9\u30B9\u306E\u578B\u304C\u4E0D\u660E\u3067\u3059",
|
|
22603
22621
|
baseClassVariableTypeIncompatible: '\u30AF\u30E9\u30B9 "{classType}" \u306E\u57FA\u5E95\u30AF\u30E9\u30B9\u306F\u3001\u4E92\u63DB\u6027\u306E\u306A\u3044\u65B9\u6CD5\u3067\u5909\u6570 "{name}" \u3092\u5B9A\u7FA9\u3057\u307E\u3059',
|
|
22604
22622
|
binaryOperationNotAllowed: "2 \u9805\u6F14\u7B97\u5B50\u306F\u578B\u5F0F\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093",
|
|
22623
|
+
bindParamMissing: '"self" \u307E\u305F\u306F "cls" \u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u304C\u306A\u3044\u305F\u3081\u3001\u30E1\u30BD\u30C3\u30C9 "{methodName}" \u3092\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F',
|
|
22605
22624
|
bindTypeMismatch: '"{type}" \u304C\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC "{paramName}" \u306B\u5272\u308A\u5F53\u3066\u3067\u304D\u306A\u3044\u305F\u3081\u3001\u30E1\u30BD\u30C3\u30C9 "{methodName}" \u3092\u30D0\u30A4\u30F3\u30C9\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F',
|
|
22606
22625
|
breakInExceptionGroup: '"except*" \u30D6\u30ED\u30C3\u30AF\u3067\u306F "break" \u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093',
|
|
22607
22626
|
breakOutsideLoop: '"break" \u306F\u30EB\u30FC\u30D7\u5185\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059',
|
|
@@ -23033,6 +23052,7 @@ var require_package_nls_ja = __commonJS({
|
|
|
23033
23052
|
typeAliasRedeclared: '"{name}" \u306F TypeAlias \u3068\u3057\u3066\u5BA3\u8A00\u3055\u308C\u3066\u304A\u308A\u30011 \u56DE\u3060\u3051\u5272\u308A\u5F53\u3066\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059',
|
|
23034
23053
|
typeAliasStatementBadScope: "type \u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u306F\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u307E\u305F\u306F\u30AF\u30E9\u30B9\u30B9\u30B3\u30FC\u30D7\u5185\u3067\u306E\u307F\u4F7F\u7528\u3067\u304D\u307E\u3059",
|
|
23035
23054
|
typeAliasStatementIllegal: "\u578B\u30A8\u30A4\u30EA\u30A2\u30B9 \u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u306B\u306F Python 3.12 \u4EE5\u964D\u304C\u5FC5\u8981\u3067\u3059",
|
|
23055
|
+
typeAliasTypeBadScope: "\u578B\u30A8\u30A4\u30EA\u30A2\u30B9\u306F\u3001\u30E2\u30B8\u30E5\u30FC\u30EB\u307E\u305F\u306F\u30AF\u30E9\u30B9 \u30B9\u30B3\u30FC\u30D7\u5185\u3067\u306E\u307F\u5B9A\u7FA9\u3067\u304D\u307E\u3059",
|
|
23036
23056
|
typeAliasTypeBaseClass: '"type" \u30B9\u30C6\u30FC\u30C8\u30E1\u30F3\u30C8\u3067\u5B9A\u7FA9\u3055\u308C\u305F\u578B\u30A8\u30A4\u30EA\u30A2\u30B9\u3092\u57FA\u5E95\u30AF\u30E9\u30B9\u3068\u3057\u3066\u4F7F\u7528\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093',
|
|
23037
23057
|
typeAliasTypeMustBeAssigned: "TypeAliasType \u306F\u3001\u578B\u30A8\u30A4\u30EA\u30A2\u30B9\u3068\u540C\u3058\u540D\u524D\u306E\u5909\u6570\u306B\u5272\u308A\u5F53\u3066\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
23038
23058
|
typeAliasTypeNameArg: "TypeAliasType \u306E\u6700\u521D\u306E\u5F15\u6570\u306F\u3001\u578B\u30A8\u30A4\u30EA\u30A2\u30B9\u306E\u540D\u524D\u3092\u8868\u3059\u6587\u5B57\u5217\u30EA\u30C6\u30E9\u30EB\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",
|
|
@@ -23441,6 +23461,7 @@ var require_package_nls_ko = __commonJS({
|
|
|
23441
23461
|
baseClassUnknown: "\uAE30\uBCF8 \uD074\uB798\uC2A4 \uD615\uC2DD\uC744 \uC54C \uC218 \uC5C6\uC73C\uBBC0\uB85C \uD30C\uC0DD \uD074\uB798\uC2A4\uC758 \uD615\uC2DD\uC774 \uBAA8\uD638\uD569\uB2C8\uB2E4.",
|
|
23442
23462
|
baseClassVariableTypeIncompatible: '"{classType}" \uD074\uB798\uC2A4\uC758 \uAE30\uBCF8 \uD074\uB798\uC2A4\uAC00 "{name}" \uBCC0\uC218\uB97C \uD638\uD658\uB418\uC9C0 \uC54A\uB294 \uBC29\uC2DD\uC73C\uB85C \uC815\uC758\uD569\uB2C8\uB2E4.',
|
|
23443
23463
|
binaryOperationNotAllowed: "\uD615\uC2DD \uC2DD\uC5D0\uB294 \uC774\uD56D \uC5F0\uC0B0\uC790\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
23464
|
+
bindParamMissing: '"self" \uB610\uB294 "cls" \uB9E4\uAC1C \uBCC0\uC218\uAC00 \uB204\uB77D\uB418\uC5C8\uAE30 \uB54C\uBB38\uC5D0 \uBA54\uC11C\uB4DC "{methodName}"\uC744(\uB97C) \uBC14\uC778\uB529\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.',
|
|
23444
23465
|
bindTypeMismatch: "\u2018{type}\u2019\uC744(\uB97C) \uB9E4\uAC1C \uBCC0\uC218 \u2018{paramName}\u2019\uC5D0 \uD560\uB2F9\uD560 \uC218 \uC5C6\uC73C\uBBC0\uB85C \u2018{methodName}\u2019 \uBA54\uC11C\uB4DC\uB97C \uBC14\uC778\uB529\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
23445
23466
|
breakInExceptionGroup: '"except*" \uBE14\uB85D\uC5D0\uB294 "break"\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4',
|
|
23446
23467
|
breakOutsideLoop: "\u2018break\u2019\uB294 \uB8E8\uD504 \uB0B4\uC5D0\uC11C\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",
|
|
@@ -23872,6 +23893,7 @@ var require_package_nls_ko = __commonJS({
|
|
|
23872
23893
|
typeAliasRedeclared: '"{name}"\uC740(\uB294) TypeAlias\uB85C \uC120\uC5B8\uB418\uBA70 \uD55C \uBC88\uB9CC \uD560\uB2F9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.',
|
|
23873
23894
|
typeAliasStatementBadScope: "type \uBB38\uC740 \uBAA8\uB4C8 \uB610\uB294 \uD074\uB798\uC2A4 \uBC94\uC704 \uB0B4\uC5D0\uC11C\uB9CC \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",
|
|
23874
23895
|
typeAliasStatementIllegal: "\uD615\uC2DD \uBCC4\uCE6D \uBB38\uC5D0\uB294 Python 3.12 \uC774\uC0C1\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.",
|
|
23896
|
+
typeAliasTypeBadScope: "\uD615\uC2DD \uBCC4\uCE6D\uC740 \uBAA8\uB4C8 \uB610\uB294 \uD074\uB798\uC2A4 \uBC94\uC704 \uB0B4\uC5D0\uC11C\uB9CC \uC815\uC758\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",
|
|
23875
23897
|
typeAliasTypeBaseClass: '"type" \uBB38\uC5D0 \uC815\uC758\uB41C \uD615\uC2DD \uBCC4\uCE6D\uC740 \uAE30\uBCF8 \uD074\uB798\uC2A4\uB85C \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.',
|
|
23876
23898
|
typeAliasTypeMustBeAssigned: "TypeAliasType\uC740 \uD615\uC2DD \uBCC4\uCE6D\uACFC \uC774\uB984\uC774 \uAC19\uC740 \uBCC0\uC218\uC5D0 \uD560\uB2F9\uD574\uC57C \uD569\uB2C8\uB2E4.",
|
|
23877
23899
|
typeAliasTypeNameArg: "TypeAliasType\uC758 \uCCAB \uBC88\uC9F8 \uC778\uC218\uB294 \uD615\uC2DD \uBCC4\uCE6D\uC758 \uC774\uB984\uC744 \uB098\uD0C0\uB0B4\uB294 \uBB38\uC790\uC5F4 \uB9AC\uD130\uB7F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.",
|
|
@@ -24280,6 +24302,7 @@ var require_package_nls_pl = __commonJS({
|
|
|
24280
24302
|
baseClassUnknown: "Typ klasy bazowej jest nieznany, zas\u0142aniaj\u0105c typ klasy pochodnej",
|
|
24281
24303
|
baseClassVariableTypeIncompatible: "Klasy bazowe dla klasy \u201E{classType}\u201D definiuj\u0105 zmienn\u0105 \u201E{name}\u201D w niezgodny spos\xF3b",
|
|
24282
24304
|
binaryOperationNotAllowed: "Operator binarny nie jest dozwolony w wyra\u017Ceniu typu",
|
|
24305
|
+
bindParamMissing: "Nie mo\u017Cna powi\u0105za\u0107 metody \u201E{methodName}\u201D, poniewa\u017C brakuje w niej parametru \u201Eself\u201D lub \u201Ecls\u201D",
|
|
24283
24306
|
bindTypeMismatch: "Nie mo\u017Cna powi\u0105za\u0107 metody \u201E{methodName}\u201D, poniewa\u017C nie mo\u017Cna przypisa\u0107 typu \u201E{type}\u201D do parametru \u201E{paramName}\u201D",
|
|
24284
24307
|
breakInExceptionGroup: "\u201Ebreak\u201D nie jest dozwolone w bloku \u201Eexcept*\u201D",
|
|
24285
24308
|
breakOutsideLoop: "Warto\u015B\u0107 \u201Ebreak\u201D mo\u017Ce by\u0107 u\u017Cywana tylko w p\u0119tli",
|
|
@@ -24711,6 +24734,7 @@ var require_package_nls_pl = __commonJS({
|
|
|
24711
24734
|
typeAliasRedeclared: "Nazwa \u201E{name}\u201D jest zadeklarowana jako TypeAlias i mo\u017Ce by\u0107 przypisana tylko raz",
|
|
24712
24735
|
typeAliasStatementBadScope: "Instrukcja type mo\u017Ce by\u0107 u\u017Cyta tylko w zakresie modu\u0142u lub klasy",
|
|
24713
24736
|
typeAliasStatementIllegal: "Instrukcja typu alias wymaga j\u0119zyka Python w wersji 3.12 lub nowszej",
|
|
24737
|
+
typeAliasTypeBadScope: "Alias typu mo\u017Cna zdefiniowa\u0107 tylko w zakresie modu\u0142u lub klasy",
|
|
24714
24738
|
typeAliasTypeBaseClass: 'A type alias defined in a "type" statement cannot be used as a base class',
|
|
24715
24739
|
typeAliasTypeMustBeAssigned: "Typ TypeAliasType musi by\u0107 przypisany do zmiennej o takiej samej nazwie jak alias typu",
|
|
24716
24740
|
typeAliasTypeNameArg: "Pierwszy argument dla typu TypeAliasType musi by\u0107 litera\u0142em ci\u0105gu reprezentuj\u0105cym nazw\u0119 aliasu typu",
|
|
@@ -25119,6 +25143,7 @@ var require_package_nls_pt_br = __commonJS({
|
|
|
25119
25143
|
baseClassUnknown: "O tipo de classe base \xE9 desconhecido, ocultando o tipo de classe derivada",
|
|
25120
25144
|
baseClassVariableTypeIncompatible: 'Classes base para a classe "{classType}" definem a vari\xE1vel "{name}" de maneira incompat\xEDvel',
|
|
25121
25145
|
binaryOperationNotAllowed: "Operador bin\xE1rio n\xE3o permitido na express\xE3o de tipo",
|
|
25146
|
+
bindParamMissing: 'N\xE3o foi poss\xEDvel vincular o m\xE9todo "{methodName}" porque est\xE1 faltando um par\xE2metro "self" ou "cls"',
|
|
25122
25147
|
bindTypeMismatch: 'N\xE3o foi poss\xEDvel associar o m\xE9todo "{methodName}" porque "{type}" n\xE3o \xE9 atribu\xEDvel ao par\xE2metro "{paramName}"',
|
|
25123
25148
|
breakInExceptionGroup: '"break" n\xE3o \xE9 permitido em um bloco "except*"',
|
|
25124
25149
|
breakOutsideLoop: '"break" s\xF3 pode ser usado dentro de um loop',
|
|
@@ -25550,6 +25575,7 @@ var require_package_nls_pt_br = __commonJS({
|
|
|
25550
25575
|
typeAliasRedeclared: '"{name}" \xE9 declarado como um TypeAlias e s\xF3 pode ser atribu\xEDdo uma vez',
|
|
25551
25576
|
typeAliasStatementBadScope: "Uma instru\xE7\xE3o type s\xF3 pode ser usada dentro de um m\xF3dulo ou escopo de classe",
|
|
25552
25577
|
typeAliasStatementIllegal: "A instru\xE7\xE3o de alias de tipo requer o Python 3.12 ou mais recente",
|
|
25578
|
+
typeAliasTypeBadScope: "Um alias de tipo s\xF3 pode ser definido dentro de um m\xF3dulo ou escopo de classe",
|
|
25553
25579
|
typeAliasTypeBaseClass: 'Um alias de tipo definido em uma instru\xE7\xE3o "type" n\xE3o pode ser usado como uma classe base',
|
|
25554
25580
|
typeAliasTypeMustBeAssigned: "TypeAliasType deve ser atribu\xEDdo a uma vari\xE1vel com o mesmo nome que o alias de tipo",
|
|
25555
25581
|
typeAliasTypeNameArg: "O primeiro argumento para TypeAliasType deve ser um literal de cadeia de caracteres que representa o nome do alias de tipo",
|
|
@@ -25958,6 +25984,7 @@ var require_package_nls_qps_ploc = __commonJS({
|
|
|
25958
25984
|
baseClassUnknown: "[QQxIX][\u0E19\u0E31\u0E49\xDF\xE6s\xEB \xE7l\xE6ss t\xFFp\xEB \xEFs \xB5\xF1k\xF1\xF8w\xF1, \xF8\xFEs\xE7\xB5r\xEF\xF1g t\xFFp\xEB \xF8f \xF0\xEBr\xEFv\xEB\xF0 \xE7l\xE6ss\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
25959
25985
|
baseClassVariableTypeIncompatible: '[YmxlD][\u0E19\u0E31\u0E49\xDF\xE6s\xEB \xE7l\xE6ss\xEBs f\xF8r \xE7l\xE6ss "{\xE7l\xE6ssT\xFFp\xEB}" \xF0\xEBf\xEF\xF1\xEB v\xE6r\xEF\xE6\xFEl\xEB "{\xF1\xE6m\xEB}" \xEF\xF1 \xEF\xF1\xE7\xF8mp\xE6t\xEF\xFEl\xEB w\xE6\xFF\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
25960
25986
|
binaryOperationNotAllowed: "[1lzlz][\u0E19\u0E31\u0E49\xDF\xEF\xF1\xE6r\xFF \xF8p\xEBr\xE6t\xF8r \xF1\xF8t \xE6ll\xF8w\xEB\xF0 \xEF\xF1 t\xFFp\xEB \xEBxpr\xEBss\xEF\xF8\xF1\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
25987
|
+
bindParamMissing: '[6ggqn][\u0E19\u0E31\u0E49\xC7\xF8\xB5l\xF0 \xF1\xF8t \xFE\xEF\xF1\xF0 m\xEBth\xF8\xF0 "{m\xEBth\xF8\xF0\xD1\xE6m\xEB}" \xFE\xEB\xE7\xE6\xB5s\xEB \xEFt \xEFs m\xEFss\xEF\xF1g \xE6 "s\xEBlf" \xF8r "\xE7ls" p\xE6r\xE6m\xEBt\xEBr\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
25961
25988
|
bindTypeMismatch: '[x4sbf][\u0E19\u0E31\u0E49\xC7\xF8\xB5l\xF0 \xF1\xF8t \xFE\xEF\xF1\xF0 m\xEBth\xF8\xF0 "{m\xEBth\xF8\xF0\xD1\xE6m\xEB}" \xFE\xEB\xE7\xE6\xB5s\xEB "{t\xFFp\xEB}" \xEFs \xF1\xF8t \xE6ss\xEFg\xF1\xE6\xFEl\xEB t\xF8 p\xE6r\xE6m\xEBt\xEBr "{p\xE6r\xE6m\xD1\xE6m\xEB}"\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
25962
25989
|
breakInExceptionGroup: '[Kwoku][\u0E19\u0E31\u0E49"break" \xEFs \xF1\xF8t \xE6ll\xF8w\xEB\xF0 \xEF\xF1 \xE6\xF1 "except*" \xFEl\xF8\xE7k\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
25963
25990
|
breakOutsideLoop: '[Ca4Ip][\u0E19\u0E31\u0E49"break" \xE7\xE6\xF1 \xFE\xEB \xB5s\xEB\xF0 \xF8\xF1l\xFF w\xEFth\xEF\xF1 \xE6 l\xF8\xF8p\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
@@ -26389,6 +26416,7 @@ var require_package_nls_qps_ploc = __commonJS({
|
|
|
26389
26416
|
typeAliasRedeclared: '[P036x][\u0E19\u0E31\u0E49"{\xF1\xE6m\xEB}" \xEFs \xF0\xEB\xE7l\xE6r\xEB\xF0 \xE6s \xE6 TypeAlias \xE6\xF1\xF0 \xE7\xE6\xF1 \xFE\xEB \xE6ss\xEFg\xF1\xEB\xF0 \xF8\xF1l\xFF \xF8\xF1\xE7\xEB\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
26390
26417
|
typeAliasStatementBadScope: "[C24Up][\u0E19\u0E31\u0E49\xC6 type st\xE6t\xEBm\xEB\xF1t \xE7\xE6\xF1 \xFE\xEB \xB5s\xEB\xF0 \xF8\xF1l\xFF w\xEFth\xEF\xF1 \xE6 m\xF8\xF0\xB5l\xEB \xF8r \xE7l\xE6ss s\xE7\xF8p\xEB\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
26391
26418
|
typeAliasStatementIllegal: "[2EW0Q][\u0E19\u0E31\u0E49T\xFFp\xEB \xE6l\xEF\xE6s st\xE6t\xEBm\xEB\xF1t r\xEBq\xB5\xEFr\xEBs P\xFFth\xF8\xF1 3.12 \xF8r \xF1\xEBw\xEBr\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
26419
|
+
typeAliasTypeBadScope: "[kdK34][\u0E19\u0E31\u0E49\xC6 t\xFFp\xEB \xE6l\xEF\xE6s \xE7\xE6\xF1 \xFE\xEB \xF0\xEBf\xEF\xF1\xEB\xF0 \xF8\xF1l\xFF w\xEFth\xEF\xF1 \xE6 m\xF8\xF0\xB5l\xEB \xF8r \xE7l\xE6ss s\xE7\xF8p\xEB\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
26392
26420
|
typeAliasTypeBaseClass: '[RIpMs][\u0E19\u0E31\u0E49\xC6 t\xFFp\xEB \xE6l\xEF\xE6s \xF0\xEBf\xEF\xF1\xEB\xF0 \xEF\xF1 \xE6 "type" st\xE6t\xEBm\xEB\xF1t \xE7\xE6\xF1\xF1\xF8t \xFE\xEB \xB5s\xEB\xF0 \xE6s \xE6 \xFE\xE6s\xEB \xE7l\xE6ss\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u0E19\u0E31\u0E49\u0922\u0942\u0901]',
|
|
26393
26421
|
typeAliasTypeMustBeAssigned: "[aV4Nn][\u0E19\u0E31\u0E49TypeAliasType m\xB5st \xFE\xEB \xE6ss\xEFg\xF1\xEB\xF0 t\xF8 \xE6 v\xE6r\xEF\xE6\xFEl\xEB w\xEFth th\xEB s\xE6m\xEB \xF1\xE6m\xEB \xE6s th\xEB t\xFFp\xEB \xE6l\xEF\xE6s\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
26394
26422
|
typeAliasTypeNameArg: "[dUUf1][\u0E19\u0E31\u0E49F\xEFrst \xE6rg\xB5m\xEB\xF1t t\xF8 TypeAliasType m\xB5st \xFE\xEB \xE6 str\xEF\xF1g l\xEFt\xEBr\xE6l r\xEBpr\xEBs\xEB\xF1t\xEF\xF1g th\xEB \xF1\xE6m\xEB \xF8f th\xEB t\xFFp\xEB \xE6l\xEF\xE6s\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0924\u093F\u0943\u307E\u1EA4\u011F\u502A\u0130\u0402\u04B0\u0915\u094D\u0930\u094D\u0E19\u0E31\u0E49\u0922\u0942\u0901]",
|
|
@@ -26797,6 +26825,7 @@ var require_package_nls_ru = __commonJS({
|
|
|
26797
26825
|
baseClassUnknown: "\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u044B\u0439 \u0442\u0438\u043F \u0431\u0430\u0437\u043E\u0432\u043E\u0433\u043E \u043A\u043B\u0430\u0441\u0441\u0430 \u0441\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u0442\u0438\u043F \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u043D\u043E\u0433\u043E \u043A\u043B\u0430\u0441\u0441\u0430",
|
|
26798
26826
|
baseClassVariableTypeIncompatible: '\u0411\u0430\u0437\u043E\u0432\u044B\u0435 \u043A\u043B\u0430\u0441\u0441\u044B \u043A\u043B\u0430\u0441\u0441\u0430 "{classType}" \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u044E\u0442 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0443\u044E "{name}" \u043D\u0435\u0441\u043E\u0432\u043C\u0435\u0441\u0442\u0438\u043C\u044B\u043C \u0441\u043F\u043E\u0441\u043E\u0431\u043E\u043C',
|
|
26799
26827
|
binaryOperationNotAllowed: "\u0411\u0438\u043D\u0430\u0440\u043D\u044B\u0439 \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440 \u043D\u0435\u043B\u044C\u0437\u044F \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0438 \u0442\u0438\u043F\u0430",
|
|
26828
|
+
bindParamMissing: '\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u0438\u0432\u044F\u0437\u0430\u0442\u044C \u043C\u0435\u0442\u043E\u0434 "{methodName}", \u0442\u0430\u043A \u043A\u0430\u043A \u0432 \u043D\u0435\u043C \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 "self" \u0438\u043B\u0438 "cls"',
|
|
26800
26829
|
bindTypeMismatch: '\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u0438\u0432\u044F\u0437\u0430\u0442\u044C \u043C\u0435\u0442\u043E\u0434 "{methodName}", "{type}" \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0443 "{paramName}"',
|
|
26801
26830
|
breakInExceptionGroup: '\u0417\u0430\u043F\u0440\u0435\u0449\u0435\u043D\u043E \u043D\u0430\u043B\u0438\u0447\u0438\u0435 "break" \u0432 \u0431\u043B\u043E\u043A\u0435 "except*"',
|
|
26802
26831
|
breakOutsideLoop: '"break" \u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0432\u043D\u0443\u0442\u0440\u0438 \u0446\u0438\u043A\u043B\u0430',
|
|
@@ -27228,6 +27257,7 @@ var require_package_nls_ru = __commonJS({
|
|
|
27228
27257
|
typeAliasRedeclared: '"{name}" \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D \u043A\u0430\u043A TypeAlias \u0438 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u043F\u0440\u0438\u0441\u0432\u043E\u0435\u043D \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0434\u0438\u043D \u0440\u0430\u0437',
|
|
27229
27258
|
typeAliasStatementBadScope: "\u0423\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0435 type \u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0432\u043D\u0443\u0442\u0440\u0438 \u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u043C\u043E\u0434\u0443\u043B\u044F \u0438\u043B\u0438 \u043A\u043B\u0430\u0441\u0441\u0430",
|
|
27230
27259
|
typeAliasStatementIllegal: "\u041E\u043F\u0435\u0440\u0430\u0442\u043E\u0440 \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C\u0430 \u0442\u0438\u043F\u0430 \u043C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0432 Python \u0432\u0435\u0440\u0441\u0438\u0438 \u043D\u0435 \u043D\u0438\u0436\u0435 3.12",
|
|
27260
|
+
typeAliasTypeBadScope: "\u041F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0442\u0438\u043F\u0430 \u043C\u043E\u0436\u043D\u043E \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0438\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0432\u043D\u0443\u0442\u0440\u0438 \u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u043C\u043E\u0434\u0443\u043B\u044F \u0438\u043B\u0438 \u043A\u043B\u0430\u0441\u0441\u0430",
|
|
27231
27261
|
typeAliasTypeBaseClass: '\u041F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0442\u0438\u043F\u0430, \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u043C\u044B\u0439 \u0432 \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440\u0435 "type", \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u0432 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043E\u0432\u043E\u0433\u043E \u043A\u043B\u0430\u0441\u0441\u0430.',
|
|
27232
27262
|
typeAliasTypeMustBeAssigned: "TypeAliasType \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u043E\u0439 \u0441 \u0442\u0435\u043C \u0436\u0435 \u0438\u043C\u0435\u043D\u0435\u043C, \u0447\u0442\u043E \u0438 \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0442\u0438\u043F\u0430",
|
|
27233
27263
|
typeAliasTypeNameArg: "\u041F\u0435\u0440\u0432\u044B\u0439 \u0430\u0440\u0433\u0443\u043C\u0435\u043D\u0442 TypeAliasType \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u043E\u0432\u044B\u043C \u043B\u0438\u0442\u0435\u0440\u0430\u043B\u043E\u043C, \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0449\u0438\u043C \u0438\u043C\u044F \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C\u0430 \u0442\u0438\u043F\u0430",
|
|
@@ -27636,6 +27666,7 @@ var require_package_nls_tr = __commonJS({
|
|
|
27636
27666
|
baseClassUnknown: "Temel s\u0131n\u0131f t\xFCr\xFC bilinmiyor, t\xFCretilmi\u015F s\u0131n\u0131f\u0131 gizliyor",
|
|
27637
27667
|
baseClassVariableTypeIncompatible: '"{classType}" s\u0131n\u0131f\u0131 i\xE7in temel s\u0131n\u0131flar, "{name}" de\u011Fi\u015Fkenini uyumsuz bir \u015Fekilde tan\u0131ml\u0131yor',
|
|
27638
27668
|
binaryOperationNotAllowed: "T\xFCr ifadesinde ikili i\u015Fle\xE7 kullan\u0131lamaz",
|
|
27669
|
+
bindParamMissing: '"self" veya "cls" parametresi eksik oldu\u011Fundan "{methodName}" y\xF6ntemi ba\u011Flanamad\u0131',
|
|
27639
27670
|
bindTypeMismatch: '"{type}", "{paramName}" parametresine atanamad\u0131\u011F\u0131ndan "{methodName}" metodu ba\u011Flanamad\u0131',
|
|
27640
27671
|
breakInExceptionGroup: '"except*" blo\u011Funda "break" kullan\u0131lamaz',
|
|
27641
27672
|
breakOutsideLoop: '"break" yaln\u0131zca bir d\xF6ng\xFC i\xE7inde kullan\u0131labilir',
|
|
@@ -28067,6 +28098,7 @@ var require_package_nls_tr = __commonJS({
|
|
|
28067
28098
|
typeAliasRedeclared: '"{name}" bir TypeAlias olarak bildirilmi\u015F ve yaln\u0131zca bir kez atanabilir',
|
|
28068
28099
|
typeAliasStatementBadScope: "A type statement can be used only within a module or class scope",
|
|
28069
28100
|
typeAliasStatementIllegal: "T\xFCr di\u011Fer ad\u0131 deyimi i\xE7in Python 3.12 veya daha yeni bir s\xFCr\xFCm\xFC gerekiyor",
|
|
28101
|
+
typeAliasTypeBadScope: "T\xFCr di\u011Fer ad\u0131 yaln\u0131zca bir mod\xFCl veya s\u0131n\u0131f kapsam\u0131nda tan\u0131mlanabilir",
|
|
28070
28102
|
typeAliasTypeBaseClass: 'Bir "type" deyiminde tan\u0131mlanan type di\u011Fer ad\u0131 temel s\u0131n\u0131f olarak kullan\u0131lamaz',
|
|
28071
28103
|
typeAliasTypeMustBeAssigned: "TypeAliasType, t\xFCr di\u011Fer ad\u0131yla ayn\u0131 ada sahip bir de\u011Fi\u015Fkene atanmal\u0131d\u0131r",
|
|
28072
28104
|
typeAliasTypeNameArg: "TypeAliasType i\xE7in ilk ba\u011F\u0131ms\u0131z de\u011Fi\u015Fken, t\xFCr di\u011Fer ad\u0131n\u0131n ad\u0131n\u0131 temsil eden bir sabit de\u011Ferli dize olmal\u0131d\u0131r",
|
|
@@ -28475,6 +28507,7 @@ var require_package_nls_zh_cn = __commonJS({
|
|
|
28475
28507
|
baseClassUnknown: "\u57FA\u7C7B\u7C7B\u578B\u672A\u77E5\uFF0C\u9690\u853D\u6D3E\u751F\u7C7B\u7684\u7C7B\u578B",
|
|
28476
28508
|
baseClassVariableTypeIncompatible: "\u7C7B\u201C{classType}\u201D\u7684\u57FA\u7C7B\u4EE5\u4E0D\u517C\u5BB9\u7684\u65B9\u5F0F\u5B9A\u4E49\u53D8\u91CF\u201C{name}\u201D",
|
|
28477
28509
|
binaryOperationNotAllowed: "\u7C7B\u578B\u8868\u8FBE\u5F0F\u4E2D\u4E0D\u5141\u8BB8\u4F7F\u7528\u4E8C\u5143\u8FD0\u7B97\u7B26",
|
|
28510
|
+
bindParamMissing: "\u65E0\u6CD5\u7ED1\u5B9A\u65B9\u6CD5\u201C{methodName}\u201D\uFF0C\u56E0\u4E3A\u5B83\u7F3A\u5C11 \u201Cself\u201D \u6216 \u201Ccls\u201D \u53C2\u6570",
|
|
28478
28511
|
bindTypeMismatch: "\u65E0\u6CD5\u7ED1\u5B9A\u65B9\u6CD5\u201C{methodName}\u201D\uFF0C\u56E0\u4E3A\u201C{type}\u201D\u4E0D\u80FD\u5206\u914D\u7ED9\u53C2\u6570\u201C{paramName}\u201D",
|
|
28479
28512
|
breakInExceptionGroup: '"except*" \u5757\u4E2D\u4E0D\u5141\u8BB8 "break"',
|
|
28480
28513
|
breakOutsideLoop: "\u201Cbreak\u201D\u53EA\u80FD\u5728\u5FAA\u73AF\u4E2D\u4F7F\u7528",
|
|
@@ -28906,6 +28939,7 @@ var require_package_nls_zh_cn = __commonJS({
|
|
|
28906
28939
|
typeAliasRedeclared: "\u201C{name}\u201D\u58F0\u660E\u4E3A TypeAlias\uFF0C\u53EA\u80FD\u5206\u914D\u4E00\u6B21",
|
|
28907
28940
|
typeAliasStatementBadScope: "type \u8BED\u53E5\u53EA\u80FD\u5728\u6A21\u5757\u6216\u7C7B\u8303\u56F4\u5185\u4F7F\u7528",
|
|
28908
28941
|
typeAliasStatementIllegal: "\u7C7B\u578B\u522B\u540D\u8BED\u53E5\u9700\u8981 Python 3.12 \u6216\u66F4\u9AD8\u7248\u672C",
|
|
28942
|
+
typeAliasTypeBadScope: "\u53EA\u80FD\u5728\u6A21\u5757\u6216\u7C7B\u8303\u56F4\u5185\u5B9A\u4E49\u7C7B\u578B\u522B\u540D",
|
|
28909
28943
|
typeAliasTypeBaseClass: '"type" \u8BED\u53E5\u4E2D\u5B9A\u4E49\u7684\u7C7B\u578B\u522B\u540D\u4E0D\u80FD\u7528\u4F5C\u57FA\u7C7B',
|
|
28910
28944
|
typeAliasTypeMustBeAssigned: "\u5FC5\u987B\u5C06 TypeAliasType \u5206\u914D\u7ED9\u4E0E\u7C7B\u578B\u522B\u540D\u540C\u540D\u7684\u53D8\u91CF",
|
|
28911
28945
|
typeAliasTypeNameArg: "TypeAliasType \u7684\u7B2C\u4E00\u4E2A\u53C2\u6570\u5FC5\u987B\u662F\u8868\u793A\u7C7B\u578B\u522B\u540D\u540D\u79F0\u7684\u5B57\u7B26\u4E32\u6587\u672C",
|
|
@@ -29314,6 +29348,7 @@ var require_package_nls_zh_tw = __commonJS({
|
|
|
29314
29348
|
baseClassUnknown: "\u57FA\u5E95\u985E\u5225\u985E\u578B\u672A\u77E5\uFF0C\u906E\u853D\u884D\u751F\u985E\u5225\u7684\u985E\u578B",
|
|
29315
29349
|
baseClassVariableTypeIncompatible: '\u985E\u5225 "{classType}" \u7684\u57FA\u5E95\u985E\u5225\u4EE5\u4E0D\u76F8\u5BB9\u7684\u65B9\u5F0F\u5B9A\u7FA9\u8B8A\u6578 "{name}"',
|
|
29316
29350
|
binaryOperationNotAllowed: "\u985E\u578B\u904B\u7B97\u5F0F\u4E2D\u4E0D\u5141\u8A31\u4E8C\u5143\u904B\u7B97\u5B50",
|
|
29351
|
+
bindParamMissing: '\u7121\u6CD5\u7E6B\u7D50\u65B9\u6CD5 "{methodName}"\uFF0C\u56E0\u70BA\u7F3A\u5C11 "self" \u6216 "cls" \u53C3\u6578',
|
|
29317
29352
|
bindTypeMismatch: '\u7121\u6CD5\u7E6B\u7D50\u65B9\u6CD5 "{methodName}"\uFF0C\u56E0\u70BA "{type}" \u7121\u6CD5\u6307\u6D3E\u7D66\u53C3\u6578 "{paramName}"',
|
|
29318
29353
|
breakInExceptionGroup: '"except*" \u5340\u584A\u4E2D\u4E0D\u5141\u8A31 "break"',
|
|
29319
29354
|
breakOutsideLoop: '"break" \u53EA\u80FD\u5728\u8FF4\u5708\u5167\u4F7F\u7528',
|
|
@@ -29745,6 +29780,7 @@ var require_package_nls_zh_tw = __commonJS({
|
|
|
29745
29780
|
typeAliasRedeclared: '"{name}" \u5BA3\u544A\u70BA TypeAlias\uFF0C\u4E14\u53EA\u80FD\u6307\u6D3E\u4E00\u6B21',
|
|
29746
29781
|
typeAliasStatementBadScope: "A type statement can be used only within a module or class scope",
|
|
29747
29782
|
typeAliasStatementIllegal: "\u985E\u578B\u5225\u540D\u9673\u8FF0\u5F0F\u9700\u8981 Python 3.12 \u6216\u66F4\u65B0\u7248\u672C",
|
|
29783
|
+
typeAliasTypeBadScope: "\u985E\u578B\u5225\u540D\u53EA\u80FD\u5728\u6A21\u7D44\u6216\u985E\u5225\u7BC4\u570D\u5167\u5B9A\u7FA9",
|
|
29748
29784
|
typeAliasTypeBaseClass: '"type" \u9673\u8FF0\u5F0F\u4E2D\u5B9A\u7FA9\u7684\u985E\u578B\u5225\u540D\u4E0D\u80FD\u505A\u70BA\u57FA\u5E95\u985E\u5225\u4F7F\u7528',
|
|
29749
29785
|
typeAliasTypeMustBeAssigned: "TypeAliasType \u5FC5\u9808\u6307\u6D3E\u7D66\u8207\u578B\u5225\u5225\u540D\u76F8\u540C\u7684\u8B8A\u6578",
|
|
29750
29786
|
typeAliasTypeNameArg: "TypeAliasType \u7684\u7B2C\u4E00\u500B\u5F15\u6578\u5FC5\u9808\u662F\u4EE3\u8868\u578B\u5225\u5225\u540D\u540D\u7A31\u7684\u5B57\u4E32\u5E38\u503C",
|
|
@@ -33007,6 +33043,9 @@ var require_codeFlowTypes = __commonJS({
|
|
|
33007
33043
|
if (reference.nodeType === 35) {
|
|
33008
33044
|
return isCodeFlowSupportedForReference(reference.d.leftExpr);
|
|
33009
33045
|
}
|
|
33046
|
+
if (reference.nodeType === 4) {
|
|
33047
|
+
return true;
|
|
33048
|
+
}
|
|
33010
33049
|
if (reference.nodeType === 27) {
|
|
33011
33050
|
if (reference.d.items.length !== 1 || reference.d.trailingComma || reference.d.items[0].d.name !== void 0 || reference.d.items[0].d.argCategory !== 0) {
|
|
33012
33051
|
return false;
|
|
@@ -33026,6 +33065,8 @@ var require_codeFlowTypes = __commonJS({
|
|
|
33026
33065
|
let key;
|
|
33027
33066
|
if (reference.nodeType === 38) {
|
|
33028
33067
|
key = reference.d.value;
|
|
33068
|
+
} else if (reference.nodeType === 4) {
|
|
33069
|
+
key = reference.d.name.d.value;
|
|
33029
33070
|
} else if (reference.nodeType === 35) {
|
|
33030
33071
|
const leftKey = createKeyForReference(reference.d.leftExpr);
|
|
33031
33072
|
key = `${leftKey}.${reference.d.member.d.value}`;
|
|
@@ -33056,6 +33097,9 @@ var require_codeFlowTypes = __commonJS({
|
|
|
33056
33097
|
if (reference.nodeType === 38) {
|
|
33057
33098
|
return [createKeyForReference(reference)];
|
|
33058
33099
|
}
|
|
33100
|
+
if (reference.nodeType === 4) {
|
|
33101
|
+
return [createKeyForReference(reference.d.name)];
|
|
33102
|
+
}
|
|
33059
33103
|
if (reference.nodeType === 35) {
|
|
33060
33104
|
return [
|
|
33061
33105
|
...createKeysForReferenceSubexpressions(reference.d.leftExpr),
|
|
@@ -33126,9 +33170,6 @@ var require_analyzerNodeInfo = __commonJS({
|
|
|
33126
33170
|
if (info == null ? void 0 : info.dunderAllInfo) {
|
|
33127
33171
|
info.dunderAllInfo = void 0;
|
|
33128
33172
|
}
|
|
33129
|
-
if (info == null ? void 0 : info.typeParamSymbol) {
|
|
33130
|
-
info.typeParamSymbol = void 0;
|
|
33131
|
-
}
|
|
33132
33173
|
}
|
|
33133
33174
|
function getImportInfo(node) {
|
|
33134
33175
|
const info = getAnalyzerInfo(node);
|
|
@@ -33993,6 +34034,8 @@ var require_parseTreeUtils = __commonJS({
|
|
|
33993
34034
|
exports2.checkDecorator = checkDecorator;
|
|
33994
34035
|
exports2.isSimpleDefault = isSimpleDefault;
|
|
33995
34036
|
exports2.getPreviousNonWhitespaceToken = getPreviousNonWhitespaceToken;
|
|
34037
|
+
exports2.getNextNonWhitespaceToken = getNextNonWhitespaceToken;
|
|
34038
|
+
exports2.getNextMatchingToken = getNextMatchingToken;
|
|
33996
34039
|
var AnalyzerNodeInfo = __importStar(require_analyzerNodeInfo());
|
|
33997
34040
|
var core_1 = require_core();
|
|
33998
34041
|
var debug_1 = require_debug();
|
|
@@ -36126,6 +36169,23 @@ var require_parseTreeUtils = __commonJS({
|
|
|
36126
36169
|
}
|
|
36127
36170
|
return void 0;
|
|
36128
36171
|
}
|
|
36172
|
+
function getNextNonWhitespaceToken(tokens, offset) {
|
|
36173
|
+
return getNextMatchingToken(tokens, offset, (token) => !isWhitespace(token));
|
|
36174
|
+
}
|
|
36175
|
+
function getNextMatchingToken(tokens, offset, match2, exit = () => false) {
|
|
36176
|
+
let tokenIndex = tokens.getItemAtPosition(offset) + 1;
|
|
36177
|
+
while (tokenIndex < tokens.count) {
|
|
36178
|
+
const token = tokens.getItemAt(tokenIndex);
|
|
36179
|
+
if (match2(token)) {
|
|
36180
|
+
return token;
|
|
36181
|
+
}
|
|
36182
|
+
if (exit(token)) {
|
|
36183
|
+
return void 0;
|
|
36184
|
+
}
|
|
36185
|
+
tokenIndex += 1;
|
|
36186
|
+
}
|
|
36187
|
+
return void 0;
|
|
36188
|
+
}
|
|
36129
36189
|
}
|
|
36130
36190
|
});
|
|
36131
36191
|
|
|
@@ -41154,6 +41214,7 @@ var require_tokenizer = __commonJS({
|
|
|
41154
41214
|
exports2.Tokenizer = void 0;
|
|
41155
41215
|
var parseTreeUtils_1 = require_parseTreeUtils();
|
|
41156
41216
|
var sourceFile_1 = require_sourceFile();
|
|
41217
|
+
var core_1 = require_core();
|
|
41157
41218
|
var textRangeCollection_1 = require_textRangeCollection();
|
|
41158
41219
|
var characters_1 = require_characters();
|
|
41159
41220
|
var characterStream_1 = require_characterStream();
|
|
@@ -42024,7 +42085,7 @@ var require_tokenizer = __commonJS({
|
|
|
42024
42085
|
if (_keywords.has(value)) {
|
|
42025
42086
|
this._tokens.push(tokenizerTypes_1.KeywordToken.create(start, this._cs.position - start, _keywords.get(value), this._getComments()));
|
|
42026
42087
|
} else {
|
|
42027
|
-
this._tokens.push(tokenizerTypes_1.IdentifierToken.create(start, this._cs.position - start, value, this._getComments()));
|
|
42088
|
+
this._tokens.push(tokenizerTypes_1.IdentifierToken.create(start, this._cs.position - start, (0, core_1.cloneStr)(value), this._getComments()));
|
|
42028
42089
|
}
|
|
42029
42090
|
return true;
|
|
42030
42091
|
}
|
|
@@ -42361,7 +42422,7 @@ var require_tokenizer = __commonJS({
|
|
|
42361
42422
|
if (endTrimmed.length > 0) {
|
|
42362
42423
|
commentRules.push({
|
|
42363
42424
|
range: { start: currentOffset, length: endTrimmed.length },
|
|
42364
|
-
text: endTrimmed
|
|
42425
|
+
text: (0, core_1.cloneStr)(endTrimmed)
|
|
42365
42426
|
});
|
|
42366
42427
|
}
|
|
42367
42428
|
currentOffset += frontTrimmed.length + 1;
|
|
@@ -43613,7 +43674,7 @@ var require_binder = __commonJS({
|
|
|
43613
43674
|
var _a;
|
|
43614
43675
|
const isBuiltInModule = this._fileInfo.builtinsScope === void 0;
|
|
43615
43676
|
this._addTypingImportAliasesFromBuiltinsScope();
|
|
43616
|
-
this._createNewScope(
|
|
43677
|
+
const moduleScope = this._createNewScope(
|
|
43617
43678
|
isBuiltInModule ? 5 : 4,
|
|
43618
43679
|
this._fileInfo.builtinsScope,
|
|
43619
43680
|
/* proxyScope */
|
|
@@ -43625,7 +43686,7 @@ var require_binder = __commonJS({
|
|
|
43625
43686
|
this._addImplicitSymbolToCurrentScope("__loader__", node, "Any");
|
|
43626
43687
|
this._addImplicitSymbolToCurrentScope("__package__", node, "str | None");
|
|
43627
43688
|
this._addImplicitSymbolToCurrentScope("__spec__", node, "Any");
|
|
43628
|
-
this._addImplicitSymbolToCurrentScope("__path__", node, "
|
|
43689
|
+
this._addImplicitSymbolToCurrentScope("__path__", node, "MutableSequence[str]");
|
|
43629
43690
|
this._addImplicitSymbolToCurrentScope("__file__", node, "str");
|
|
43630
43691
|
this._addImplicitSymbolToCurrentScope("__cached__", node, "str");
|
|
43631
43692
|
this._addImplicitSymbolToCurrentScope("__dict__", node, "Dict[str, Any]");
|
|
@@ -43640,16 +43701,22 @@ var require_binder = __commonJS({
|
|
|
43640
43701
|
}
|
|
43641
43702
|
);
|
|
43642
43703
|
this._bindDeferred();
|
|
43643
|
-
this.
|
|
43644
|
-
|
|
43645
|
-
|
|
43646
|
-
|
|
43647
|
-
|
|
43648
|
-
|
|
43649
|
-
|
|
43704
|
+
if (this._fileInfo.isModulePrivate) {
|
|
43705
|
+
moduleScope.symbolTable.forEach((symbol) => {
|
|
43706
|
+
symbol.setPrivatePyTypedImport();
|
|
43707
|
+
});
|
|
43708
|
+
} else {
|
|
43709
|
+
this._potentialHiddenSymbols.forEach((symbol, name) => {
|
|
43710
|
+
var _a2;
|
|
43711
|
+
if (!((_a2 = this._dunderAllNames) == null ? void 0 : _a2.some((sym) => sym === name))) {
|
|
43712
|
+
if (this._fileInfo.isStubFile) {
|
|
43713
|
+
symbol.setIsExternallyHidden();
|
|
43714
|
+
} else {
|
|
43715
|
+
symbol.setPrivatePyTypedImport();
|
|
43716
|
+
}
|
|
43650
43717
|
}
|
|
43651
|
-
}
|
|
43652
|
-
}
|
|
43718
|
+
});
|
|
43719
|
+
}
|
|
43653
43720
|
this._potentialPrivateSymbols.forEach((symbol, name) => {
|
|
43654
43721
|
var _a2;
|
|
43655
43722
|
if (!((_a2 = this._dunderAllNames) == null ? void 0 : _a2.some((sym) => sym === name))) {
|
|
@@ -43685,6 +43752,7 @@ var require_binder = __commonJS({
|
|
|
43685
43752
|
return false;
|
|
43686
43753
|
}
|
|
43687
43754
|
visitModuleName(node) {
|
|
43755
|
+
var _a;
|
|
43688
43756
|
const importResult = AnalyzerNodeInfo.getImportInfo(node);
|
|
43689
43757
|
(0, debug_1.assert)(importResult !== void 0);
|
|
43690
43758
|
if (importResult.isNativeLib) {
|
|
@@ -43697,7 +43765,19 @@ var require_binder = __commonJS({
|
|
|
43697
43765
|
}), node);
|
|
43698
43766
|
return true;
|
|
43699
43767
|
}
|
|
43768
|
+
let reportStubMissing = false;
|
|
43700
43769
|
if (!importResult.isStubFile && importResult.importType === 1 && !importResult.pyTypedInfo) {
|
|
43770
|
+
reportStubMissing = true;
|
|
43771
|
+
if (importResult.isNamespacePackage && ((_a = node.parent) == null ? void 0 : _a.nodeType) === 25) {
|
|
43772
|
+
if (node.parent.d.imports.every((importAs) => {
|
|
43773
|
+
const implicitImport = importResult.filteredImplicitImports.get(importAs.d.name.d.value);
|
|
43774
|
+
return !!(implicitImport == null ? void 0 : implicitImport.pyTypedInfo);
|
|
43775
|
+
})) {
|
|
43776
|
+
reportStubMissing = false;
|
|
43777
|
+
}
|
|
43778
|
+
}
|
|
43779
|
+
}
|
|
43780
|
+
if (reportStubMissing) {
|
|
43701
43781
|
const diagnostic = this._addDiagnostic(diagnosticRules_1.DiagnosticRule.reportMissingTypeStubs, localize_1.LocMessage.stubFileMissing().format({ importName: importResult.importName }), node);
|
|
43702
43782
|
if (diagnostic) {
|
|
43703
43783
|
const createTypeStubAction = {
|
|
@@ -47567,6 +47647,15 @@ var require_types = __commonJS({
|
|
|
47567
47647
|
}
|
|
47568
47648
|
return true;
|
|
47569
47649
|
}
|
|
47650
|
+
const subclassDepth = TypeBase.getInstantiableDepth(subclassType);
|
|
47651
|
+
if (subclassDepth > 0) {
|
|
47652
|
+
if (isBuiltIn(parentClassType, "type") && TypeBase.getInstantiableDepth(parentClassType) < subclassDepth) {
|
|
47653
|
+
if (inheritanceChain) {
|
|
47654
|
+
inheritanceChain.push(parentClassType);
|
|
47655
|
+
}
|
|
47656
|
+
return true;
|
|
47657
|
+
}
|
|
47658
|
+
}
|
|
47570
47659
|
if (ClassType2.isBuiltIn(subclassType, "property") && ClassType2.isBuiltIn(parentClassType, "property")) {
|
|
47571
47660
|
if (inheritanceChain) {
|
|
47572
47661
|
inheritanceChain.push(subclassType);
|
|
@@ -47712,16 +47801,14 @@ var require_types = __commonJS({
|
|
|
47712
47801
|
if (stripFirstParam) {
|
|
47713
47802
|
if (type.shared.parameters.length > 0) {
|
|
47714
47803
|
if (type.shared.parameters[0].category === 0) {
|
|
47715
|
-
if (type.shared.parameters.length > 0
|
|
47716
|
-
newFunction.priv.strippedFirstParamType = getParamType(type, 0);
|
|
47804
|
+
if (type.shared.parameters.length > 0) {
|
|
47805
|
+
newFunction.priv.strippedFirstParamType = FunctionParam.isTypeInferred(type.shared.parameters[0]) ? AnyType.create() : getParamType(type, 0);
|
|
47717
47806
|
}
|
|
47718
47807
|
newFunction.shared.parameters = type.shared.parameters.slice(1);
|
|
47719
47808
|
}
|
|
47720
47809
|
} else {
|
|
47721
47810
|
stripFirstParam = false;
|
|
47722
47811
|
}
|
|
47723
|
-
newFunction.shared.flags &= ~(1 | 2);
|
|
47724
|
-
newFunction.shared.flags |= 4;
|
|
47725
47812
|
}
|
|
47726
47813
|
if ((_a = type.props) == null ? void 0 : _a.typeAliasInfo) {
|
|
47727
47814
|
TypeBase.setTypeAliasInfo(newFunction, type.props.typeAliasInfo);
|
|
@@ -47733,7 +47820,7 @@ var require_types = __commonJS({
|
|
|
47733
47820
|
returnType: type.priv.specializedTypes.returnType
|
|
47734
47821
|
};
|
|
47735
47822
|
}
|
|
47736
|
-
newFunction.
|
|
47823
|
+
newFunction.shared.inferredReturnType = type.shared.inferredReturnType;
|
|
47737
47824
|
return newFunction;
|
|
47738
47825
|
}
|
|
47739
47826
|
FunctionType2.clone = clone;
|
|
@@ -47766,20 +47853,13 @@ var require_types = __commonJS({
|
|
|
47766
47853
|
return newInstance;
|
|
47767
47854
|
}
|
|
47768
47855
|
FunctionType2.cloneAsInstantiable = cloneAsInstantiable;
|
|
47769
|
-
function specialize(type, specializedTypes
|
|
47770
|
-
var _a;
|
|
47856
|
+
function specialize(type, specializedTypes) {
|
|
47771
47857
|
const newFunction = TypeBase.cloneType(type);
|
|
47772
47858
|
(0, debug_1.assert)(specializedTypes.parameterTypes.length === type.shared.parameters.length);
|
|
47773
47859
|
if (specializedTypes.parameterDefaultTypes) {
|
|
47774
47860
|
(0, debug_1.assert)(specializedTypes.parameterDefaultTypes.length === type.shared.parameters.length);
|
|
47775
47861
|
}
|
|
47776
47862
|
newFunction.priv.specializedTypes = specializedTypes;
|
|
47777
|
-
if (specializedInferredReturnType) {
|
|
47778
|
-
newFunction.priv.inferredReturnType = {
|
|
47779
|
-
type: specializedInferredReturnType,
|
|
47780
|
-
isIncomplete: (_a = type.priv.inferredReturnType) == null ? void 0 : _a.isIncomplete
|
|
47781
|
-
};
|
|
47782
|
-
}
|
|
47783
47863
|
return newFunction;
|
|
47784
47864
|
}
|
|
47785
47865
|
FunctionType2.specialize = specialize;
|
|
@@ -47895,8 +47975,8 @@ var require_types = __commonJS({
|
|
|
47895
47975
|
newFunction.priv.specializedTypes.parameterDefaultTypes = newFunction.priv.specializedTypes.parameterDefaultTypes.slice(0, newFunction.priv.specializedTypes.parameterDefaultTypes.length - paramsToDrop);
|
|
47896
47976
|
}
|
|
47897
47977
|
}
|
|
47898
|
-
if (type.
|
|
47899
|
-
newFunction.
|
|
47978
|
+
if (type.shared.inferredReturnType) {
|
|
47979
|
+
newFunction.shared.inferredReturnType = type.shared.inferredReturnType;
|
|
47900
47980
|
}
|
|
47901
47981
|
return newFunction;
|
|
47902
47982
|
}
|
|
@@ -48095,7 +48175,7 @@ var require_types = __commonJS({
|
|
|
48095
48175
|
return type.shared.declaredReturnType;
|
|
48096
48176
|
}
|
|
48097
48177
|
if (includeInferred) {
|
|
48098
|
-
return (_b = type.
|
|
48178
|
+
return (_b = type.shared.inferredReturnType) == null ? void 0 : _b.type;
|
|
48099
48179
|
}
|
|
48100
48180
|
return void 0;
|
|
48101
48181
|
}
|
|
@@ -48881,15 +48961,15 @@ var require_types = __commonJS({
|
|
|
48881
48961
|
if (type1.priv.specializedTypes && type1.priv.specializedTypes.returnType) {
|
|
48882
48962
|
return1Type = type1.priv.specializedTypes.returnType;
|
|
48883
48963
|
}
|
|
48884
|
-
if (!return1Type && type1.
|
|
48885
|
-
return1Type = (_e = type1.
|
|
48964
|
+
if (!return1Type && type1.shared.inferredReturnType) {
|
|
48965
|
+
return1Type = (_e = type1.shared.inferredReturnType) == null ? void 0 : _e.type;
|
|
48886
48966
|
}
|
|
48887
48967
|
let return2Type = functionType2.shared.declaredReturnType;
|
|
48888
48968
|
if (functionType2.priv.specializedTypes && functionType2.priv.specializedTypes.returnType) {
|
|
48889
48969
|
return2Type = functionType2.priv.specializedTypes.returnType;
|
|
48890
48970
|
}
|
|
48891
|
-
if (!return2Type && functionType2.
|
|
48892
|
-
return2Type = (_f = functionType2.
|
|
48971
|
+
if (!return2Type && functionType2.shared.inferredReturnType) {
|
|
48972
|
+
return2Type = (_f = functionType2.shared.inferredReturnType) == null ? void 0 : _f.type;
|
|
48893
48973
|
}
|
|
48894
48974
|
if (return1Type || return2Type) {
|
|
48895
48975
|
if (!return1Type || !return2Type || !isTypeSame(return1Type, return2Type, { ...options, ignoreTypeFlags: false }, recursionCount)) {
|
|
@@ -49422,7 +49502,7 @@ var require_typeWalker = __commonJS({
|
|
|
49422
49502
|
}
|
|
49423
49503
|
}
|
|
49424
49504
|
if (!this._isWalkCanceled && !types_1.FunctionType.isParamSpecValue(type) && !types_1.FunctionType.isParamSpecValue(type)) {
|
|
49425
|
-
const returnType = type.shared.declaredReturnType ?? ((_a = type.
|
|
49505
|
+
const returnType = type.shared.declaredReturnType ?? ((_a = type.shared.inferredReturnType) == null ? void 0 : _a.type);
|
|
49426
49506
|
if (returnType) {
|
|
49427
49507
|
this.walk(returnType);
|
|
49428
49508
|
}
|
|
@@ -51531,8 +51611,8 @@ var require_typeUtils = __commonJS({
|
|
|
51531
51611
|
if (requiresSpecialization(declaredReturnType, options, recursionCount)) {
|
|
51532
51612
|
return true;
|
|
51533
51613
|
}
|
|
51534
|
-
} else if (type.
|
|
51535
|
-
if (requiresSpecialization((_b = type.
|
|
51614
|
+
} else if (type.shared.inferredReturnType) {
|
|
51615
|
+
if (requiresSpecialization((_b = type.shared.inferredReturnType) == null ? void 0 : _b.type, options, recursionCount)) {
|
|
51536
51616
|
return true;
|
|
51537
51617
|
}
|
|
51538
51618
|
}
|
|
@@ -52114,9 +52194,10 @@ var require_typeUtils = __commonJS({
|
|
|
52114
52194
|
}
|
|
52115
52195
|
}
|
|
52116
52196
|
let specializedInferredReturnType;
|
|
52117
|
-
if (functionType.
|
|
52118
|
-
specializedInferredReturnType = this.apply((_a = functionType.
|
|
52119
|
-
if (specializedInferredReturnType !== ((_b = functionType.
|
|
52197
|
+
if (functionType.shared.inferredReturnType) {
|
|
52198
|
+
specializedInferredReturnType = this.apply((_a = functionType.shared.inferredReturnType) == null ? void 0 : _a.type, recursionCount);
|
|
52199
|
+
if (specializedInferredReturnType !== ((_b = functionType.shared.inferredReturnType) == null ? void 0 : _b.type)) {
|
|
52200
|
+
specializedParams.returnType = specializedInferredReturnType;
|
|
52120
52201
|
typesRequiredSpecialization = true;
|
|
52121
52202
|
}
|
|
52122
52203
|
}
|
|
@@ -52131,7 +52212,7 @@ var require_typeUtils = __commonJS({
|
|
|
52131
52212
|
);
|
|
52132
52213
|
}
|
|
52133
52214
|
}
|
|
52134
|
-
if (functionType.priv.strippedFirstParamType) {
|
|
52215
|
+
if (functionType.priv.strippedFirstParamType && !(0, types_1.isAnyOrUnknown)(functionType.priv.strippedFirstParamType)) {
|
|
52135
52216
|
const newStrippedType = this.apply(functionType.priv.strippedFirstParamType, recursionCount);
|
|
52136
52217
|
if (newStrippedType !== functionType.priv.strippedFirstParamType) {
|
|
52137
52218
|
functionType = types_1.TypeBase.cloneType(functionType);
|
|
@@ -52145,7 +52226,7 @@ var require_typeUtils = __commonJS({
|
|
|
52145
52226
|
specializedParams.parameterDefaultTypes = specializedDefaultArgs;
|
|
52146
52227
|
}
|
|
52147
52228
|
if (!variadicTypesToUnpack) {
|
|
52148
|
-
return types_1.FunctionType.specialize(functionType, specializedParams
|
|
52229
|
+
return types_1.FunctionType.specialize(functionType, specializedParams);
|
|
52149
52230
|
}
|
|
52150
52231
|
const newFunctionType = types_1.TypeBase.isInstantiable(functionType) ? types_1.FunctionType.createInstantiable(
|
|
52151
52232
|
functionType.shared.flags | 64
|
|
@@ -54543,7 +54624,7 @@ var require_constraintSolver = __commonJS({
|
|
|
54543
54624
|
}
|
|
54544
54625
|
if (destType.shared.boundType) {
|
|
54545
54626
|
const updatedType = newLowerBound || newUpperBound;
|
|
54546
|
-
if (types_1.TypeBase.isInstantiable(destType) && !(0, typeUtils_1.isEffectivelyInstantiable)(srcType)) {
|
|
54627
|
+
if (types_1.TypeBase.isInstantiable(destType) && !(0, typeUtils_1.isEffectivelyInstantiable)(srcType, { honorTypeVarBounds: true })) {
|
|
54547
54628
|
return false;
|
|
54548
54629
|
}
|
|
54549
54630
|
const effectiveConstraints = types_1.TypeVarType.isSelf(destType) ? constraints : void 0;
|
|
@@ -54868,11 +54949,12 @@ var require_parameterUtils = __commonJS({
|
|
|
54868
54949
|
"node_modules/@zzzen/pyright-internal/dist/analyzer/parameterUtils.js"(exports2) {
|
|
54869
54950
|
"use strict";
|
|
54870
54951
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
54871
|
-
exports2.ParamKind = void 0;
|
|
54952
|
+
exports2.ParamAssignmentTracker = exports2.ParamKind = void 0;
|
|
54872
54953
|
exports2.isTypedKwargs = isTypedKwargs;
|
|
54873
54954
|
exports2.getParamListDetails = getParamListDetails;
|
|
54874
54955
|
exports2.isParamSpecArgs = isParamSpecArgs;
|
|
54875
54956
|
exports2.isParamSpecKwargs = isParamSpecKwargs;
|
|
54957
|
+
var debug_1 = require_debug();
|
|
54876
54958
|
var symbolNameUtils_1 = require_symbolNameUtils();
|
|
54877
54959
|
var types_1 = require_types();
|
|
54878
54960
|
var typeUtils_1 = require_typeUtils();
|
|
@@ -55044,7 +55126,7 @@ var require_parameterUtils = __commonJS({
|
|
|
55044
55126
|
}
|
|
55045
55127
|
});
|
|
55046
55128
|
result.paramSpec = types_1.FunctionType.getParamSpecFromArgsKwargs(type);
|
|
55047
|
-
result.firstPositionOrKeywordIndex = result.params.findIndex((p) => p.kind !== ParamKind.Positional);
|
|
55129
|
+
result.firstPositionOrKeywordIndex = result.params.findIndex((p) => p.kind !== ParamKind.Positional && p.kind !== ParamKind.ExpandedArgs);
|
|
55048
55130
|
if (result.firstPositionOrKeywordIndex < 0) {
|
|
55049
55131
|
result.firstPositionOrKeywordIndex = result.params.length;
|
|
55050
55132
|
}
|
|
@@ -55082,6 +55164,60 @@ var require_parameterUtils = __commonJS({
|
|
|
55082
55164
|
});
|
|
55083
55165
|
return isCompatible;
|
|
55084
55166
|
}
|
|
55167
|
+
var ParamAssignmentTracker = class {
|
|
55168
|
+
constructor(paramInfos) {
|
|
55169
|
+
this.params = paramInfos.map((p) => {
|
|
55170
|
+
const argsNeeded = !!p.defaultType || p.param.category !== 0 ? 0 : 1;
|
|
55171
|
+
return { paramDetails: p, argsNeeded, argsReceived: 0 };
|
|
55172
|
+
});
|
|
55173
|
+
}
|
|
55174
|
+
// Add a virtual keyword parameter for a keyword argument that
|
|
55175
|
+
// targets a **kwargs parameter. This allows us to detect duplicate
|
|
55176
|
+
// keyword arguments.
|
|
55177
|
+
addKeywordParam(name, info) {
|
|
55178
|
+
this.params.push({
|
|
55179
|
+
paramDetails: info,
|
|
55180
|
+
keywordName: name,
|
|
55181
|
+
argsNeeded: 1,
|
|
55182
|
+
argsReceived: 1
|
|
55183
|
+
});
|
|
55184
|
+
}
|
|
55185
|
+
lookupName(name) {
|
|
55186
|
+
return this.params.find((p) => {
|
|
55187
|
+
const kind = p.paramDetails.kind;
|
|
55188
|
+
if (kind === ParamKind.Positional || kind === ParamKind.ExpandedArgs) {
|
|
55189
|
+
return false;
|
|
55190
|
+
}
|
|
55191
|
+
const effectiveName = p.keywordName ?? p.paramDetails.param.name;
|
|
55192
|
+
return effectiveName === name;
|
|
55193
|
+
});
|
|
55194
|
+
}
|
|
55195
|
+
lookupDetails(paramInfo) {
|
|
55196
|
+
const info = this.params.find((p) => p.paramDetails === paramInfo);
|
|
55197
|
+
(0, debug_1.assert)(info !== void 0);
|
|
55198
|
+
return info;
|
|
55199
|
+
}
|
|
55200
|
+
markArgReceived(paramInfo) {
|
|
55201
|
+
const entry = this.lookupDetails(paramInfo);
|
|
55202
|
+
entry.argsReceived++;
|
|
55203
|
+
}
|
|
55204
|
+
// Returns a list of params that have not received their
|
|
55205
|
+
// required number of arguments.
|
|
55206
|
+
getUnassignedParams() {
|
|
55207
|
+
const unassignedParams = [];
|
|
55208
|
+
this.params.forEach((p) => {
|
|
55209
|
+
if (!p.paramDetails.param.name) {
|
|
55210
|
+
return;
|
|
55211
|
+
}
|
|
55212
|
+
if (p.argsReceived >= p.argsNeeded) {
|
|
55213
|
+
return;
|
|
55214
|
+
}
|
|
55215
|
+
unassignedParams.push(p.paramDetails.param.name);
|
|
55216
|
+
});
|
|
55217
|
+
return unassignedParams;
|
|
55218
|
+
}
|
|
55219
|
+
};
|
|
55220
|
+
exports2.ParamAssignmentTracker = ParamAssignmentTracker;
|
|
55085
55221
|
}
|
|
55086
55222
|
});
|
|
55087
55223
|
|
|
@@ -56521,7 +56657,7 @@ var require_constructorTransform = __commonJS({
|
|
|
56521
56657
|
newParamList.forEach((param) => {
|
|
56522
56658
|
types_1.FunctionType.addParam(newCallMemberType, param);
|
|
56523
56659
|
});
|
|
56524
|
-
newCallMemberType.shared.declaredReturnType = specializedFunctionType.shared.declaredReturnType ? types_1.FunctionType.getEffectiveReturnType(specializedFunctionType) : (_a = specializedFunctionType.
|
|
56660
|
+
newCallMemberType.shared.declaredReturnType = specializedFunctionType.shared.declaredReturnType ? types_1.FunctionType.getEffectiveReturnType(specializedFunctionType) : (_a = specializedFunctionType.shared.inferredReturnType) == null ? void 0 : _a.type;
|
|
56525
56661
|
newCallMemberType.shared.declaration = partialCallMemberType.shared.declaration;
|
|
56526
56662
|
newCallMemberType.shared.typeVarScopeId = specializedFunctionType.shared.typeVarScopeId;
|
|
56527
56663
|
return { returnType: newCallMemberType, isTypeIncomplete: false, argumentErrors };
|
|
@@ -57185,7 +57321,7 @@ var require_constructors = __commonJS({
|
|
|
57185
57321
|
return skipInitCheck;
|
|
57186
57322
|
}
|
|
57187
57323
|
function isDefaultNewMethod(newMethod) {
|
|
57188
|
-
var _a;
|
|
57324
|
+
var _a, _b;
|
|
57189
57325
|
if (!newMethod || !(0, types_1.isFunction)(newMethod)) {
|
|
57190
57326
|
return false;
|
|
57191
57327
|
}
|
|
@@ -57196,7 +57332,12 @@ var require_constructors = __commonJS({
|
|
|
57196
57332
|
if (params[0].category !== 1 || params[1].category !== 2) {
|
|
57197
57333
|
return false;
|
|
57198
57334
|
}
|
|
57199
|
-
|
|
57335
|
+
let returnType;
|
|
57336
|
+
if (newMethod.shared.declaredReturnType) {
|
|
57337
|
+
returnType = newMethod.shared.declaredReturnType;
|
|
57338
|
+
} else {
|
|
57339
|
+
returnType = ((_a = newMethod.priv.specializedTypes) == null ? void 0 : _a.returnType) ?? ((_b = newMethod.shared.inferredReturnType) == null ? void 0 : _b.type);
|
|
57340
|
+
}
|
|
57200
57341
|
if (!returnType || !(0, types_1.isTypeVar)(returnType) || !types_1.TypeVarType.isSelf(returnType)) {
|
|
57201
57342
|
return false;
|
|
57202
57343
|
}
|
|
@@ -59895,8 +60036,23 @@ var require_typeGuards = __commonJS({
|
|
|
59895
60036
|
} else {
|
|
59896
60037
|
filteredTypes.push((0, typeUtils_1.convertToInstance)(filterType));
|
|
59897
60038
|
}
|
|
59898
|
-
} else
|
|
59899
|
-
|
|
60039
|
+
} else {
|
|
60040
|
+
const filterTypeInstance = (0, typeUtils_1.convertToInstance)(convertVarTypeToFree(concreteFilterType));
|
|
60041
|
+
if (evaluator.assignType(filterTypeInstance, varType)) {
|
|
60042
|
+
filteredTypes.push((0, typeUtils_1.convertToInstance)(varType));
|
|
60043
|
+
} else {
|
|
60044
|
+
if ((0, types_1.isClassInstance)(filterTypeInstance) && !types_1.ClassType.isFinal(filterTypeInstance)) {
|
|
60045
|
+
const gradualFunc = types_1.FunctionType.createSynthesizedInstance(
|
|
60046
|
+
"",
|
|
60047
|
+
32768
|
|
60048
|
+
/* FunctionTypeFlags.GradualCallableForm */
|
|
60049
|
+
);
|
|
60050
|
+
types_1.FunctionType.addDefaultParams(gradualFunc);
|
|
60051
|
+
if (!evaluator.assignType(gradualFunc, filterTypeInstance)) {
|
|
60052
|
+
filteredTypes.push((0, typeUtils_1.convertToInstance)(filterType));
|
|
60053
|
+
}
|
|
60054
|
+
}
|
|
60055
|
+
}
|
|
59900
60056
|
}
|
|
59901
60057
|
}
|
|
59902
60058
|
} else {
|
|
@@ -60136,10 +60292,10 @@ var require_typeGuards = __commonJS({
|
|
|
60136
60292
|
if (!evaluator.isTypeComparable(elementSubtype, referenceSubtype)) {
|
|
60137
60293
|
return void 0;
|
|
60138
60294
|
}
|
|
60139
|
-
if ((0, types_1.isClassInstance)(elementSubtype) && ((0, typeUtils_1.
|
|
60295
|
+
if ((0, types_1.isClassInstance)(elementSubtype) && ((0, typeUtils_1.isLiteralLikeType)(elementSubtype) || (0, typeUtils_1.isNoneInstance)(elementSubtype)) && evaluator.assignType(referenceSubtype, elementSubtype)) {
|
|
60140
60296
|
return (0, typeUtils_1.stripTypeForm)((0, typeUtils_1.addConditionToType)(elementSubtype, (_a = referenceSubtype.props) == null ? void 0 : _a.condition));
|
|
60141
60297
|
}
|
|
60142
|
-
if ((0, types_1.isClassInstance)(referenceSubtype) && ((0, typeUtils_1.
|
|
60298
|
+
if ((0, types_1.isClassInstance)(referenceSubtype) && ((0, typeUtils_1.isLiteralLikeType)(referenceSubtype) || (0, typeUtils_1.isNoneInstance)(referenceSubtype)) && evaluator.assignType(elementSubtype, referenceSubtype)) {
|
|
60143
60299
|
return (0, typeUtils_1.stripTypeForm)((0, typeUtils_1.addConditionToType)(referenceSubtype, (_b = elementSubtype.props) == null ? void 0 : _b.condition));
|
|
60144
60300
|
}
|
|
60145
60301
|
if ((0, types_1.isInstantiableClass)(elementSubtype) && !elementSubtype.priv.includeSubclasses && evaluator.assignType(referenceSubtype, elementSubtype)) {
|
|
@@ -60410,24 +60566,29 @@ var require_typeGuards = __commonJS({
|
|
|
60410
60566
|
return literalType;
|
|
60411
60567
|
}
|
|
60412
60568
|
return subtype;
|
|
60413
|
-
}
|
|
60569
|
+
}
|
|
60570
|
+
if ((0, types_1.isClassInstance)(subtype) && types_1.ClassType.isSameGenericClass(literalType, subtype)) {
|
|
60414
60571
|
if (subtype.priv.literalValue !== void 0) {
|
|
60415
60572
|
const literalValueMatches = types_1.ClassType.isLiteralValueSame(subtype, literalType);
|
|
60416
60573
|
if (isPositiveTest) {
|
|
60417
60574
|
return literalValueMatches ? subtype : void 0;
|
|
60418
|
-
} else {
|
|
60419
|
-
const isEnumOrBool = types_1.ClassType.isEnumClass(literalType) || types_1.ClassType.isBuiltIn(literalType, "bool");
|
|
60420
|
-
return literalValueMatches && (isEnumOrBool || !isIsOperator) ? void 0 : subtype;
|
|
60421
60575
|
}
|
|
60422
|
-
|
|
60576
|
+
const isEnumOrBool = types_1.ClassType.isEnumClass(literalType) || types_1.ClassType.isBuiltIn(literalType, "bool");
|
|
60577
|
+
return literalValueMatches && (isEnumOrBool || !isIsOperator) ? void 0 : subtype;
|
|
60578
|
+
}
|
|
60579
|
+
if (isPositiveTest) {
|
|
60580
|
+
return literalType;
|
|
60581
|
+
}
|
|
60582
|
+
const allLiteralTypes = enumerateLiteralsForType(evaluator, subtype);
|
|
60583
|
+
if (allLiteralTypes && allLiteralTypes.length > 0) {
|
|
60584
|
+
return (0, types_1.combineTypes)(allLiteralTypes.filter((type) => !types_1.ClassType.isLiteralValueSame(type, literalType)));
|
|
60585
|
+
}
|
|
60586
|
+
return subtype;
|
|
60587
|
+
}
|
|
60588
|
+
if (isPositiveTest) {
|
|
60589
|
+
if ((0, types_1.isClassInstance)(subtype) && types_1.ClassType.isBuiltIn(subtype, "LiteralString")) {
|
|
60423
60590
|
return literalType;
|
|
60424
|
-
} else {
|
|
60425
|
-
const allLiteralTypes = enumerateLiteralsForType(evaluator, subtype);
|
|
60426
|
-
if (allLiteralTypes && allLiteralTypes.length > 0) {
|
|
60427
|
-
return (0, types_1.combineTypes)(allLiteralTypes.filter((type) => !types_1.ClassType.isLiteralValueSame(type, literalType)));
|
|
60428
|
-
}
|
|
60429
60591
|
}
|
|
60430
|
-
} else if (isPositiveTest) {
|
|
60431
60592
|
if (isIsOperator || (0, typeUtils_1.isNoneInstance)(subtype)) {
|
|
60432
60593
|
const isSubtype = evaluator.assignType(subtype, literalType);
|
|
60433
60594
|
return isSubtype ? literalType : void 0;
|
|
@@ -61595,7 +61756,7 @@ var require_importResolver = __commonJS({
|
|
|
61595
61756
|
return result;
|
|
61596
61757
|
};
|
|
61597
61758
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
61598
|
-
exports2.ImportResolver = exports2.supportedFileExtensions = void 0;
|
|
61759
|
+
exports2.ImportResolver = exports2.supportedFileExtensions = exports2.supportedSourceFileExtensions = void 0;
|
|
61599
61760
|
exports2.createImportedModuleDescriptor = createImportedModuleDescriptor;
|
|
61600
61761
|
exports2.formatImportName = formatImportName;
|
|
61601
61762
|
exports2.getParentImportResolutionRoot = getParentImportResolutionRoot;
|
|
@@ -61606,7 +61767,6 @@ var require_importResolver = __commonJS({
|
|
|
61606
61767
|
var pathConsts_1 = require_pathConsts();
|
|
61607
61768
|
var pathUtils_1 = require_pathUtils();
|
|
61608
61769
|
var pythonVersion_1 = require_pythonVersion();
|
|
61609
|
-
var serviceKeys_1 = require_serviceKeys();
|
|
61610
61770
|
var StringUtils = __importStar(require_stringUtils());
|
|
61611
61771
|
var stringUtils_1 = require_stringUtils();
|
|
61612
61772
|
var uri_1 = require_uri();
|
|
@@ -61637,8 +61797,8 @@ var require_importResolver = __commonJS({
|
|
|
61637
61797
|
};
|
|
61638
61798
|
}
|
|
61639
61799
|
var supportedNativeLibExtensions = [".pyd", ".so", ".dylib"];
|
|
61640
|
-
|
|
61641
|
-
exports2.supportedFileExtensions = [...supportedSourceFileExtensions, ...supportedNativeLibExtensions];
|
|
61800
|
+
exports2.supportedSourceFileExtensions = [".py", ".pyi"];
|
|
61801
|
+
exports2.supportedFileExtensions = [...exports2.supportedSourceFileExtensions, ...supportedNativeLibExtensions];
|
|
61642
61802
|
var allowPartialResolutionForThirdPartyPackages = false;
|
|
61643
61803
|
var ImportResolver = class _ImportResolver {
|
|
61644
61804
|
constructor(serviceProvider, _configOptions, host) {
|
|
@@ -61659,11 +61819,11 @@ var require_importResolver = __commonJS({
|
|
|
61659
61819
|
return this.serviceProvider.tmp();
|
|
61660
61820
|
}
|
|
61661
61821
|
get partialStubs() {
|
|
61662
|
-
return this.serviceProvider.
|
|
61822
|
+
return this.serviceProvider.partialStubs();
|
|
61663
61823
|
}
|
|
61664
61824
|
static isSupportedImportSourceFile(uri) {
|
|
61665
61825
|
const fileExtension = uri.lastExtension.toLowerCase();
|
|
61666
|
-
return supportedSourceFileExtensions.some((ext2) => fileExtension === ext2);
|
|
61826
|
+
return exports2.supportedSourceFileExtensions.some((ext2) => fileExtension === ext2);
|
|
61667
61827
|
}
|
|
61668
61828
|
static isSupportedImportFile(uri) {
|
|
61669
61829
|
const fileExtension = uri.lastExtension.toLowerCase();
|
|
@@ -62197,6 +62357,7 @@ var require_importResolver = __commonJS({
|
|
|
62197
62357
|
importType: 2,
|
|
62198
62358
|
isStubFile: false,
|
|
62199
62359
|
isNativeLib: false,
|
|
62360
|
+
isModulePrivate: false,
|
|
62200
62361
|
implicitImports: /* @__PURE__ */ new Map(),
|
|
62201
62362
|
filteredImplicitImports: /* @__PURE__ */ new Map(),
|
|
62202
62363
|
nonStubImportResult: void 0
|
|
@@ -62281,6 +62442,7 @@ var require_importResolver = __commonJS({
|
|
|
62281
62442
|
let importType = 0;
|
|
62282
62443
|
let isLocalTypingsFile = false;
|
|
62283
62444
|
let isThirdPartyPyTypedPresent = false;
|
|
62445
|
+
const isModulePrivate = false;
|
|
62284
62446
|
let isTypeshedFile = false;
|
|
62285
62447
|
const importFailureInfo = [];
|
|
62286
62448
|
let moduleNameWithInvalidCharacters;
|
|
@@ -62299,7 +62461,8 @@ var require_importResolver = __commonJS({
|
|
|
62299
62461
|
importType,
|
|
62300
62462
|
isTypeshedFile: true,
|
|
62301
62463
|
isLocalTypingsFile,
|
|
62302
|
-
isThirdPartyPyTypedPresent
|
|
62464
|
+
isThirdPartyPyTypedPresent,
|
|
62465
|
+
isModulePrivate
|
|
62303
62466
|
};
|
|
62304
62467
|
}
|
|
62305
62468
|
}
|
|
@@ -62398,7 +62561,14 @@ var require_importResolver = __commonJS({
|
|
|
62398
62561
|
}
|
|
62399
62562
|
}
|
|
62400
62563
|
if (moduleName) {
|
|
62401
|
-
return {
|
|
62564
|
+
return {
|
|
62565
|
+
moduleName,
|
|
62566
|
+
importType,
|
|
62567
|
+
isTypeshedFile,
|
|
62568
|
+
isLocalTypingsFile,
|
|
62569
|
+
isThirdPartyPyTypedPresent,
|
|
62570
|
+
isModulePrivate
|
|
62571
|
+
};
|
|
62402
62572
|
}
|
|
62403
62573
|
if (allowInvalidModuleName && moduleNameWithInvalidCharacters) {
|
|
62404
62574
|
return {
|
|
@@ -62406,7 +62576,8 @@ var require_importResolver = __commonJS({
|
|
|
62406
62576
|
isTypeshedFile,
|
|
62407
62577
|
importType,
|
|
62408
62578
|
isLocalTypingsFile,
|
|
62409
|
-
isThirdPartyPyTypedPresent
|
|
62579
|
+
isThirdPartyPyTypedPresent,
|
|
62580
|
+
isModulePrivate
|
|
62410
62581
|
};
|
|
62411
62582
|
}
|
|
62412
62583
|
return {
|
|
@@ -62414,7 +62585,8 @@ var require_importResolver = __commonJS({
|
|
|
62414
62585
|
isTypeshedFile,
|
|
62415
62586
|
importType: 2,
|
|
62416
62587
|
isLocalTypingsFile,
|
|
62417
|
-
isThirdPartyPyTypedPresent
|
|
62588
|
+
isThirdPartyPyTypedPresent,
|
|
62589
|
+
isModulePrivate
|
|
62418
62590
|
};
|
|
62419
62591
|
}
|
|
62420
62592
|
_invalidateFileSystemCache() {
|
|
@@ -62438,6 +62610,7 @@ var require_importResolver = __commonJS({
|
|
|
62438
62610
|
let implicitImports = /* @__PURE__ */ new Map();
|
|
62439
62611
|
let packageDirectory;
|
|
62440
62612
|
let pyTypedInfo;
|
|
62613
|
+
let isModulePrivate = false;
|
|
62441
62614
|
if (moduleDescriptor.nameParts.length === 0) {
|
|
62442
62615
|
const pyFilePath = dirPath.initPyUri;
|
|
62443
62616
|
const pyiFilePath = dirPath.initPyiUri;
|
|
@@ -62458,7 +62631,11 @@ var require_importResolver = __commonJS({
|
|
|
62458
62631
|
for (let i = 0; i < moduleDescriptor.nameParts.length; i++) {
|
|
62459
62632
|
const isFirstPart = i === 0;
|
|
62460
62633
|
const isLastPart = i === moduleDescriptor.nameParts.length - 1;
|
|
62461
|
-
|
|
62634
|
+
const namePart = moduleDescriptor.nameParts[i];
|
|
62635
|
+
dirPath = dirPath.combinePaths(namePart);
|
|
62636
|
+
if (SymbolNameUtils.isProtectedName(namePart)) {
|
|
62637
|
+
isModulePrivate = true;
|
|
62638
|
+
}
|
|
62462
62639
|
if (useStubPackage && isFirstPart) {
|
|
62463
62640
|
dirPath = dirPath.addPath(pathConsts_1.stubsSuffix);
|
|
62464
62641
|
isStubPackage = true;
|
|
@@ -62539,6 +62716,9 @@ var require_importResolver = __commonJS({
|
|
|
62539
62716
|
} else {
|
|
62540
62717
|
importFound = resolvedPaths.length >= moduleDescriptor.nameParts.length;
|
|
62541
62718
|
}
|
|
62719
|
+
if (!isStubFile && !pyTypedInfo) {
|
|
62720
|
+
isModulePrivate = false;
|
|
62721
|
+
}
|
|
62542
62722
|
return {
|
|
62543
62723
|
importName,
|
|
62544
62724
|
isRelative: false,
|
|
@@ -62555,6 +62735,7 @@ var require_importResolver = __commonJS({
|
|
|
62555
62735
|
isNativeLib,
|
|
62556
62736
|
implicitImports,
|
|
62557
62737
|
pyTypedInfo,
|
|
62738
|
+
isModulePrivate,
|
|
62558
62739
|
filteredImplicitImports: implicitImports,
|
|
62559
62740
|
packageDirectory
|
|
62560
62741
|
};
|
|
@@ -64878,11 +65059,7 @@ var require_properties = __commonJS({
|
|
|
64878
65059
|
propertyClass.priv.isAsymmetricDescriptor = false;
|
|
64879
65060
|
updateGetSetDelMethodForClonedProperty(evaluator, propertyObject);
|
|
64880
65061
|
propertyObject.priv.fgetInfo = {
|
|
64881
|
-
methodType:
|
|
64882
|
-
fget,
|
|
64883
|
-
fget.shared.flags | 4
|
|
64884
|
-
/* FunctionTypeFlags.StaticMethod */
|
|
64885
|
-
),
|
|
65062
|
+
methodType: fget,
|
|
64886
65063
|
classType: fget.shared.methodClass
|
|
64887
65064
|
};
|
|
64888
65065
|
if (types_1.FunctionType.isClassMethod(fget)) {
|
|
@@ -64938,11 +65115,7 @@ var require_properties = __commonJS({
|
|
|
64938
65115
|
});
|
|
64939
65116
|
updateGetSetDelMethodForClonedProperty(evaluator, propertyObject);
|
|
64940
65117
|
propertyObject.priv.fsetInfo = {
|
|
64941
|
-
methodType:
|
|
64942
|
-
fset,
|
|
64943
|
-
fset.shared.flags | 4
|
|
64944
|
-
/* FunctionTypeFlags.StaticMethod */
|
|
64945
|
-
),
|
|
65118
|
+
methodType: fset,
|
|
64946
65119
|
classType: fset.shared.methodClass
|
|
64947
65120
|
};
|
|
64948
65121
|
addSetMethodToPropertySymbolTable(evaluator, propertyObject, fset);
|
|
@@ -64972,11 +65145,7 @@ var require_properties = __commonJS({
|
|
|
64972
65145
|
});
|
|
64973
65146
|
updateGetSetDelMethodForClonedProperty(evaluator, propertyObject);
|
|
64974
65147
|
propertyObject.priv.fdelInfo = {
|
|
64975
|
-
methodType:
|
|
64976
|
-
fdel,
|
|
64977
|
-
fdel.shared.flags | 4
|
|
64978
|
-
/* FunctionTypeFlags.StaticMethod */
|
|
64979
|
-
),
|
|
65148
|
+
methodType: fdel,
|
|
64980
65149
|
classType: fdel.shared.methodClass
|
|
64981
65150
|
};
|
|
64982
65151
|
addDelMethodToPropertySymbolTable(evaluator, propertyObject, fdel);
|
|
@@ -65117,7 +65286,7 @@ var require_properties = __commonJS({
|
|
|
65117
65286
|
accessors.forEach((accessorInfo) => {
|
|
65118
65287
|
let destAccessType = accessorInfo.getFunction(destPropertyType);
|
|
65119
65288
|
if (destAccessType && (0, types_1.isFunction)(destAccessType)) {
|
|
65120
|
-
|
|
65289
|
+
const srcAccessType = accessorInfo.getFunction(srcPropertyType);
|
|
65121
65290
|
if (!srcAccessType || !(0, types_1.isFunction)(srcAccessType)) {
|
|
65122
65291
|
diag == null ? void 0 : diag.addMessage(accessorInfo.missingDiagMsg());
|
|
65123
65292
|
isAssignable = false;
|
|
@@ -65128,16 +65297,6 @@ var require_properties = __commonJS({
|
|
|
65128
65297
|
if (selfSolution) {
|
|
65129
65298
|
destAccessType = (0, typeUtils_1.applySolvedTypeVars)(destAccessType, selfSolution);
|
|
65130
65299
|
}
|
|
65131
|
-
destAccessType = types_1.FunctionType.cloneWithNewFlags(
|
|
65132
|
-
destAccessType,
|
|
65133
|
-
destAccessType.shared.flags & ~4
|
|
65134
|
-
/* FunctionTypeFlags.StaticMethod */
|
|
65135
|
-
);
|
|
65136
|
-
srcAccessType = types_1.FunctionType.cloneWithNewFlags(
|
|
65137
|
-
srcAccessType,
|
|
65138
|
-
srcAccessType.shared.flags & ~4
|
|
65139
|
-
/* FunctionTypeFlags.StaticMethod */
|
|
65140
|
-
);
|
|
65141
65300
|
const boundDestAccessType = evaluator.bindFunctionToClassOrObject(
|
|
65142
65301
|
destObjectToBind,
|
|
65143
65302
|
destAccessType,
|
|
@@ -68424,7 +68583,7 @@ var require_operations = __commonJS({
|
|
|
68424
68583
|
}
|
|
68425
68584
|
if (!type) {
|
|
68426
68585
|
if (!isIncomplete) {
|
|
68427
|
-
if (inferenceContext) {
|
|
68586
|
+
if (inferenceContext && !(0, types_1.isAnyOrUnknown)(inferenceContext.expectedType)) {
|
|
68428
68587
|
evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportOperatorIssue, localize_1.LocMessage.typeNotSupportUnaryOperatorBidirectional().format({
|
|
68429
68588
|
operator: (0, parseTreeUtils_1.printOperator)(node.d.operator),
|
|
68430
68589
|
type: evaluator.printType(exprType),
|
|
@@ -68627,10 +68786,13 @@ var require_operations = __commonJS({
|
|
|
68627
68786
|
} else if (operator === 13) {
|
|
68628
68787
|
if (rightLiteralValue !== BigInt(0)) {
|
|
68629
68788
|
newValue = leftLiteralValue / rightLiteralValue;
|
|
68789
|
+
if (newValue * rightLiteralValue !== leftLiteralValue && leftLiteralValue < BigInt(0) !== rightLiteralValue < BigInt(0)) {
|
|
68790
|
+
newValue -= BigInt(1);
|
|
68791
|
+
}
|
|
68630
68792
|
}
|
|
68631
68793
|
} else if (operator === 24) {
|
|
68632
68794
|
if (rightLiteralValue !== BigInt(0)) {
|
|
68633
|
-
newValue = leftLiteralValue % rightLiteralValue;
|
|
68795
|
+
newValue = (leftLiteralValue % rightLiteralValue + rightLiteralValue) % rightLiteralValue;
|
|
68634
68796
|
}
|
|
68635
68797
|
} else if (operator === 29) {
|
|
68636
68798
|
if (rightLiteralValue >= BigInt(0)) {
|
|
@@ -68640,9 +68802,13 @@ var require_operations = __commonJS({
|
|
|
68640
68802
|
}
|
|
68641
68803
|
}
|
|
68642
68804
|
} else if (operator === 17) {
|
|
68643
|
-
|
|
68805
|
+
if (rightLiteralValue >= BigInt(0)) {
|
|
68806
|
+
newValue = leftLiteralValue << rightLiteralValue;
|
|
68807
|
+
}
|
|
68644
68808
|
} else if (operator === 31) {
|
|
68645
|
-
|
|
68809
|
+
if (rightLiteralValue >= BigInt(0)) {
|
|
68810
|
+
newValue = leftLiteralValue >> rightLiteralValue;
|
|
68811
|
+
}
|
|
68646
68812
|
} else if (operator === 3) {
|
|
68647
68813
|
newValue = leftLiteralValue & rightLiteralValue;
|
|
68648
68814
|
} else if (operator === 6) {
|
|
@@ -68813,7 +68979,7 @@ var require_operations = __commonJS({
|
|
|
68813
68979
|
}
|
|
68814
68980
|
}
|
|
68815
68981
|
if (!resultTypeResult) {
|
|
68816
|
-
if (inferenceContext) {
|
|
68982
|
+
if (inferenceContext && !(0, types_1.isAnyOrUnknown)(inferenceContext.expectedType)) {
|
|
68817
68983
|
diag.addMessage(localize_1.LocMessage.typeNotSupportBinaryOperatorBidirectional().format({
|
|
68818
68984
|
operator: (0, parseTreeUtils_1.printOperator)(operator),
|
|
68819
68985
|
leftType: evaluator.printType(leftSubtypeExpanded),
|
|
@@ -68980,6 +69146,8 @@ var require_tuples = __commonJS({
|
|
|
68980
69146
|
type = makeTupleObject(evaluator, evaluator.buildTupleTypesList(
|
|
68981
69147
|
entryTypeResults,
|
|
68982
69148
|
/* stripLiterals */
|
|
69149
|
+
false,
|
|
69150
|
+
/* convertModule */
|
|
68983
69151
|
false
|
|
68984
69152
|
));
|
|
68985
69153
|
}
|
|
@@ -68995,7 +69163,12 @@ var require_tuples = __commonJS({
|
|
|
68995
69163
|
if (node.d.items.length > maxInferredTupleEntryCount) {
|
|
68996
69164
|
return { type: makeTupleObject(evaluator, [{ type: types_1.UnknownType.create(), isUnbounded: true }]) };
|
|
68997
69165
|
}
|
|
68998
|
-
const type = makeTupleObject(evaluator, evaluator.buildTupleTypesList(
|
|
69166
|
+
const type = makeTupleObject(evaluator, evaluator.buildTupleTypesList(
|
|
69167
|
+
entryTypeResults,
|
|
69168
|
+
(flags & 268435456) !== 0,
|
|
69169
|
+
/* convertModule */
|
|
69170
|
+
true
|
|
69171
|
+
));
|
|
68999
69172
|
if (isIncomplete) {
|
|
69000
69173
|
if ((0, typeUtils_1.getContainerDepth)(type) > typeEvaluatorTypes_1.maxInferredContainerDepth) {
|
|
69001
69174
|
return { type: types_1.UnknownType.create() };
|
|
@@ -70390,6 +70563,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
70390
70563
|
exports2.createTypeEvaluator = createTypeEvaluator;
|
|
70391
70564
|
var cancellationUtils_1 = require_cancellationUtils();
|
|
70392
70565
|
var collectionUtils_1 = require_collectionUtils();
|
|
70566
|
+
var core_1 = require_core();
|
|
70393
70567
|
var debug_1 = require_debug();
|
|
70394
70568
|
var diagnostic_1 = require_diagnostic();
|
|
70395
70569
|
var diagnosticRules_1 = require_diagnosticRules();
|
|
@@ -70434,7 +70608,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
70434
70608
|
var TypePrinter = __importStar(require_typePrinter());
|
|
70435
70609
|
var types_1 = require_types();
|
|
70436
70610
|
var typeUtils_1 = require_typeUtils();
|
|
70437
|
-
var core_1 = require_core();
|
|
70438
70611
|
var nonSubscriptableBuiltinTypes = /* @__PURE__ */ new Map([
|
|
70439
70612
|
["asyncio.futures.Future", pythonVersion_1.pythonVersion3_9],
|
|
70440
70613
|
["asyncio.tasks.Task", pythonVersion_1.pythonVersion3_9],
|
|
@@ -70463,6 +70636,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
70463
70636
|
var maxReturnCallSiteTypeInferenceCodeFlowComplexity = 8;
|
|
70464
70637
|
var maxCallSiteReturnTypeCacheSize = 8;
|
|
70465
70638
|
var maxEntriesToUseForInference = 64;
|
|
70639
|
+
var maxReturnTypeInferenceAttempts = 8;
|
|
70466
70640
|
var maxDeclarationsToUseForInference = 64;
|
|
70467
70641
|
var maxEffectiveTypeEvaluationAttempts = 16;
|
|
70468
70642
|
var maxTotalOverloadArgTypeExpansionCount = 256;
|
|
@@ -70487,7 +70661,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
70487
70661
|
let deferredClassCompletions = [];
|
|
70488
70662
|
let cancellationToken;
|
|
70489
70663
|
let printExpressionSpaceCount = 0;
|
|
70490
|
-
let
|
|
70664
|
+
let incompleteGenCount = 0;
|
|
70491
70665
|
const returnTypeInferenceContextStack = [];
|
|
70492
70666
|
let returnTypeInferenceTypeCache;
|
|
70493
70667
|
const signatureTrackerStack = [];
|
|
@@ -70537,7 +70711,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
70537
70711
|
if (!cacheEntry) {
|
|
70538
70712
|
return false;
|
|
70539
70713
|
}
|
|
70540
|
-
return !cacheEntry.typeResult.isIncomplete || cacheEntry.
|
|
70714
|
+
return !cacheEntry.typeResult.isIncomplete || cacheEntry.incompleteGenCount === incompleteGenCount;
|
|
70541
70715
|
}
|
|
70542
70716
|
function readTypeCache(node, flags) {
|
|
70543
70717
|
var _a;
|
|
@@ -70565,18 +70739,18 @@ var require_typeEvaluator = __commonJS({
|
|
|
70565
70739
|
function writeTypeCache(node, typeResult, flags, inferenceContext, allowSpeculativeCaching = false) {
|
|
70566
70740
|
const typeCacheToUse = returnTypeInferenceTypeCache && isNodeInReturnTypeInferenceContext(node) ? returnTypeInferenceTypeCache : typeCache;
|
|
70567
70741
|
if (!typeResult.isIncomplete) {
|
|
70568
|
-
|
|
70742
|
+
incompleteGenCount++;
|
|
70569
70743
|
} else {
|
|
70570
70744
|
const oldValue = typeCacheToUse.get(node.id);
|
|
70571
70745
|
if (oldValue !== void 0 && !(0, types_1.isTypeSame)(typeResult.type, oldValue.typeResult.type)) {
|
|
70572
|
-
|
|
70746
|
+
incompleteGenCount++;
|
|
70573
70747
|
}
|
|
70574
70748
|
}
|
|
70575
|
-
typeCacheToUse.set(node.id, { typeResult, flags,
|
|
70749
|
+
typeCacheToUse.set(node.id, { typeResult, flags, incompleteGenCount });
|
|
70576
70750
|
if (isSpeculativeModeInUse(node)) {
|
|
70577
70751
|
speculativeTypeTracker.trackEntry(typeCacheToUse, node.id);
|
|
70578
70752
|
if (allowSpeculativeCaching) {
|
|
70579
|
-
speculativeTypeTracker.addSpeculativeType(node, typeResult,
|
|
70753
|
+
speculativeTypeTracker.addSpeculativeType(node, typeResult, incompleteGenCount, inferenceContext == null ? void 0 : inferenceContext.expectedType);
|
|
70580
70754
|
}
|
|
70581
70755
|
}
|
|
70582
70756
|
}
|
|
@@ -70790,18 +70964,21 @@ var require_typeEvaluator = __commonJS({
|
|
|
70790
70964
|
}
|
|
70791
70965
|
function getTypeOfExpression(node, flags = 0, inferenceContext) {
|
|
70792
70966
|
const cacheEntry = readTypeCacheEntry(node);
|
|
70793
|
-
if (cacheEntry
|
|
70794
|
-
if (
|
|
70795
|
-
|
|
70967
|
+
if (cacheEntry) {
|
|
70968
|
+
if (!cacheEntry.typeResult.isIncomplete || cacheEntry.incompleteGenCount === incompleteGenCount) {
|
|
70969
|
+
if (printExpressionTypes) {
|
|
70970
|
+
console.log(`${getPrintExpressionTypesSpaces()}${ParseTreeUtils.printExpression(node)} (${getLineNum(node)}): Cached ${printType(cacheEntry.typeResult.type)} ${cacheEntry.typeResult.typeErrors ? " Errors" : ""}`);
|
|
70971
|
+
}
|
|
70972
|
+
return cacheEntry.typeResult;
|
|
70796
70973
|
}
|
|
70797
|
-
|
|
70798
|
-
|
|
70799
|
-
|
|
70800
|
-
if (
|
|
70974
|
+
}
|
|
70975
|
+
const specCacheEntry = speculativeTypeTracker.getSpeculativeType(node, inferenceContext == null ? void 0 : inferenceContext.expectedType);
|
|
70976
|
+
if (specCacheEntry) {
|
|
70977
|
+
if (!specCacheEntry.typeResult.isIncomplete || specCacheEntry.incompleteGenerationCount === incompleteGenCount) {
|
|
70801
70978
|
if (printExpressionTypes) {
|
|
70802
|
-
console.log(`${getPrintExpressionTypesSpaces()}${ParseTreeUtils.printExpression(node)} (${getLineNum(node)}): Speculative ${printType(
|
|
70979
|
+
console.log(`${getPrintExpressionTypesSpaces()}${ParseTreeUtils.printExpression(node)} (${getLineNum(node)}): Speculative ${printType(specCacheEntry.typeResult.type)}`);
|
|
70803
70980
|
}
|
|
70804
|
-
return
|
|
70981
|
+
return specCacheEntry.typeResult;
|
|
70805
70982
|
}
|
|
70806
70983
|
}
|
|
70807
70984
|
if (printExpressionTypes) {
|
|
@@ -72519,7 +72696,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
72519
72696
|
}
|
|
72520
72697
|
destType = declaredType;
|
|
72521
72698
|
} else {
|
|
72522
|
-
destType = narrowTypeBasedOnAssignment(
|
|
72699
|
+
destType = narrowTypeBasedOnAssignment(declaredType, typeResult).type;
|
|
72523
72700
|
}
|
|
72524
72701
|
} else {
|
|
72525
72702
|
const scope = ScopeUtils.getScopeForNode(nameNode);
|
|
@@ -73110,7 +73287,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
73110
73287
|
if (!isTypeAliasAnnotation) {
|
|
73111
73288
|
if (assignType(annotationType, typeResult.type)) {
|
|
73112
73289
|
if (!(0, types_1.isClassInstance)(typeResult.type) || !types_1.ClassType.isEnumClass(typeResult.type)) {
|
|
73113
|
-
typeResult = narrowTypeBasedOnAssignment(
|
|
73290
|
+
typeResult = narrowTypeBasedOnAssignment(annotationType, typeResult);
|
|
73114
73291
|
}
|
|
73115
73292
|
}
|
|
73116
73293
|
}
|
|
@@ -74118,8 +74295,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
74118
74295
|
if (isModuleGetAttrSupported) {
|
|
74119
74296
|
const getAttrTypeResult = getEffectiveTypeOfSymbolForUsage(getAttrSymbol);
|
|
74120
74297
|
if ((0, types_1.isFunction)(getAttrTypeResult.type)) {
|
|
74121
|
-
|
|
74122
|
-
|
|
74298
|
+
const returnTypeResult = getEffectiveReturnTypeResult(getAttrTypeResult.type);
|
|
74299
|
+
type = returnTypeResult.type;
|
|
74300
|
+
if (getAttrTypeResult.isIncomplete || returnTypeResult.isIncomplete) {
|
|
74123
74301
|
isIncomplete = true;
|
|
74124
74302
|
}
|
|
74125
74303
|
}
|
|
@@ -74414,7 +74592,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
74414
74592
|
});
|
|
74415
74593
|
if (!isDescriptorError && usage.method === "set" && usage.setType) {
|
|
74416
74594
|
if (errorNode && memberInfo.symbol.hasTypedDeclarations()) {
|
|
74417
|
-
narrowedTypeForSet = isDescriptorApplied ? usage.setType.type : narrowTypeBasedOnAssignment(
|
|
74595
|
+
narrowedTypeForSet = isDescriptorApplied ? usage.setType.type : narrowTypeBasedOnAssignment(type, usage.setType).type;
|
|
74418
74596
|
}
|
|
74419
74597
|
if (!assignType(type, usage.setType.type, diag == null ? void 0 : diag.createAddendum())) {
|
|
74420
74598
|
if (!usage.setType.isIncomplete) {
|
|
@@ -75811,7 +75989,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75811
75989
|
}
|
|
75812
75990
|
return typeResult;
|
|
75813
75991
|
}
|
|
75814
|
-
function buildTupleTypesList(entryTypeResults, stripLiterals) {
|
|
75992
|
+
function buildTupleTypesList(entryTypeResults, stripLiterals, convertModule) {
|
|
75815
75993
|
const entryTypes = [];
|
|
75816
75994
|
for (const typeResult of entryTypeResults) {
|
|
75817
75995
|
let possibleUnpackedTuple;
|
|
@@ -75833,12 +76011,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
75833
76011
|
true
|
|
75834
76012
|
), isUnbounded: false });
|
|
75835
76013
|
} else {
|
|
75836
|
-
let entryType = convertSpecialFormToRuntimeValue(
|
|
75837
|
-
typeResult.type,
|
|
75838
|
-
0,
|
|
75839
|
-
/* convertModule */
|
|
75840
|
-
true
|
|
75841
|
-
);
|
|
76014
|
+
let entryType = convertSpecialFormToRuntimeValue(typeResult.type, 0, convertModule);
|
|
75842
76015
|
entryType = stripLiterals ? (0, typeUtils_1.stripTypeForm)(stripLiteralValue(entryType)) : entryType;
|
|
75843
76016
|
entryTypes.push({ type: entryType, isUnbounded: !!typeResult.unpackedType });
|
|
75844
76017
|
}
|
|
@@ -76336,7 +76509,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
76336
76509
|
}
|
|
76337
76510
|
function validateOverloadsWithExpandedTypes(errorNode, expandedArgTypes, argParamMatches, constraints, skipUnknownArgCheck, inferenceContext) {
|
|
76338
76511
|
const returnTypes = [];
|
|
76339
|
-
|
|
76512
|
+
let matchedOverloads = [];
|
|
76340
76513
|
let isTypeIncomplete = false;
|
|
76341
76514
|
let overloadsUsedForCall = [];
|
|
76342
76515
|
let isDefinitiveMatchFound = false;
|
|
@@ -76387,10 +76560,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
76387
76560
|
argResults: callResult.argResults ?? []
|
|
76388
76561
|
};
|
|
76389
76562
|
matchedOverloads.push(matchedOverloadInfo);
|
|
76390
|
-
if (callResult.anyOrUnknownArg) {
|
|
76563
|
+
if (callResult.anyOrUnknownArg || matchResults.unpackedArgOfUnknownLength) {
|
|
76391
76564
|
possibleMatchResults.push(matchedOverloadInfo);
|
|
76392
|
-
if (
|
|
76393
|
-
|
|
76565
|
+
if (callResult.anyOrUnknownArg) {
|
|
76566
|
+
if ((0, typeUtils_1.isIncompleteUnknown)(callResult.anyOrUnknownArg)) {
|
|
76567
|
+
possibleMatchInvolvesIncompleteUnknown = true;
|
|
76568
|
+
}
|
|
76394
76569
|
}
|
|
76395
76570
|
} else {
|
|
76396
76571
|
returnTypes.push(callResult.returnType);
|
|
@@ -76400,10 +76575,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
76400
76575
|
}
|
|
76401
76576
|
}
|
|
76402
76577
|
if (!isDefinitiveMatchFound && possibleMatchResults.length > 0) {
|
|
76578
|
+
possibleMatchResults = filterOverloadMatchesForUnpackedArgs(possibleMatchResults);
|
|
76403
76579
|
possibleMatchResults = filterOverloadMatchesForAnyArgs(possibleMatchResults);
|
|
76404
76580
|
if (possibleMatchResults.length === 1) {
|
|
76405
76581
|
overloadsUsedForCall = [possibleMatchResults[0].overload];
|
|
76406
76582
|
returnTypes.push(possibleMatchResults[0].returnType);
|
|
76583
|
+
matchedOverloads = [possibleMatchResults[0]];
|
|
76407
76584
|
} else {
|
|
76408
76585
|
let dedupedMatchResults = [];
|
|
76409
76586
|
let dedupedResultsIncludeAny = false;
|
|
@@ -76474,15 +76651,19 @@ var require_typeEvaluator = __commonJS({
|
|
|
76474
76651
|
overloadsUsedForCall
|
|
76475
76652
|
};
|
|
76476
76653
|
}
|
|
76477
|
-
function
|
|
76654
|
+
function filterOverloadMatchesForUnpackedArgs(matches) {
|
|
76478
76655
|
if (matches.length < 2) {
|
|
76479
76656
|
return matches;
|
|
76480
76657
|
}
|
|
76481
|
-
|
|
76482
|
-
|
|
76483
|
-
|
|
76484
|
-
|
|
76485
|
-
|
|
76658
|
+
const unpackedArgsOverloads = matches.filter((match2) => match2.matchResults.unpackedArgMapsToVariadic);
|
|
76659
|
+
if (unpackedArgsOverloads.length === matches.length || unpackedArgsOverloads.length === 0) {
|
|
76660
|
+
return matches;
|
|
76661
|
+
}
|
|
76662
|
+
return unpackedArgsOverloads;
|
|
76663
|
+
}
|
|
76664
|
+
function filterOverloadMatchesForAnyArgs(matches) {
|
|
76665
|
+
if (matches.length < 2) {
|
|
76666
|
+
return matches;
|
|
76486
76667
|
}
|
|
76487
76668
|
if ((0, typeUtils_1.areTypesSame)(matches.map((match2) => match2.returnType), { treatAnySameAsUnknown: true })) {
|
|
76488
76669
|
return [matches[0]];
|
|
@@ -76507,7 +76688,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
76507
76688
|
}
|
|
76508
76689
|
function getBestOverloadForArgs(errorNode, typeResult, argList) {
|
|
76509
76690
|
let overloadIndex = 0;
|
|
76510
|
-
|
|
76691
|
+
const matches = [];
|
|
76511
76692
|
const speculativeNode = getSpeculativeNodeForCall(errorNode);
|
|
76512
76693
|
useSignatureTracker(errorNode, () => {
|
|
76513
76694
|
types_1.OverloadedType.getOverloads(typeResult.type).forEach((overload) => {
|
|
@@ -76520,7 +76701,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
76520
76701
|
});
|
|
76521
76702
|
});
|
|
76522
76703
|
});
|
|
76523
|
-
matches = sortOverloadsByBestMatch(matches);
|
|
76524
76704
|
let winningOverloadIndex;
|
|
76525
76705
|
matches.forEach((match2, matchIndex) => {
|
|
76526
76706
|
if (winningOverloadIndex === void 0) {
|
|
@@ -76540,16 +76720,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
76540
76720
|
});
|
|
76541
76721
|
return winningOverloadIndex === void 0 ? void 0 : matches[winningOverloadIndex].overload;
|
|
76542
76722
|
}
|
|
76543
|
-
function sortOverloadsByBestMatch(matches) {
|
|
76544
|
-
return matches.sort((a, b) => {
|
|
76545
|
-
if (a.relevance !== b.relevance) {
|
|
76546
|
-
return b.relevance - a.relevance;
|
|
76547
|
-
}
|
|
76548
|
-
return a.overloadIndex - b.overloadIndex;
|
|
76549
|
-
});
|
|
76550
|
-
}
|
|
76551
76723
|
function validateOverloadedArgTypes(errorNode, argList, typeResult, constraints, skipUnknownArgCheck, inferenceContext) {
|
|
76552
|
-
|
|
76724
|
+
const filteredMatchResults = [];
|
|
76553
76725
|
let contextFreeArgTypes;
|
|
76554
76726
|
let isTypeIncomplete = !!typeResult.isIncomplete;
|
|
76555
76727
|
const type = typeResult.type;
|
|
@@ -76564,7 +76736,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
76564
76736
|
overloadIndex++;
|
|
76565
76737
|
});
|
|
76566
76738
|
});
|
|
76567
|
-
filteredMatchResults = sortOverloadsByBestMatch(filteredMatchResults);
|
|
76568
76739
|
if (filteredMatchResults.length === 0) {
|
|
76569
76740
|
if (!canSkipDiagnosticForNode(errorNode)) {
|
|
76570
76741
|
const overloads = types_1.OverloadedType.getOverloads(type);
|
|
@@ -76755,22 +76926,33 @@ var require_typeEvaluator = __commonJS({
|
|
|
76755
76926
|
};
|
|
76756
76927
|
}
|
|
76757
76928
|
function validateCallArgsForSubtype(errorNode, argList, expandedCallType, unexpandedCallType, isCallTypeIncomplete, constraints, skipUnknownArgCheck, inferenceContext, recursionCount) {
|
|
76929
|
+
function touchArgTypes() {
|
|
76930
|
+
if (!isCallTypeIncomplete) {
|
|
76931
|
+
argList.forEach((arg) => {
|
|
76932
|
+
if (arg.valueExpression && !isSpeculativeModeInUse(arg.valueExpression)) {
|
|
76933
|
+
getTypeOfArg(
|
|
76934
|
+
arg,
|
|
76935
|
+
/* inferenceContext */
|
|
76936
|
+
void 0
|
|
76937
|
+
);
|
|
76938
|
+
}
|
|
76939
|
+
});
|
|
76940
|
+
}
|
|
76941
|
+
}
|
|
76758
76942
|
switch (expandedCallType.category) {
|
|
76759
76943
|
case 3:
|
|
76760
76944
|
case 1:
|
|
76761
76945
|
case 2: {
|
|
76762
|
-
|
|
76763
|
-
|
|
76764
|
-
|
|
76765
|
-
|
|
76766
|
-
|
|
76767
|
-
|
|
76768
|
-
|
|
76769
|
-
|
|
76770
|
-
|
|
76771
|
-
|
|
76772
|
-
}
|
|
76773
|
-
return { returnType: expandedCallType };
|
|
76946
|
+
const dummyFunctionType = types_1.FunctionType.createInstance(
|
|
76947
|
+
"",
|
|
76948
|
+
"",
|
|
76949
|
+
"",
|
|
76950
|
+
0
|
|
76951
|
+
/* FunctionTypeFlags.None */
|
|
76952
|
+
);
|
|
76953
|
+
types_1.FunctionType.addDefaultParams(dummyFunctionType);
|
|
76954
|
+
const dummyCallResult = validateCallForFunction(errorNode, argList, dummyFunctionType, isCallTypeIncomplete, constraints, skipUnknownArgCheck, inferenceContext);
|
|
76955
|
+
return { ...dummyCallResult, returnType: expandedCallType };
|
|
76774
76956
|
}
|
|
76775
76957
|
case 4: {
|
|
76776
76958
|
return validateCallForFunction(errorNode, argList, expandedCallType, isCallTypeIncomplete, constraints, skipUnknownArgCheck, inferenceContext);
|
|
@@ -76781,6 +76963,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
76781
76963
|
case 6: {
|
|
76782
76964
|
if ((0, typeUtils_1.isNoneInstance)(expandedCallType)) {
|
|
76783
76965
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportOptionalCall, localize_1.LocMessage.noneNotCallable(), errorNode);
|
|
76966
|
+
touchArgTypes();
|
|
76784
76967
|
return { argumentErrors: true };
|
|
76785
76968
|
}
|
|
76786
76969
|
if (types_1.TypeBase.isInstantiable(expandedCallType)) {
|
|
@@ -76797,9 +76980,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
76797
76980
|
}
|
|
76798
76981
|
case 7: {
|
|
76799
76982
|
addDiagnostic(diagnosticRules_1.DiagnosticRule.reportCallIssue, localize_1.LocMessage.moduleNotCallable(), errorNode);
|
|
76983
|
+
touchArgTypes();
|
|
76800
76984
|
return { argumentErrors: true };
|
|
76801
76985
|
}
|
|
76802
76986
|
}
|
|
76987
|
+
touchArgTypes();
|
|
76803
76988
|
return { argumentErrors: true };
|
|
76804
76989
|
}
|
|
76805
76990
|
function validateCallForFunction(errorNode, argList, type, isCallTypeIncomplete, constraints, skipUnknownArgCheck, inferenceContext) {
|
|
@@ -77238,24 +77423,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
77238
77423
|
const paramDetails = (0, parameterUtils_1.getParamListDetails)(overload, { disallowExtraKwargsForTd: true });
|
|
77239
77424
|
const paramSpec = types_1.FunctionType.getParamSpecFromArgsKwargs(overload);
|
|
77240
77425
|
let argIndex = 0;
|
|
77241
|
-
let
|
|
77426
|
+
let unpackedArgOfUnknownLength = false;
|
|
77427
|
+
let unpackedArgMapsToVariadic = false;
|
|
77242
77428
|
let reportedArgError = false;
|
|
77243
77429
|
let isTypeIncomplete = !!typeResult.isIncomplete;
|
|
77244
77430
|
let isTypeVarTupleFullyMatched = false;
|
|
77245
77431
|
argList = expandArgList(argList);
|
|
77246
|
-
const
|
|
77247
|
-
paramDetails.params.forEach((paramInfo) => {
|
|
77248
|
-
var _a2;
|
|
77249
|
-
(0, debug_1.assert)(paramInfo !== void 0, "paramInfo is undefined for param name map");
|
|
77250
|
-
const param = paramInfo.param;
|
|
77251
|
-
if (param.name && param.category === 0 && paramInfo.kind !== parameterUtils_1.ParamKind.Positional) {
|
|
77252
|
-
let argsNeeded = ((_a2 = paramMap.get(param.name)) == null ? void 0 : _a2.argsNeeded) ?? 0;
|
|
77253
|
-
if (param.category === 0 && !paramInfo.defaultType) {
|
|
77254
|
-
argsNeeded += 1;
|
|
77255
|
-
}
|
|
77256
|
-
paramMap.set(param.name, { argsNeeded, argsReceived: 0 });
|
|
77257
|
-
}
|
|
77258
|
-
});
|
|
77432
|
+
const paramTracker = new parameterUtils_1.ParamAssignmentTracker(paramDetails.params);
|
|
77259
77433
|
let positionalOnlyLimitIndex = paramDetails.positionOnlyParamCount;
|
|
77260
77434
|
let positionParamLimitIndex = paramDetails.firstKeywordOnlyIndex ?? paramDetails.params.length;
|
|
77261
77435
|
const varArgListParamIndex = paramDetails.argsIndex;
|
|
@@ -77354,6 +77528,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
77354
77528
|
).type;
|
|
77355
77529
|
if ((0, types_1.isClassInstance)(argType) && (0, typeUtils_1.isTupleClass)(argType) && !(0, typeUtils_1.isUnboundedTupleClass)(argType) && argType.priv.tupleTypeArgs !== void 0 && argType.priv.tupleTypeArgs.length > 0) {
|
|
77356
77530
|
tooManyPositionals = true;
|
|
77531
|
+
} else {
|
|
77532
|
+
unpackedArgOfUnknownLength = true;
|
|
77357
77533
|
}
|
|
77358
77534
|
} else {
|
|
77359
77535
|
tooManyPositionals = true;
|
|
@@ -77385,6 +77561,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77385
77561
|
void 0
|
|
77386
77562
|
);
|
|
77387
77563
|
let listElementType;
|
|
77564
|
+
let enforceIterable = false;
|
|
77388
77565
|
let advanceToNextArg = false;
|
|
77389
77566
|
if (paramIndex < positionParamLimitIndex) {
|
|
77390
77567
|
if ((0, types_1.isParamSpec)(argTypeResult.type) && argTypeResult.type.priv.paramSpecAccess === "args" && paramInfo.param.category !== 1) {
|
|
@@ -77425,14 +77602,27 @@ var require_typeEvaluator = __commonJS({
|
|
|
77425
77602
|
/* emitNotIterableError */
|
|
77426
77603
|
false
|
|
77427
77604
|
)) == null ? void 0 : _a.type;
|
|
77605
|
+
if (!listElementType) {
|
|
77606
|
+
enforceIterable = true;
|
|
77607
|
+
}
|
|
77608
|
+
unpackedArgOfUnknownLength = true;
|
|
77428
77609
|
if (paramInfo.param.category === 1) {
|
|
77429
|
-
|
|
77610
|
+
unpackedArgMapsToVariadic = true;
|
|
77611
|
+
}
|
|
77612
|
+
if (isParamVariadic && listElementType) {
|
|
77613
|
+
isArgCompatibleWithVariadic = true;
|
|
77614
|
+
listElementType = (0, tuples_1.makeTupleObject)(
|
|
77615
|
+
evaluatorInterface,
|
|
77616
|
+
[{ type: listElementType, isUnbounded: true }],
|
|
77617
|
+
/* isUnpacked */
|
|
77618
|
+
true
|
|
77619
|
+
);
|
|
77430
77620
|
}
|
|
77431
77621
|
}
|
|
77432
77622
|
const funcArg = listElementType ? {
|
|
77433
77623
|
argCategory: 0,
|
|
77434
77624
|
typeResult: { type: listElementType, isIncomplete: argTypeResult.isIncomplete }
|
|
77435
|
-
} : { ...argList[argIndex] };
|
|
77625
|
+
} : { ...argList[argIndex], enforceIterable };
|
|
77436
77626
|
if (argTypeResult.isIncomplete) {
|
|
77437
77627
|
isTypeIncomplete = true;
|
|
77438
77628
|
}
|
|
@@ -77459,8 +77649,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
77459
77649
|
}
|
|
77460
77650
|
}
|
|
77461
77651
|
trySetActive(argList[argIndex], paramDetails.params[paramIndex].param);
|
|
77462
|
-
if (paramName && paramDetails.params[paramIndex].param.category === 0
|
|
77463
|
-
|
|
77652
|
+
if (paramName && paramDetails.params[paramIndex].param.category === 0) {
|
|
77653
|
+
paramTracker.markArgReceived(paramInfo);
|
|
77464
77654
|
}
|
|
77465
77655
|
if (advanceToNextArg || paramDetails.params[paramIndex].param.category === 1) {
|
|
77466
77656
|
argIndex++;
|
|
@@ -77518,9 +77708,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77518
77708
|
isParamNameSynthesized: types_1.FunctionParam.isNameSynthesized(paramInfo2.param)
|
|
77519
77709
|
});
|
|
77520
77710
|
trySetActive(argList[argIndex], paramInfo2.param);
|
|
77521
|
-
|
|
77522
|
-
paramMap.get(paramName2).argsReceived++;
|
|
77523
|
-
}
|
|
77711
|
+
paramTracker.markArgReceived(paramInfo2);
|
|
77524
77712
|
argIndex++;
|
|
77525
77713
|
paramIndex++;
|
|
77526
77714
|
}
|
|
@@ -77566,7 +77754,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77566
77754
|
const tdEntries = (0, typedDicts_1.getTypedDictMembersForClass)(evaluatorInterface, argType);
|
|
77567
77755
|
const diag = new diagnostic_1.DiagnosticAddendum();
|
|
77568
77756
|
tdEntries.knownItems.forEach((entry, name) => {
|
|
77569
|
-
const paramEntry =
|
|
77757
|
+
const paramEntry = paramTracker.lookupName(name);
|
|
77570
77758
|
if (paramEntry) {
|
|
77571
77759
|
if (paramEntry.argsReceived > 0) {
|
|
77572
77760
|
diag.addMessage(localize_1.LocMessage.paramAlreadyAssigned().format({ name }));
|
|
@@ -77600,10 +77788,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77600
77788
|
errorNode: argList[argIndex].valueExpression ?? errorNode,
|
|
77601
77789
|
paramName: name
|
|
77602
77790
|
});
|
|
77603
|
-
|
|
77604
|
-
argsNeeded: 1,
|
|
77605
|
-
argsReceived: 1
|
|
77606
|
-
});
|
|
77791
|
+
paramTracker.addKeywordParam(name, paramDetails.params[paramDetails.kwargsIndex]);
|
|
77607
77792
|
} else {
|
|
77608
77793
|
if (!paramDetails.hasUnpackedTypedDict) {
|
|
77609
77794
|
diag.addMessage(localize_1.LocMessage.paramNameMissing().format({ name }));
|
|
@@ -77679,6 +77864,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77679
77864
|
unpackedDictArgType = types_1.UnknownType.create();
|
|
77680
77865
|
}
|
|
77681
77866
|
}
|
|
77867
|
+
unpackedArgOfUnknownLength = true;
|
|
77682
77868
|
if (paramDetails.kwargsIndex !== void 0 && unpackedDictArgType) {
|
|
77683
77869
|
const paramType = paramDetails.params[paramDetails.kwargsIndex].type;
|
|
77684
77870
|
validateArgTypeParams.push({
|
|
@@ -77690,6 +77876,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77690
77876
|
errorNode: argList[argIndex].valueExpression || errorNode,
|
|
77691
77877
|
paramName: paramDetails.params[paramDetails.kwargsIndex].param.name
|
|
77692
77878
|
});
|
|
77879
|
+
unpackedArgMapsToVariadic = true;
|
|
77693
77880
|
}
|
|
77694
77881
|
if (!isValidMappingType) {
|
|
77695
77882
|
if (!canSkipDiagnosticForNode(errorNode) && !isTypeIncomplete) {
|
|
@@ -77706,7 +77893,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77706
77893
|
const paramName = argList[argIndex].name;
|
|
77707
77894
|
if (paramName) {
|
|
77708
77895
|
const paramNameValue = paramName.d.value;
|
|
77709
|
-
const paramEntry =
|
|
77896
|
+
const paramEntry = paramTracker.lookupName(paramNameValue);
|
|
77710
77897
|
if (paramEntry) {
|
|
77711
77898
|
if (paramEntry.argsReceived > 0) {
|
|
77712
77899
|
if (!canSkipDiagnosticForNode(errorNode) && !isTypeIncomplete) {
|
|
@@ -77746,11 +77933,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
77746
77933
|
errorNode: argList[argIndex].valueExpression ?? errorNode,
|
|
77747
77934
|
paramName: paramNameValue
|
|
77748
77935
|
});
|
|
77749
|
-
paramMap.set(paramNameValue, {
|
|
77750
|
-
argsNeeded: 1,
|
|
77751
|
-
argsReceived: 1
|
|
77752
|
-
});
|
|
77753
77936
|
(0, debug_1.assert)(paramDetails.params[paramDetails.kwargsIndex], "paramDetails.kwargsIndex params entry is undefined");
|
|
77937
|
+
paramTracker.addKeywordParam(paramNameValue, paramDetails.params[paramDetails.kwargsIndex]);
|
|
77754
77938
|
}
|
|
77755
77939
|
trySetActive(argList[argIndex], paramDetails.params[paramDetails.kwargsIndex].param);
|
|
77756
77940
|
} else {
|
|
@@ -77800,7 +77984,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
77800
77984
|
paramDetails.params.forEach((paramInfo, paramIndex2) => {
|
|
77801
77985
|
var _a2;
|
|
77802
77986
|
const param = paramInfo.param;
|
|
77803
|
-
if (paramIndex2 >= paramDetails.firstPositionOrKeywordIndex && param.category === 0 && param.name &&
|
|
77987
|
+
if (paramIndex2 >= paramDetails.firstPositionOrKeywordIndex && param.category === 0 && param.name && paramTracker.lookupDetails(paramInfo).argsReceived === 0) {
|
|
77804
77988
|
const paramType = paramDetails.params[paramIndex2].type;
|
|
77805
77989
|
if (!unpackedDictKeyNames || unpackedDictKeyNames.includes(param.name)) {
|
|
77806
77990
|
validateArgTypeParams.push({
|
|
@@ -77818,16 +78002,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
77818
78002
|
paramName: param.name,
|
|
77819
78003
|
isParamNameSynthesized: types_1.FunctionParam.isNameSynthesized(param)
|
|
77820
78004
|
});
|
|
77821
|
-
|
|
78005
|
+
paramTracker.markArgReceived(paramDetails.params[paramIndex2]);
|
|
77822
78006
|
}
|
|
77823
78007
|
}
|
|
77824
78008
|
});
|
|
77825
78009
|
}
|
|
77826
78010
|
if (!unpackedDictArgType && !types_1.FunctionType.isDefaultParamCheckDisabled(overload)) {
|
|
77827
|
-
const unassignedParams =
|
|
77828
|
-
const entry = paramMap.get(name);
|
|
77829
|
-
return !entry || entry.argsReceived < entry.argsNeeded;
|
|
77830
|
-
});
|
|
78011
|
+
const unassignedParams = paramTracker.getUnassignedParams();
|
|
77831
78012
|
if (unassignedParams.length > 0) {
|
|
77832
78013
|
if (!canSkipDiagnosticForNode(errorNode)) {
|
|
77833
78014
|
const missingParamNames = unassignedParams.map((p) => `"${p}"`).join(", ");
|
|
@@ -77840,21 +78021,24 @@ var require_typeEvaluator = __commonJS({
|
|
|
77840
78021
|
paramDetails.params.forEach((paramInfo) => {
|
|
77841
78022
|
const param = paramInfo.param;
|
|
77842
78023
|
if (param.category === 0 && param.name) {
|
|
77843
|
-
const entry =
|
|
77844
|
-
if (entry
|
|
77845
|
-
|
|
77846
|
-
|
|
77847
|
-
|
|
77848
|
-
|
|
77849
|
-
|
|
77850
|
-
|
|
77851
|
-
|
|
77852
|
-
|
|
77853
|
-
|
|
77854
|
-
|
|
77855
|
-
|
|
77856
|
-
|
|
77857
|
-
|
|
78024
|
+
const entry = paramTracker.lookupDetails(paramInfo);
|
|
78025
|
+
if (entry.argsNeeded === 0 && entry.argsReceived === 0) {
|
|
78026
|
+
const defaultArgType = paramInfo.defaultType;
|
|
78027
|
+
if (defaultArgType && !(0, typeUtils_1.isEllipsisType)(defaultArgType) && (0, typeUtils_1.requiresSpecialization)(paramInfo.declaredType, { ignorePseudoGeneric: true })) {
|
|
78028
|
+
validateArgTypeParams.push({
|
|
78029
|
+
paramCategory: param.category,
|
|
78030
|
+
paramType: paramInfo.type,
|
|
78031
|
+
requiresTypeVarMatching: true,
|
|
78032
|
+
argument: {
|
|
78033
|
+
argCategory: 0,
|
|
78034
|
+
typeResult: { type: defaultArgType }
|
|
78035
|
+
},
|
|
78036
|
+
isDefaultArg: true,
|
|
78037
|
+
errorNode,
|
|
78038
|
+
paramName: param.name,
|
|
78039
|
+
isParamNameSynthesized: types_1.FunctionParam.isNameSynthesized(param)
|
|
78040
|
+
});
|
|
78041
|
+
}
|
|
77858
78042
|
}
|
|
77859
78043
|
}
|
|
77860
78044
|
});
|
|
@@ -77919,10 +78103,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
77919
78103
|
}
|
|
77920
78104
|
}
|
|
77921
78105
|
}
|
|
77922
|
-
let relevance = 0;
|
|
77923
|
-
if (matchedUnpackedListOfUnknownLength) {
|
|
77924
|
-
relevance++;
|
|
77925
|
-
}
|
|
77926
78106
|
if (types_1.FunctionType.isBuiltIn(overload, ["isinstance", "issubclass"]) && validateArgTypeParams.length === 2) {
|
|
77927
78107
|
validateArgTypeParams[1].isinstanceParam = true;
|
|
77928
78108
|
}
|
|
@@ -77935,7 +78115,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
77935
78115
|
paramSpecTarget,
|
|
77936
78116
|
paramSpecArgList,
|
|
77937
78117
|
activeParam,
|
|
77938
|
-
|
|
78118
|
+
unpackedArgOfUnknownLength,
|
|
78119
|
+
unpackedArgMapsToVariadic,
|
|
77939
78120
|
argumentMatchScore: 0
|
|
77940
78121
|
};
|
|
77941
78122
|
}
|
|
@@ -78175,9 +78356,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
78175
78356
|
argumentMatchScore += 1;
|
|
78176
78357
|
}
|
|
78177
78358
|
}
|
|
78178
|
-
|
|
78359
|
+
const returnTypeResult = getEffectiveReturnTypeResult(type, {
|
|
78179
78360
|
callSiteInfo: { args: matchResults.argParams, errorNode }
|
|
78180
78361
|
});
|
|
78362
|
+
let returnType = returnTypeResult.type;
|
|
78363
|
+
if (returnTypeResult.isIncomplete) {
|
|
78364
|
+
isTypeIncomplete = true;
|
|
78365
|
+
}
|
|
78181
78366
|
if (condition.length > 0) {
|
|
78182
78367
|
returnType = types_1.TypeBase.cloneForCondition(returnType, condition);
|
|
78183
78368
|
}
|
|
@@ -78276,7 +78461,13 @@ var require_typeEvaluator = __commonJS({
|
|
|
78276
78461
|
getTypeOfExpression(arg.valueExpression);
|
|
78277
78462
|
}
|
|
78278
78463
|
});
|
|
78464
|
+
const possibleType = types_1.FunctionType.getEffectiveReturnType(typeResult.type);
|
|
78279
78465
|
return {
|
|
78466
|
+
returnType: possibleType && !(0, types_1.isAnyOrUnknown)(possibleType) ? types_1.UnknownType.createPossibleType(
|
|
78467
|
+
possibleType,
|
|
78468
|
+
/* isIncomplete */
|
|
78469
|
+
false
|
|
78470
|
+
) : void 0,
|
|
78280
78471
|
argumentErrors: true,
|
|
78281
78472
|
activeParam: matchResults.activeParam,
|
|
78282
78473
|
overloadsUsedForCall: []
|
|
@@ -78410,12 +78601,19 @@ var require_typeEvaluator = __commonJS({
|
|
|
78410
78601
|
const flags = argParam.isinstanceParam ? 536871546 : 16 | 2;
|
|
78411
78602
|
const exprTypeResult = getTypeOfExpression(argParam.argument.valueExpression, flags, (0, typeUtils_1.makeInferenceContext)(expectedType, !!(typeResult == null ? void 0 : typeResult.isIncomplete)));
|
|
78412
78603
|
argType = exprTypeResult.type;
|
|
78604
|
+
if (argParam.argument.argCategory === 1 && argParam.argument.enforceIterable) {
|
|
78605
|
+
const iteratorType = getTypeOfIterator(
|
|
78606
|
+
exprTypeResult,
|
|
78607
|
+
/* isAsync */
|
|
78608
|
+
false,
|
|
78609
|
+
argParam.argument.valueExpression
|
|
78610
|
+
);
|
|
78611
|
+
argType = (iteratorType == null ? void 0 : iteratorType.type) ?? types_1.UnknownType.create();
|
|
78612
|
+
}
|
|
78413
78613
|
if (exprTypeResult.isIncomplete) {
|
|
78414
78614
|
isTypeIncomplete = true;
|
|
78415
78615
|
}
|
|
78416
|
-
if (
|
|
78417
|
-
isCompatible = false;
|
|
78418
|
-
} else if (expectedType && (0, typeUtils_1.requiresSpecialization)(expectedType)) {
|
|
78616
|
+
if (expectedType && (0, typeUtils_1.requiresSpecialization)(expectedType)) {
|
|
78419
78617
|
const clonedConstraints = constraints.clone();
|
|
78420
78618
|
if (assignType(
|
|
78421
78619
|
expectedType,
|
|
@@ -79382,18 +79580,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
79382
79580
|
if (keyValueResult.typeErrors) {
|
|
79383
79581
|
typeErrors = true;
|
|
79384
79582
|
}
|
|
79385
|
-
const keyTypes = keyTypeResults.map((t) => (0, typeUtils_1.stripTypeForm)(convertSpecialFormToRuntimeValue(
|
|
79386
|
-
|
|
79387
|
-
flags,
|
|
79388
|
-
/* convertModule */
|
|
79389
|
-
true
|
|
79390
|
-
)));
|
|
79391
|
-
const valueTypes = valueTypeResults.map((t) => (0, typeUtils_1.stripTypeForm)(convertSpecialFormToRuntimeValue(
|
|
79392
|
-
stripLiteralValue(t.type),
|
|
79393
|
-
flags,
|
|
79394
|
-
/* convertModule */
|
|
79395
|
-
true
|
|
79396
|
-
)));
|
|
79583
|
+
const keyTypes = keyTypeResults.map((t) => (0, typeUtils_1.stripTypeForm)(convertSpecialFormToRuntimeValue(stripLiteralValue(t.type), flags, !hasExpectedType)));
|
|
79584
|
+
const valueTypes = valueTypeResults.map((t) => (0, typeUtils_1.stripTypeForm)(convertSpecialFormToRuntimeValue(stripLiteralValue(t.type), flags, !hasExpectedType)));
|
|
79397
79585
|
if (keyTypes.length > 0) {
|
|
79398
79586
|
if (AnalyzerNodeInfo.getFileInfo(node).diagnosticRuleSet.strictDictionaryInference || hasExpectedType) {
|
|
79399
79587
|
keyType = (0, types_1.combineTypes)(keyTypes);
|
|
@@ -79767,12 +79955,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
79767
79955
|
/* EvalFlags.StripTupleLiterals */
|
|
79768
79956
|
);
|
|
79769
79957
|
}
|
|
79770
|
-
entryTypeResult.type = (0, typeUtils_1.stripTypeForm)(convertSpecialFormToRuntimeValue(
|
|
79771
|
-
entryTypeResult.type,
|
|
79772
|
-
flags,
|
|
79773
|
-
/* convertModule */
|
|
79774
|
-
true
|
|
79775
|
-
));
|
|
79958
|
+
entryTypeResult.type = (0, typeUtils_1.stripTypeForm)(convertSpecialFormToRuntimeValue(entryTypeResult.type, flags, !hasExpectedType));
|
|
79776
79959
|
if (entryTypeResult.isIncomplete) {
|
|
79777
79960
|
isIncomplete = true;
|
|
79778
79961
|
}
|
|
@@ -80064,7 +80247,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
80064
80247
|
void 0,
|
|
80065
80248
|
(0, typeUtils_1.makeInferenceContext)(expectedReturnType)
|
|
80066
80249
|
);
|
|
80067
|
-
functionType.
|
|
80250
|
+
functionType.shared.inferredReturnType = {
|
|
80068
80251
|
type: returnTypeResult.type
|
|
80069
80252
|
};
|
|
80070
80253
|
if (returnTypeResult.isIncomplete) {
|
|
@@ -82115,6 +82298,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
82115
82298
|
}
|
|
82116
82299
|
}
|
|
82117
82300
|
};
|
|
82301
|
+
if (node.d.name.d.value === "Any" && fileInfo.isTypingStubFile) {
|
|
82302
|
+
decoratedType = types_1.AnyType.createSpecialForm();
|
|
82303
|
+
}
|
|
82118
82304
|
writeTypeCache(
|
|
82119
82305
|
node.d.name,
|
|
82120
82306
|
{ type: classType },
|
|
@@ -82788,15 +82974,6 @@ var require_typeEvaluator = __commonJS({
|
|
|
82788
82974
|
if (functionType.shared.declaredReturnType && returnTypeAnnotationNode) {
|
|
82789
82975
|
(0, typeUtils_1.addTypeVarsToListIfUnique)(typeParamsSeen, (0, typeUtils_1.getTypeVarArgsRecursive)(functionType.shared.declaredReturnType), functionType.shared.typeVarScopeId);
|
|
82790
82976
|
}
|
|
82791
|
-
if (fileInfo.isStubFile || ParseTreeUtils.isSuiteEmpty(node.d.suite)) {
|
|
82792
|
-
if (functionType.shared.declaredReturnType && (0, types_1.isClassInstance)(functionType.shared.declaredReturnType) && types_1.ClassType.isBuiltIn(functionType.shared.declaredReturnType, [
|
|
82793
|
-
"Generator",
|
|
82794
|
-
"AsyncGenerator",
|
|
82795
|
-
"AwaitableGenerator"
|
|
82796
|
-
])) {
|
|
82797
|
-
functionType.shared.flags |= 16;
|
|
82798
|
-
}
|
|
82799
|
-
}
|
|
82800
82977
|
functionType.shared.typeParams.forEach((typeParam, index) => {
|
|
82801
82978
|
let bestErrorNode = node.d.name;
|
|
82802
82979
|
if (node.d.typeParams && index < node.d.typeParams.d.params.length) {
|
|
@@ -82961,7 +83138,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
82961
83138
|
if (functionType.shared.declaredReturnType) {
|
|
82962
83139
|
awaitableFunctionType.shared.declaredReturnType = createAwaitableReturnType(node, functionType.shared.declaredReturnType, types_1.FunctionType.isGenerator(functionType));
|
|
82963
83140
|
} else {
|
|
82964
|
-
awaitableFunctionType.
|
|
83141
|
+
awaitableFunctionType.shared.inferredReturnType = {
|
|
82965
83142
|
type: createAwaitableReturnType(node, getInferredReturnType(functionType), types_1.FunctionType.isGenerator(functionType))
|
|
82966
83143
|
};
|
|
82967
83144
|
}
|
|
@@ -82984,8 +83161,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
82984
83161
|
}
|
|
82985
83162
|
awaitableReturnType = types_1.ClassType.cloneAsInstance(types_1.ClassType.specialize(asyncGeneratorType, typeArgs));
|
|
82986
83163
|
}
|
|
82987
|
-
} else if (["
|
|
83164
|
+
} else if (["AsyncIterator", "AsyncIterable"].some((name) => name === returnType.shared.name)) {
|
|
82988
83165
|
awaitableReturnType = returnType;
|
|
83166
|
+
} else if (returnType.shared.name === "AsyncGenerator") {
|
|
83167
|
+
if (isGenerator) {
|
|
83168
|
+
awaitableReturnType = returnType;
|
|
83169
|
+
}
|
|
82989
83170
|
}
|
|
82990
83171
|
}
|
|
82991
83172
|
}
|
|
@@ -85058,11 +85239,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
85058
85239
|
if (declaration.intrinsicType === "int") {
|
|
85059
85240
|
return { type: intType };
|
|
85060
85241
|
}
|
|
85061
|
-
if (declaration.intrinsicType === "
|
|
85062
|
-
const
|
|
85063
|
-
if ((0, types_1.isInstantiableClass)(
|
|
85242
|
+
if (declaration.intrinsicType === "MutableSequence[str]") {
|
|
85243
|
+
const sequenceType = getBuiltInType(declaration.node, "MutableSequence");
|
|
85244
|
+
if ((0, types_1.isInstantiableClass)(sequenceType)) {
|
|
85064
85245
|
return {
|
|
85065
|
-
type: types_1.ClassType.cloneAsInstance(types_1.ClassType.specialize(
|
|
85246
|
+
type: types_1.ClassType.cloneAsInstance(types_1.ClassType.specialize(sequenceType, [strType]))
|
|
85066
85247
|
};
|
|
85067
85248
|
}
|
|
85068
85249
|
}
|
|
@@ -85331,27 +85512,53 @@ var require_typeEvaluator = __commonJS({
|
|
|
85331
85512
|
}
|
|
85332
85513
|
if (loaderActions.implicitImports) {
|
|
85333
85514
|
loaderActions.implicitImports.forEach((implicitImport, name) => {
|
|
85515
|
+
const existingLoaderField = moduleType.priv.loaderFields.get(name);
|
|
85334
85516
|
let symbolType;
|
|
85335
85517
|
if (implicitImport.isUnresolved) {
|
|
85336
85518
|
symbolType = types_1.UnknownType.create();
|
|
85337
85519
|
} else {
|
|
85338
|
-
|
|
85339
|
-
const
|
|
85520
|
+
let importedModuleType;
|
|
85521
|
+
const existingType = existingLoaderField == null ? void 0 : existingLoaderField.getSynthesizedType();
|
|
85522
|
+
if ((existingType == null ? void 0 : existingType.type) && (0, types_1.isModule)(existingType.type)) {
|
|
85523
|
+
importedModuleType = existingType.type;
|
|
85524
|
+
} else {
|
|
85525
|
+
const moduleName = moduleType.priv.moduleName ? moduleType.priv.moduleName + "." + name : "";
|
|
85526
|
+
importedModuleType = types_1.ModuleType.create(moduleName, implicitImport.uri);
|
|
85527
|
+
}
|
|
85340
85528
|
symbolType = applyLoaderActionsToModuleType(importedModuleType, implicitImport, importLookup2);
|
|
85341
85529
|
}
|
|
85342
|
-
|
|
85343
|
-
|
|
85530
|
+
if (!existingLoaderField) {
|
|
85531
|
+
const importedModuleSymbol = symbol_1.Symbol.createWithType(0, symbolType);
|
|
85532
|
+
moduleType.priv.loaderFields.set(name, importedModuleSymbol);
|
|
85533
|
+
}
|
|
85344
85534
|
});
|
|
85345
85535
|
}
|
|
85346
85536
|
return moduleType;
|
|
85347
85537
|
}
|
|
85348
85538
|
if (resolvedDecl.type === 8) {
|
|
85349
|
-
|
|
85350
|
-
if (resolvedDecl.
|
|
85351
|
-
|
|
85352
|
-
|
|
85353
|
-
|
|
85539
|
+
let moduleType;
|
|
85540
|
+
if (resolvedDecl.node.nodeType === 24) {
|
|
85541
|
+
const cachedType = readTypeCache(
|
|
85542
|
+
resolvedDecl.node.d.module,
|
|
85543
|
+
0
|
|
85544
|
+
/* EvalFlags.None */
|
|
85545
|
+
);
|
|
85546
|
+
if (cachedType && (0, types_1.isModule)(cachedType)) {
|
|
85547
|
+
moduleType = cachedType;
|
|
85548
|
+
}
|
|
85549
|
+
}
|
|
85550
|
+
if (!moduleType) {
|
|
85551
|
+
moduleType = types_1.ModuleType.create(resolvedDecl.moduleName, resolvedDecl.uri);
|
|
85552
|
+
if (resolvedDecl.node.nodeType === 24) {
|
|
85553
|
+
writeTypeCache(
|
|
85554
|
+
resolvedDecl.node.d.module,
|
|
85555
|
+
{ type: moduleType },
|
|
85556
|
+
0
|
|
85557
|
+
/* EvalFlags.None */
|
|
85558
|
+
);
|
|
85559
|
+
}
|
|
85354
85560
|
}
|
|
85561
|
+
return applyLoaderActionsToModuleType(moduleType, resolvedDecl.symbolName && resolvedDecl.submoduleFallback ? resolvedDecl.submoduleFallback : resolvedDecl, importLookup);
|
|
85355
85562
|
}
|
|
85356
85563
|
const declaredType = getTypeForDeclaration(resolvedDecl);
|
|
85357
85564
|
if (declaredType.type) {
|
|
@@ -85802,33 +86009,42 @@ var require_typeEvaluator = __commonJS({
|
|
|
85802
86009
|
}
|
|
85803
86010
|
}
|
|
85804
86011
|
}
|
|
85805
|
-
function getEffectiveReturnType(type
|
|
86012
|
+
function getEffectiveReturnType(type) {
|
|
86013
|
+
return getEffectiveReturnTypeResult(type).type;
|
|
86014
|
+
}
|
|
86015
|
+
function getInferredReturnType(type) {
|
|
86016
|
+
return getInferredReturnTypeResult(type).type;
|
|
86017
|
+
}
|
|
86018
|
+
function getEffectiveReturnTypeResult(type, options) {
|
|
85806
86019
|
const specializedReturnType = types_1.FunctionType.getEffectiveReturnType(
|
|
85807
86020
|
type,
|
|
85808
86021
|
/* includeInferred */
|
|
85809
86022
|
false
|
|
85810
86023
|
);
|
|
85811
86024
|
if (specializedReturnType && !(0, types_1.isUnknown)(specializedReturnType)) {
|
|
85812
|
-
return specializedReturnType;
|
|
86025
|
+
return { type: specializedReturnType };
|
|
85813
86026
|
}
|
|
85814
|
-
return
|
|
86027
|
+
return getInferredReturnTypeResult(type, options == null ? void 0 : options.callSiteInfo);
|
|
85815
86028
|
}
|
|
85816
|
-
function
|
|
85817
|
-
var _a, _b, _c;
|
|
86029
|
+
function _getInferredReturnTypeResult(type, callSiteInfo) {
|
|
86030
|
+
var _a, _b, _c, _d;
|
|
85818
86031
|
let returnType;
|
|
85819
86032
|
let isIncomplete = false;
|
|
85820
86033
|
const analyzeUnannotatedFunctions = true;
|
|
85821
86034
|
if (types_1.FunctionType.isStubDefinition(type)) {
|
|
85822
|
-
return types_1.UnknownType.create();
|
|
86035
|
+
return { type: types_1.UnknownType.create() };
|
|
85823
86036
|
}
|
|
85824
86037
|
if (types_1.FunctionType.isParamSpecValue(type)) {
|
|
85825
|
-
return types_1.UnknownType.create();
|
|
86038
|
+
return { type: types_1.UnknownType.create() };
|
|
85826
86039
|
}
|
|
85827
86040
|
if (types_1.FunctionType.isOverloaded(type) && !types_1.FunctionType.isSynthesizedMethod(type)) {
|
|
85828
|
-
return types_1.UnknownType.create();
|
|
86041
|
+
return { type: types_1.UnknownType.create() };
|
|
85829
86042
|
}
|
|
85830
|
-
|
|
85831
|
-
|
|
86043
|
+
const evalCount = ((_a = type.shared.inferredReturnType) == null ? void 0 : _a.evaluationCount) ?? 0;
|
|
86044
|
+
if (type.shared.inferredReturnType && !type.shared.inferredReturnType.isIncomplete) {
|
|
86045
|
+
returnType = type.shared.inferredReturnType.type;
|
|
86046
|
+
} else if (evalCount > maxReturnTypeInferenceAttempts) {
|
|
86047
|
+
returnType = types_1.UnknownType.create();
|
|
85832
86048
|
} else {
|
|
85833
86049
|
if (types_1.FunctionType.isInstanceMethod(type) && type.shared.name === "__init__") {
|
|
85834
86050
|
returnType = getNoneType();
|
|
@@ -85857,16 +86073,16 @@ var require_typeEvaluator = __commonJS({
|
|
|
85857
86073
|
if (type.shared.typeVarScopeId) {
|
|
85858
86074
|
typeVarScopes.push(type.shared.typeVarScopeId);
|
|
85859
86075
|
}
|
|
85860
|
-
if ((
|
|
86076
|
+
if ((_b = type.shared.methodClass) == null ? void 0 : _b.shared.typeVarScopeId) {
|
|
85861
86077
|
typeVarScopes.push(type.shared.methodClass.shared.typeVarScopeId);
|
|
85862
86078
|
}
|
|
85863
86079
|
returnType = (0, typeUtils_1.makeTypeVarsFree)(returnType, typeVarScopes);
|
|
85864
|
-
type.
|
|
86080
|
+
type.shared.inferredReturnType = { type: returnType, isIncomplete, evaluationCount: evalCount + 1 };
|
|
85865
86081
|
}
|
|
85866
86082
|
if (!isIncomplete && analyzeUnannotatedFunctions && (0, typeUtils_1.isPartlyUnknown)(returnType) && types_1.FunctionType.hasUnannotatedParams(type) && !types_1.FunctionType.isStubDefinition(type) && !types_1.FunctionType.isPyTypedDefinition(type) && callSiteInfo) {
|
|
85867
86083
|
let hasDecorators = false;
|
|
85868
86084
|
let isAsync = false;
|
|
85869
|
-
const declNode = (
|
|
86085
|
+
const declNode = (_c = type.shared.declaration) == null ? void 0 : _c.node;
|
|
85870
86086
|
if (declNode) {
|
|
85871
86087
|
if (declNode.d.decorators.length > 0) {
|
|
85872
86088
|
hasDecorators = true;
|
|
@@ -85879,14 +86095,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
85879
86095
|
const contextualReturnType = inferReturnTypeForCallSite(type, callSiteInfo);
|
|
85880
86096
|
if (contextualReturnType) {
|
|
85881
86097
|
returnType = contextualReturnType;
|
|
85882
|
-
if ((
|
|
86098
|
+
if ((_d = type.shared.declaration) == null ? void 0 : _d.node) {
|
|
85883
86099
|
const liveScopeIds = ParseTreeUtils.getTypeVarScopesForNode(type.shared.declaration.node);
|
|
85884
86100
|
returnType = (0, typeUtils_1.makeTypeVarsFree)(returnType, liveScopeIds);
|
|
85885
86101
|
}
|
|
85886
86102
|
}
|
|
85887
86103
|
}
|
|
85888
86104
|
}
|
|
85889
|
-
return returnType;
|
|
86105
|
+
return { type: returnType, isIncomplete };
|
|
85890
86106
|
}
|
|
85891
86107
|
function inferReturnTypeForCallSite(type, callSiteInfo) {
|
|
85892
86108
|
const args = callSiteInfo.args;
|
|
@@ -87225,7 +87441,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
87225
87441
|
recursionCount
|
|
87226
87442
|
);
|
|
87227
87443
|
}
|
|
87228
|
-
function isTypeComparable(leftType, rightType) {
|
|
87444
|
+
function isTypeComparable(leftType, rightType, assumeIsOperator = false) {
|
|
87229
87445
|
var _a, _b;
|
|
87230
87446
|
if ((0, types_1.isAnyOrUnknown)(leftType) || (0, types_1.isAnyOrUnknown)(rightType)) {
|
|
87231
87447
|
return true;
|
|
@@ -87285,6 +87501,12 @@ var require_typeEvaluator = __commonJS({
|
|
|
87285
87501
|
if (assignType(genericLeftType, genericRightType) || assignType(genericRightType, genericLeftType)) {
|
|
87286
87502
|
return true;
|
|
87287
87503
|
}
|
|
87504
|
+
if (assumeIsOperator && (0, typeUtils_1.isNoneInstance)(rightType)) {
|
|
87505
|
+
if ((0, typeUtils_1.isNoneInstance)(leftType)) {
|
|
87506
|
+
return true;
|
|
87507
|
+
}
|
|
87508
|
+
return assignType(leftType, rightType);
|
|
87509
|
+
}
|
|
87288
87510
|
if (types_1.ClassType.isBuiltIn(leftType) && types_1.ClassType.isBuiltIn(rightType) && types_1.TypeBase.isInstance(rightType)) {
|
|
87289
87511
|
let boolType;
|
|
87290
87512
|
let intType;
|
|
@@ -88095,58 +88317,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
88095
88317
|
}
|
|
88096
88318
|
return canAssign;
|
|
88097
88319
|
}
|
|
88098
|
-
function
|
|
88099
|
-
if (recursionCount > types_1.maxTypeRecursionCount) {
|
|
88100
|
-
return void 0;
|
|
88101
|
-
}
|
|
88102
|
-
recursionCount++;
|
|
88103
|
-
if (assignedType.shared.typeParams.length > 0 && assignedType.priv.typeArgs && assignedType.priv.typeArgs.length <= assignedType.shared.typeParams.length && !assignedType.priv.tupleTypeArgs) {
|
|
88104
|
-
const constraints = new constraintTracker_1.ConstraintTracker();
|
|
88105
|
-
(0, constraintSolver_1.addConstraintsForExpectedType)(evaluatorInterface, types_1.ClassType.specialize(
|
|
88106
|
-
assignedType,
|
|
88107
|
-
/* typeArgs */
|
|
88108
|
-
void 0
|
|
88109
|
-
), declaredType, constraints, ParseTreeUtils.getTypeVarScopesForNode(node), node.start);
|
|
88110
|
-
let replacedTypeArg = false;
|
|
88111
|
-
const solution = (0, constraintSolver_1.solveConstraints)(evaluatorInterface, constraints).getMainSolutionSet();
|
|
88112
|
-
const newTypeArgs = assignedType.priv.typeArgs.map((typeArg, index) => {
|
|
88113
|
-
const typeParam = assignedType.shared.typeParams[index];
|
|
88114
|
-
const expectedTypeArgType = solution.getType(typeParam);
|
|
88115
|
-
if (expectedTypeArgType) {
|
|
88116
|
-
if ((0, types_1.isAnyOrUnknown)(expectedTypeArgType) || (0, types_1.isAnyOrUnknown)(typeArg)) {
|
|
88117
|
-
replacedTypeArg = true;
|
|
88118
|
-
return expectedTypeArgType;
|
|
88119
|
-
}
|
|
88120
|
-
if ((0, types_1.isClassInstance)(expectedTypeArgType) && (0, types_1.isClassInstance)(typeArg)) {
|
|
88121
|
-
const recursiveReplacement = replaceTypeArgsWithAny(node, expectedTypeArgType, typeArg, recursionCount);
|
|
88122
|
-
if (recursiveReplacement) {
|
|
88123
|
-
replacedTypeArg = true;
|
|
88124
|
-
return recursiveReplacement;
|
|
88125
|
-
}
|
|
88126
|
-
} else if ((0, typeUtils_1.containsAnyRecursive)(expectedTypeArgType)) {
|
|
88127
|
-
const variance = types_1.TypeVarType.getVariance(typeParam);
|
|
88128
|
-
const isSubtype = assignType(expectedTypeArgType, typeArg);
|
|
88129
|
-
const isSupertype = assignType(typeArg, expectedTypeArgType);
|
|
88130
|
-
if ((variance === 4 || isSubtype) && (variance === 3 || isSupertype)) {
|
|
88131
|
-
replacedTypeArg = true;
|
|
88132
|
-
return expectedTypeArgType;
|
|
88133
|
-
}
|
|
88134
|
-
}
|
|
88135
|
-
}
|
|
88136
|
-
return typeArg;
|
|
88137
|
-
});
|
|
88138
|
-
if (replacedTypeArg) {
|
|
88139
|
-
return types_1.ClassType.specialize(assignedType, newTypeArgs);
|
|
88140
|
-
}
|
|
88141
|
-
}
|
|
88142
|
-
if (types_1.ClassType.isSameGenericClass(declaredType, assignedType)) {
|
|
88143
|
-
if ((0, typeUtils_1.containsAnyRecursive)(assignedType) && !(0, typeUtils_1.containsAnyRecursive)(declaredType)) {
|
|
88144
|
-
return declaredType;
|
|
88145
|
-
}
|
|
88146
|
-
}
|
|
88147
|
-
return void 0;
|
|
88148
|
-
}
|
|
88149
|
-
function narrowTypeBasedOnAssignment(node, declaredType, assignedTypeResult) {
|
|
88320
|
+
function narrowTypeBasedOnAssignment(declaredType, assignedTypeResult) {
|
|
88150
88321
|
const narrowedType = (0, typeUtils_1.mapSubtypes)(assignedTypeResult.type, (assignedSubtype) => {
|
|
88151
88322
|
if ((0, types_1.isClass)(assignedSubtype) && (0, typeUtils_1.isLiteralType)(assignedSubtype)) {
|
|
88152
88323
|
if ((0, types_1.isUnion)(declaredType) && types_1.UnionType.containsType(declaredType, assignedSubtype)) {
|
|
@@ -88154,33 +88325,24 @@ var require_typeEvaluator = __commonJS({
|
|
|
88154
88325
|
}
|
|
88155
88326
|
}
|
|
88156
88327
|
const narrowedSubtype = (0, typeUtils_1.mapSubtypes)(declaredType, (declaredSubtype) => {
|
|
88157
|
-
if ((
|
|
88158
|
-
return
|
|
88328
|
+
if (!assignType(declaredSubtype, assignedSubtype)) {
|
|
88329
|
+
return void 0;
|
|
88159
88330
|
}
|
|
88160
|
-
if (
|
|
88161
|
-
|
|
88162
|
-
|
|
88163
|
-
|
|
88164
|
-
if ((0, types_1.isClass)(
|
|
88165
|
-
const result = replaceTypeArgsWithAny(node, declaredSubtype, assignedSubtype);
|
|
88166
|
-
if (result) {
|
|
88167
|
-
assignedSubtype = result;
|
|
88168
|
-
}
|
|
88331
|
+
if ((0, types_1.isUnknown)(assignedSubtype)) {
|
|
88332
|
+
return assignedSubtype;
|
|
88333
|
+
}
|
|
88334
|
+
if (assignType(assignedSubtype, declaredSubtype)) {
|
|
88335
|
+
if ((0, types_1.isClass)(assignedSubtype) && assignedSubtype.priv.typedDictNarrowedEntries && (0, types_1.isTypeSame)(assignedSubtype, declaredSubtype, { ignoreTypedDictNarrowEntries: true })) {
|
|
88169
88336
|
return assignedSubtype;
|
|
88170
88337
|
}
|
|
88171
|
-
if (
|
|
88172
|
-
|
|
88173
|
-
|
|
88174
|
-
|
|
88175
|
-
assignedSubtype,
|
|
88176
|
-
/* includeUnknown */
|
|
88177
|
-
false
|
|
88178
|
-
) && !(0, typeUtils_1.containsAnyRecursive)(declaredSubtype)) {
|
|
88179
|
-
return declaredSubtype;
|
|
88338
|
+
if ((0, types_1.isClassInstance)(declaredSubtype) && types_1.ClassType.isProtocolClass(declaredSubtype)) {
|
|
88339
|
+
if ((0, types_1.isFunction)(assignedSubtype) || (0, types_1.isOverloaded)(assignedSubtype)) {
|
|
88340
|
+
return assignedSubtype;
|
|
88341
|
+
}
|
|
88180
88342
|
}
|
|
88181
|
-
return
|
|
88343
|
+
return declaredSubtype;
|
|
88182
88344
|
}
|
|
88183
|
-
return
|
|
88345
|
+
return assignedSubtype;
|
|
88184
88346
|
});
|
|
88185
88347
|
if ((0, types_1.isNever)(narrowedSubtype)) {
|
|
88186
88348
|
return assignedSubtype;
|
|
@@ -88188,11 +88350,11 @@ var require_typeEvaluator = __commonJS({
|
|
|
88188
88350
|
return narrowedSubtype;
|
|
88189
88351
|
});
|
|
88190
88352
|
if ((0, typeUtils_1.isIncompleteUnknown)(narrowedType)) {
|
|
88191
|
-
return { type: narrowedType };
|
|
88353
|
+
return { type: narrowedType, isIncomplete: assignedTypeResult.isIncomplete };
|
|
88192
88354
|
} else if ((0, types_1.isUnknown)(narrowedType)) {
|
|
88193
|
-
return { type: (0, types_1.combineTypes)([narrowedType, declaredType]) };
|
|
88355
|
+
return { type: (0, types_1.combineTypes)([narrowedType, declaredType]), isIncomplete: assignedTypeResult.isIncomplete };
|
|
88194
88356
|
}
|
|
88195
|
-
return { type: narrowedType };
|
|
88357
|
+
return { type: narrowedType, isIncomplete: assignedTypeResult.isIncomplete };
|
|
88196
88358
|
}
|
|
88197
88359
|
function validateOverrideMethod(baseMethod, overrideMethod, baseClass, diag, enforceParamNames = true) {
|
|
88198
88360
|
if (!(0, types_1.isFunction)(baseMethod) && !(0, types_1.isOverloaded)(baseMethod)) {
|
|
@@ -88243,9 +88405,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
88243
88405
|
overrideOverload,
|
|
88244
88406
|
/* diag */
|
|
88245
88407
|
void 0,
|
|
88246
|
-
enforceParamNames
|
|
88247
|
-
/* exemptSelfClsParam */
|
|
88248
|
-
false
|
|
88408
|
+
enforceParamNames
|
|
88249
88409
|
);
|
|
88250
88410
|
if (isCompatible && index <= previousMatchIndex && possibleMatchIndex === void 0) {
|
|
88251
88411
|
possibleMatchIndex = index;
|
|
@@ -88300,7 +88460,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
88300
88460
|
/* AssignTypeFlags.Default */
|
|
88301
88461
|
);
|
|
88302
88462
|
}
|
|
88303
|
-
function validateOverrideMethodInternal(baseMethod, overrideMethod, diag, enforceParamNames
|
|
88463
|
+
function validateOverrideMethodInternal(baseMethod, overrideMethod, diag, enforceParamNames) {
|
|
88304
88464
|
const baseParamDetails = (0, parameterUtils_1.getParamListDetails)(baseMethod);
|
|
88305
88465
|
const overrideParamDetails = (0, parameterUtils_1.getParamListDetails)(overrideMethod);
|
|
88306
88466
|
const constraints = new constraintTracker_1.ConstraintTracker();
|
|
@@ -88334,8 +88494,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
88334
88494
|
baseParamDetails.params[i].type,
|
|
88335
88495
|
diag == null ? void 0 : diag.createAddendum(),
|
|
88336
88496
|
constraints,
|
|
88337
|
-
|
|
88338
|
-
/* AssignTypeFlags.
|
|
88497
|
+
0
|
|
88498
|
+
/* AssignTypeFlags.Default */
|
|
88339
88499
|
)) {
|
|
88340
88500
|
localize_1.LocAddendum.overrideParamType().format({
|
|
88341
88501
|
index: i + 1,
|
|
@@ -88363,7 +88523,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
88363
88523
|
}
|
|
88364
88524
|
const positionalParamCount = Math.min(baseParamDetails.positionParamCount, overrideParamDetails.positionParamCount);
|
|
88365
88525
|
for (let i = 0; i < positionalParamCount; i++) {
|
|
88366
|
-
if (i === 0
|
|
88526
|
+
if (i === 0) {
|
|
88367
88527
|
if (types_1.FunctionType.isInstanceMethod(overrideMethod) || types_1.FunctionType.isClassMethod(overrideMethod) || types_1.FunctionType.isConstructorMethod(overrideMethod)) {
|
|
88368
88528
|
continue;
|
|
88369
88529
|
}
|
|
@@ -88401,14 +88561,14 @@ var require_typeEvaluator = __commonJS({
|
|
|
88401
88561
|
const overrideParamType = overrideParamDetails.params[i].type;
|
|
88402
88562
|
const baseIsSynthesizedTypeVar = (0, types_1.isTypeVar)(baseParamType) && baseParamType.shared.isSynthesized;
|
|
88403
88563
|
const overrideIsSynthesizedTypeVar = (0, types_1.isTypeVar)(overrideParamType) && overrideParamType.shared.isSynthesized;
|
|
88404
|
-
if (!
|
|
88564
|
+
if (!baseIsSynthesizedTypeVar && !overrideIsSynthesizedTypeVar) {
|
|
88405
88565
|
if (baseParam.category !== overrideParam.category || !assignType(
|
|
88406
88566
|
overrideParamType,
|
|
88407
88567
|
baseParamType,
|
|
88408
88568
|
diag == null ? void 0 : diag.createAddendum(),
|
|
88409
88569
|
constraints,
|
|
88410
|
-
|
|
88411
|
-
/* AssignTypeFlags.
|
|
88570
|
+
0
|
|
88571
|
+
/* AssignTypeFlags.Default */
|
|
88412
88572
|
)) {
|
|
88413
88573
|
diag == null ? void 0 : diag.addMessage(localize_1.LocAddendum.overrideParamType().format({
|
|
88414
88574
|
index: i + 1,
|
|
@@ -88452,8 +88612,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
88452
88612
|
baseParamType,
|
|
88453
88613
|
diag == null ? void 0 : diag.createAddendum(),
|
|
88454
88614
|
constraints,
|
|
88455
|
-
|
|
88456
|
-
/* AssignTypeFlags.
|
|
88615
|
+
0
|
|
88616
|
+
/* AssignTypeFlags.Default */
|
|
88457
88617
|
)) {
|
|
88458
88618
|
diag == null ? void 0 : diag.addMessage(localize_1.LocAddendum.overrideParamKeywordType().format({
|
|
88459
88619
|
name: overrideParamDetails.params[overrideParamDetails.argsIndex].param.name ?? "?",
|
|
@@ -88489,8 +88649,8 @@ var require_typeEvaluator = __commonJS({
|
|
|
88489
88649
|
paramInfo.type,
|
|
88490
88650
|
diag == null ? void 0 : diag.createAddendum(),
|
|
88491
88651
|
constraints,
|
|
88492
|
-
|
|
88493
|
-
/* AssignTypeFlags.
|
|
88652
|
+
0
|
|
88653
|
+
/* AssignTypeFlags.Default */
|
|
88494
88654
|
)) {
|
|
88495
88655
|
diag == null ? void 0 : diag.addMessage(localize_1.LocAddendum.overrideParamKeywordType().format({
|
|
88496
88656
|
name: paramInfo.param.name ?? "?",
|
|
@@ -88669,6 +88829,9 @@ var require_typeEvaluator = __commonJS({
|
|
|
88669
88829
|
true
|
|
88670
88830
|
);
|
|
88671
88831
|
}
|
|
88832
|
+
if (functionType.priv.strippedFirstParamType) {
|
|
88833
|
+
return functionType;
|
|
88834
|
+
}
|
|
88672
88835
|
if (types_1.FunctionType.isInstanceMethod(functionType)) {
|
|
88673
88836
|
if ((0, typeUtils_1.isInstantiableMetaclass)(baseType)) {
|
|
88674
88837
|
return functionType;
|
|
@@ -88721,6 +88884,18 @@ var require_typeEvaluator = __commonJS({
|
|
|
88721
88884
|
constraints.setBounds(memberTypeFirstParamType, types_1.TypeBase.isInstantiable(memberTypeFirstParamType) ? (0, typeUtils_1.convertToInstance)(firstParamType) : firstParamType);
|
|
88722
88885
|
} else {
|
|
88723
88886
|
const subDiag = diag == null ? void 0 : diag.createAddendum();
|
|
88887
|
+
if ((0, types_1.isFunction)(memberTypeFirstParamType) || (0, types_1.isOverloaded)(memberTypeFirstParamType)) {
|
|
88888
|
+
if ((0, types_1.isClassInstance)(firstParamType) && types_1.ClassType.isProtocolClass(firstParamType)) {
|
|
88889
|
+
if (subDiag) {
|
|
88890
|
+
subDiag.addMessage(localize_1.LocMessage.bindTypeMismatch().format({
|
|
88891
|
+
type: printType(firstParamType),
|
|
88892
|
+
methodName: memberType.shared.name || "<anonymous>",
|
|
88893
|
+
paramName: memberTypeFirstParam.name || "__p0"
|
|
88894
|
+
}));
|
|
88895
|
+
}
|
|
88896
|
+
return void 0;
|
|
88897
|
+
}
|
|
88898
|
+
}
|
|
88724
88899
|
if (!assignType(memberTypeFirstParamType, firstParamType, subDiag == null ? void 0 : subDiag.createAddendum(), constraints, 8192, recursionCount)) {
|
|
88725
88900
|
if (memberTypeFirstParam.name && !types_1.FunctionParam.isNameSynthesized(memberTypeFirstParam) && types_1.FunctionParam.isTypeDeclared(memberTypeFirstParam)) {
|
|
88726
88901
|
if (subDiag) {
|
|
@@ -88973,7 +89148,7 @@ var require_typeEvaluator = __commonJS({
|
|
|
88973
89148
|
function printControlFlowGraph(flowNode, reference, callName, logger) {
|
|
88974
89149
|
return codeFlowEngine.printControlFlowGraph(flowNode, reference, callName, logger);
|
|
88975
89150
|
}
|
|
88976
|
-
const
|
|
89151
|
+
const getInferredReturnTypeResult = wrapWithLogger(_getInferredReturnTypeResult);
|
|
88977
89152
|
const evaluatorInterface = {
|
|
88978
89153
|
runWithCancellationToken,
|
|
88979
89154
|
getType,
|
|
@@ -89175,6 +89350,7 @@ var require_checker = __commonJS({
|
|
|
89175
89350
|
this._isUnboundCheckSuppressed = false;
|
|
89176
89351
|
this._scopedNodes = [];
|
|
89177
89352
|
this._typeParamLists = [];
|
|
89353
|
+
this._multipartImports = [];
|
|
89178
89354
|
this._moduleNode = parseResults.parseTree;
|
|
89179
89355
|
this._fileInfo = AnalyzerNodeInfo.getFileInfo(this._moduleNode);
|
|
89180
89356
|
}
|
|
@@ -89195,6 +89371,7 @@ var require_checker = __commonJS({
|
|
|
89195
89371
|
this._reportUnusedDunderAllSymbols(dunderAllInfo.stringNodes);
|
|
89196
89372
|
}
|
|
89197
89373
|
this._validateSymbolTables();
|
|
89374
|
+
this._reportUnusedMultipartImports();
|
|
89198
89375
|
this._reportDuplicateImports();
|
|
89199
89376
|
}
|
|
89200
89377
|
walk(node) {
|
|
@@ -89948,7 +90125,9 @@ var require_checker = __commonJS({
|
|
|
89948
90125
|
const typeResult = this._evaluator.getTypeResult(node.d.member);
|
|
89949
90126
|
const type = (typeResult == null ? void 0 : typeResult.type) ?? types_1.UnknownType.create();
|
|
89950
90127
|
const leftExprType = this._evaluator.getType(node.d.leftExpr);
|
|
89951
|
-
|
|
90128
|
+
const moduleName = leftExprType && (0, types_1.isModule)(leftExprType) ? leftExprType.priv.moduleName : void 0;
|
|
90129
|
+
const isImportedFromTyping = moduleName === "typing" || moduleName === "typing_extensions";
|
|
90130
|
+
this._reportDeprecatedUseForType(node.d.member, type, isImportedFromTyping);
|
|
89952
90131
|
if (typeResult == null ? void 0 : typeResult.memberAccessDeprecationInfo) {
|
|
89953
90132
|
this._reportDeprecatedUseForMemberAccess(node.d.member, typeResult.memberAccessDeprecationInfo);
|
|
89954
90133
|
}
|
|
@@ -89959,6 +90138,10 @@ var require_checker = __commonJS({
|
|
|
89959
90138
|
visitImportAs(node) {
|
|
89960
90139
|
this._conditionallyReportShadowedImport(node);
|
|
89961
90140
|
this._evaluator.evaluateTypesForStatement(node);
|
|
90141
|
+
const nameParts = node.d.module.d.nameParts;
|
|
90142
|
+
if (nameParts.length > 1 && !node.d.alias) {
|
|
90143
|
+
this._multipartImports.push(node);
|
|
90144
|
+
}
|
|
89962
90145
|
return true;
|
|
89963
90146
|
}
|
|
89964
90147
|
visitImportFrom(node) {
|
|
@@ -90013,7 +90196,8 @@ var require_checker = __commonJS({
|
|
|
90013
90196
|
let isImportFromTyping = false;
|
|
90014
90197
|
if (((_b = node.parent) == null ? void 0 : _b.nodeType) === 25) {
|
|
90015
90198
|
if (node.parent.d.module.d.leadingDots === 0 && node.parent.d.module.d.nameParts.length === 1) {
|
|
90016
|
-
|
|
90199
|
+
const namePart = node.parent.d.module.d.nameParts[0].d.value;
|
|
90200
|
+
if (namePart === "typing" || namePart === "typing_extensions") {
|
|
90017
90201
|
isImportFromTyping = true;
|
|
90018
90202
|
}
|
|
90019
90203
|
}
|
|
@@ -90103,6 +90287,49 @@ var require_checker = __commonJS({
|
|
|
90103
90287
|
}
|
|
90104
90288
|
return false;
|
|
90105
90289
|
}
|
|
90290
|
+
_reportUnusedMultipartImports() {
|
|
90291
|
+
this._multipartImports.forEach((node) => {
|
|
90292
|
+
const nameParts = node.d.module.d.nameParts;
|
|
90293
|
+
if (this._isMultipartImportUnused(node)) {
|
|
90294
|
+
const multipartName = nameParts.map((np) => np.d.value).join(".");
|
|
90295
|
+
let textRange = { start: nameParts[0].start, length: nameParts[0].length };
|
|
90296
|
+
textRange = textRange_1.TextRange.extend(textRange, nameParts[nameParts.length - 1]);
|
|
90297
|
+
this._fileInfo.diagnosticSink.addUnusedCodeWithTextRange(localize_1.LocMessage.unaccessedSymbol().format({ name: multipartName }), textRange, {
|
|
90298
|
+
action: "pyright.unusedImport"
|
|
90299
|
+
/* Commands.unusedImport */
|
|
90300
|
+
});
|
|
90301
|
+
this._evaluator.addDiagnosticForTextRange(this._fileInfo, diagnosticRules_1.DiagnosticRule.reportUnusedImport, localize_1.LocMessage.unaccessedImport().format({ name: multipartName }), textRange);
|
|
90302
|
+
}
|
|
90303
|
+
});
|
|
90304
|
+
}
|
|
90305
|
+
_isMultipartImportUnused(node) {
|
|
90306
|
+
var _a;
|
|
90307
|
+
const nameParts = node.d.module.d.nameParts;
|
|
90308
|
+
(0, debug_1.assert)(nameParts.length > 1);
|
|
90309
|
+
let moduleType = (_a = this._evaluator.evaluateTypeForSubnode(node, () => {
|
|
90310
|
+
this._evaluator.evaluateTypesForStatement(node);
|
|
90311
|
+
})) == null ? void 0 : _a.type;
|
|
90312
|
+
if (!moduleType || !(0, types_1.isModule)(moduleType)) {
|
|
90313
|
+
return false;
|
|
90314
|
+
}
|
|
90315
|
+
for (let i = 1; i < nameParts.length - 1; i++) {
|
|
90316
|
+
const symbol2 = types_1.ModuleType.getField(moduleType, nameParts[i].d.value);
|
|
90317
|
+
if (!symbol2) {
|
|
90318
|
+
return false;
|
|
90319
|
+
}
|
|
90320
|
+
const submoduleType = symbol2.getSynthesizedType();
|
|
90321
|
+
if (!submoduleType || !(0, types_1.isModule)(submoduleType.type)) {
|
|
90322
|
+
return false;
|
|
90323
|
+
}
|
|
90324
|
+
moduleType = submoduleType.type;
|
|
90325
|
+
}
|
|
90326
|
+
const lastPartName = nameParts[nameParts.length - 1].d.value;
|
|
90327
|
+
const symbol = types_1.ModuleType.getField(moduleType, lastPartName);
|
|
90328
|
+
if (!symbol) {
|
|
90329
|
+
return false;
|
|
90330
|
+
}
|
|
90331
|
+
return !this._fileInfo.accessedSymbolSet.has(symbol.id);
|
|
90332
|
+
}
|
|
90106
90333
|
_getImportResult(node, uri) {
|
|
90107
90334
|
const execEnv = this._importResolver.getConfigOptions().findExecEnvironment(uri);
|
|
90108
90335
|
const moduleNameNode = node.parent.d.module;
|
|
@@ -90317,6 +90544,7 @@ var require_checker = __commonJS({
|
|
|
90317
90544
|
// have overlapping types.
|
|
90318
90545
|
_validateComparisonTypes(node) {
|
|
90319
90546
|
let rightExpression = node.d.rightExpr;
|
|
90547
|
+
const assumeIsOperator = node.d.operator === 39 || node.d.operator === 40;
|
|
90320
90548
|
if (rightExpression.nodeType === 7 && !rightExpression.d.hasParens && ParseTreeUtils.operatorSupportsChaining(rightExpression.d.operator)) {
|
|
90321
90549
|
rightExpression = rightExpression.d.leftExpr;
|
|
90322
90550
|
}
|
|
@@ -90361,7 +90589,7 @@ var require_checker = __commonJS({
|
|
|
90361
90589
|
if (isComparable) {
|
|
90362
90590
|
return;
|
|
90363
90591
|
}
|
|
90364
|
-
if (this._evaluator.isTypeComparable(leftSubtype, rightSubtype)) {
|
|
90592
|
+
if (this._evaluator.isTypeComparable(leftSubtype, rightSubtype, assumeIsOperator)) {
|
|
90365
90593
|
isComparable = true;
|
|
90366
90594
|
}
|
|
90367
90595
|
return rightSubtype;
|
|
@@ -91372,16 +91600,10 @@ var require_checker = __commonJS({
|
|
|
91372
91600
|
}
|
|
91373
91601
|
} else {
|
|
91374
91602
|
const nameParts = decl.node.d.module.d.nameParts;
|
|
91375
|
-
if (nameParts.length
|
|
91376
|
-
|
|
91377
|
-
|
|
91378
|
-
|
|
91379
|
-
this._fileInfo.diagnosticSink.addUnusedCodeWithTextRange(localize_1.LocMessage.unaccessedSymbol().format({ name: multipartName }), textRange, {
|
|
91380
|
-
action: "pyright.unusedImport"
|
|
91381
|
-
/* Commands.unusedImport */
|
|
91382
|
-
});
|
|
91383
|
-
this._evaluator.addDiagnosticForTextRange(this._fileInfo, diagnosticRules_1.DiagnosticRule.reportUnusedImport, localize_1.LocMessage.unaccessedImport().format({ name: multipartName }), textRange);
|
|
91384
|
-
return;
|
|
91603
|
+
if (nameParts.length === 1) {
|
|
91604
|
+
nameNode = nameParts[0];
|
|
91605
|
+
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportUnusedImport, localize_1.LocMessage.unaccessedImport().format({ name: nameNode.d.value }), nameNode);
|
|
91606
|
+
message = localize_1.LocMessage.unaccessedImport().format({ name: nameNode.d.value });
|
|
91385
91607
|
}
|
|
91386
91608
|
}
|
|
91387
91609
|
} else if (decl.node.nodeType === 26) {
|
|
@@ -92102,7 +92324,7 @@ var require_checker = __commonJS({
|
|
|
92102
92324
|
}
|
|
92103
92325
|
if (declaredReturnType && !functionNeverReturns && implicitlyReturnsNone) {
|
|
92104
92326
|
if ((0, types_1.isNever)(declaredReturnType)) {
|
|
92105
|
-
if (!ParseTreeUtils.isSuiteEmpty(node.d.suite) && !types_1.FunctionType.isOverloaded(functionType)
|
|
92327
|
+
if (!ParseTreeUtils.isSuiteEmpty(node.d.suite) && !types_1.FunctionType.isOverloaded(functionType)) {
|
|
92106
92328
|
this._evaluator.addDiagnostic(diagnosticRules_1.DiagnosticRule.reportReturnType, localize_1.LocMessage.noReturnReturnsNone(), returnAnnotation);
|
|
92107
92329
|
}
|
|
92108
92330
|
} else if (!types_1.FunctionType.isAbstractMethod(functionType)) {
|
|
@@ -93253,8 +93475,9 @@ var require_checker = __commonJS({
|
|
|
93253
93475
|
return;
|
|
93254
93476
|
}
|
|
93255
93477
|
const baseClass = baseClassAndSymbol.classType;
|
|
93478
|
+
const baseClassSelf = types_1.ClassType.cloneAsInstance((0, typeUtils_1.selfSpecializeClass)(baseClass, { useBoundTypeVars: true }));
|
|
93256
93479
|
const childClassSelf = types_1.ClassType.cloneAsInstance((0, typeUtils_1.selfSpecializeClass)(childClassType, { useBoundTypeVars: true }));
|
|
93257
|
-
let baseType = (0, typeUtils_1.partiallySpecializeType)(this._evaluator.getEffectiveTypeOfSymbol(baseClassAndSymbol.symbol), baseClass, this._evaluator.getTypeClassType(),
|
|
93480
|
+
let baseType = (0, typeUtils_1.partiallySpecializeType)(this._evaluator.getEffectiveTypeOfSymbol(baseClassAndSymbol.symbol), baseClass, this._evaluator.getTypeClassType(), baseClassSelf);
|
|
93258
93481
|
overrideType = (0, typeUtils_1.partiallySpecializeType)(overrideType, childClassType, this._evaluator.getTypeClassType(), childClassSelf);
|
|
93259
93482
|
if (childClassType.shared.typeVarScopeId) {
|
|
93260
93483
|
overrideType = (0, typeUtils_1.makeTypeVarsBound)(overrideType, [childClassType.shared.typeVarScopeId]);
|
|
@@ -94379,7 +94602,7 @@ var require_sourceFile = __commonJS({
|
|
|
94379
94602
|
}
|
|
94380
94603
|
};
|
|
94381
94604
|
var SourceFile = class {
|
|
94382
|
-
constructor(serviceProvider, uri, moduleName, isThirdPartyImport, isThirdPartyPyTypedPresent, editMode, console2, logTracker, ipythonMode) {
|
|
94605
|
+
constructor(serviceProvider, uri, moduleName, isThirdPartyImport, isThirdPartyPyTypedPresent, isModulePrivate, editMode, console2, logTracker, ipythonMode) {
|
|
94383
94606
|
this.serviceProvider = serviceProvider;
|
|
94384
94607
|
this._diagnosticRuleSet = (0, configOptions_1.getBasicDiagnosticRuleSet)();
|
|
94385
94608
|
this._ipythonMode = IPythonMode.None;
|
|
@@ -94393,6 +94616,7 @@ var require_sourceFile = __commonJS({
|
|
|
94393
94616
|
this._isStubFile = uri.hasExtension(".pyi");
|
|
94394
94617
|
this._isThirdPartyImport = isThirdPartyImport;
|
|
94395
94618
|
this._isThirdPartyPyTypedPresent = isThirdPartyPyTypedPresent;
|
|
94619
|
+
this._isModulePrivate = isModulePrivate;
|
|
94396
94620
|
const fileName = uri.fileName;
|
|
94397
94621
|
this._isTypingStubFile = this._isStubFile && (this._uri.pathEndsWith("stdlib/typing.pyi") || fileName === "typing_extensions.pyi");
|
|
94398
94622
|
this._isTypingExtensionsStubFile = this._isStubFile && fileName === "typing_extensions.pyi";
|
|
@@ -95056,6 +95280,7 @@ var require_sourceFile = __commonJS({
|
|
|
95056
95280
|
isTypeshedStubFile: this._isTypeshedStubFile,
|
|
95057
95281
|
isBuiltInStubFile: this._isBuiltInStubFile,
|
|
95058
95282
|
isInPyTypedPackage: this._isThirdPartyPyTypedPresent,
|
|
95283
|
+
isModulePrivate: this._isModulePrivate,
|
|
95059
95284
|
ipythonMode: this._ipythonMode,
|
|
95060
95285
|
accessedSymbolSet: /* @__PURE__ */ new Set()
|
|
95061
95286
|
};
|
|
@@ -106016,7 +106241,7 @@ var require_AnimationFrameAction = __commonJS({
|
|
|
106016
106241
|
return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
|
|
106017
106242
|
}
|
|
106018
106243
|
var actions = scheduler.actions;
|
|
106019
|
-
if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
|
|
106244
|
+
if (id != null && id === scheduler._scheduled && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
|
|
106020
106245
|
animationFrameProvider_1.animationFrameProvider.cancelAnimationFrame(id);
|
|
106021
106246
|
scheduler._scheduled = void 0;
|
|
106022
106247
|
}
|
|
@@ -106061,8 +106286,13 @@ var require_AnimationFrameScheduler = __commonJS({
|
|
|
106061
106286
|
}
|
|
106062
106287
|
AnimationFrameScheduler2.prototype.flush = function(action) {
|
|
106063
106288
|
this._active = true;
|
|
106064
|
-
var flushId
|
|
106065
|
-
|
|
106289
|
+
var flushId;
|
|
106290
|
+
if (action) {
|
|
106291
|
+
flushId = action.id;
|
|
106292
|
+
} else {
|
|
106293
|
+
flushId = this._scheduled;
|
|
106294
|
+
this._scheduled = void 0;
|
|
106295
|
+
}
|
|
106066
106296
|
var actions = this.actions;
|
|
106067
106297
|
var error;
|
|
106068
106298
|
action = action || actions.shift();
|
|
@@ -110546,7 +110776,6 @@ var require_merge2 = __commonJS({
|
|
|
110546
110776
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
110547
110777
|
exports2.merge = void 0;
|
|
110548
110778
|
var lift_1 = require_lift();
|
|
110549
|
-
var argsOrArgArray_1 = require_argsOrArgArray();
|
|
110550
110779
|
var mergeAll_1 = require_mergeAll();
|
|
110551
110780
|
var args_1 = require_args();
|
|
110552
110781
|
var from_1 = require_from();
|
|
@@ -110557,7 +110786,6 @@ var require_merge2 = __commonJS({
|
|
|
110557
110786
|
}
|
|
110558
110787
|
var scheduler = args_1.popScheduler(args);
|
|
110559
110788
|
var concurrent = args_1.popNumber(args, Infinity);
|
|
110560
|
-
args = argsOrArgArray_1.argsOrArgArray(args);
|
|
110561
110789
|
return lift_1.operate(function(source, subscriber) {
|
|
110562
110790
|
mergeAll_1.mergeAll(concurrent)(from_1.from(__spreadArray([source], __read(args)), scheduler)).subscribe(subscriber);
|
|
110563
110791
|
});
|
|
@@ -115805,6 +116033,9 @@ var PythonCodeActionProvider = class {
|
|
|
115805
116033
|
ignoreAction(document, range) {
|
|
115806
116034
|
const ignoreTxt = "# type: ignore";
|
|
115807
116035
|
const doc = import_coc4.workspace.getDocument(document.uri);
|
|
116036
|
+
if (!doc) {
|
|
116037
|
+
return null;
|
|
116038
|
+
}
|
|
115808
116039
|
if (this.wholeRange(document, range)) {
|
|
115809
116040
|
let pos = import_coc4.Position.create(0, 0);
|
|
115810
116041
|
if (doc.getline(0).startsWith("#!")) pos = import_coc4.Position.create(1, 0);
|
|
@@ -116897,7 +117128,7 @@ var TypeInlayHintsProvider = class {
|
|
|
116897
117128
|
});
|
|
116898
117129
|
import_coc11.workspace.onDidChangeTextDocument((e) => {
|
|
116899
117130
|
const doc = import_coc11.workspace.getDocument(e.bufnr);
|
|
116900
|
-
if (doc.languageId === "python") {
|
|
117131
|
+
if ((doc == null ? void 0 : doc.languageId) === "python") {
|
|
116901
117132
|
this._onDidChangeInlayHints.fire();
|
|
116902
117133
|
}
|
|
116903
117134
|
});
|
|
@@ -118911,6 +119142,9 @@ var PyDocStyle = class extends BaseLinter {
|
|
|
118911
119142
|
outputLines.push(oldOutputLines[2 * counter] + oldOutputLines[2 * counter + 1]);
|
|
118912
119143
|
}
|
|
118913
119144
|
const doc = import_coc21.workspace.getDocument(document.uri);
|
|
119145
|
+
if (!doc) {
|
|
119146
|
+
return [];
|
|
119147
|
+
}
|
|
118914
119148
|
return outputLines.filter((value, index) => index < maxLines && value.indexOf(":") >= 0).map((line) => {
|
|
118915
119149
|
if (this.isWindows) {
|
|
118916
119150
|
return line.substring(line.indexOf(`${baseFileName}:`) + baseFileName.length + 1).trim();
|
|
@@ -119304,14 +119538,15 @@ var LintingEngine = class {
|
|
|
119304
119538
|
this.diagnosticCollection.set(document.uri, diagnostics);
|
|
119305
119539
|
}
|
|
119306
119540
|
createDiagnostics(message, document) {
|
|
119541
|
+
var _a;
|
|
119307
119542
|
let start = import_coc27.Position.create(message.line > 0 ? message.line - 1 : 0, message.column);
|
|
119308
119543
|
const endLine = message.endLine ?? message.line;
|
|
119309
119544
|
const endColumn = message.endColumn ?? message.column + 1;
|
|
119310
119545
|
let end = import_coc27.Position.create(endLine > 0 ? endLine - 1 : 0, endColumn);
|
|
119311
119546
|
const ms = /['"](.*?)['"]/g.exec(message.message);
|
|
119312
119547
|
if (ms && ms.length > 0) {
|
|
119313
|
-
const line = import_coc27.workspace.getDocument(document.uri).getline(message.line - 1);
|
|
119314
|
-
if (line.includes(ms[1])) {
|
|
119548
|
+
const line = (_a = import_coc27.workspace.getDocument(document.uri)) == null ? void 0 : _a.getline(message.line - 1);
|
|
119549
|
+
if (line == null ? void 0 : line.includes(ms[1])) {
|
|
119315
119550
|
const s = message.column > line.indexOf(ms[1]) ? message.column : line.indexOf(ms[1]);
|
|
119316
119551
|
start = import_coc27.Position.create(message.line - 1, s);
|
|
119317
119552
|
end = import_coc27.Position.create(message.line - 1, s + ms[1].length);
|
|
@@ -119447,6 +119682,9 @@ var LinterProvider = class {
|
|
|
119447
119682
|
}
|
|
119448
119683
|
onDocumentChanged(e) {
|
|
119449
119684
|
const document = import_coc28.workspace.getDocument(e.textDocument.uri);
|
|
119685
|
+
if (!document) {
|
|
119686
|
+
return;
|
|
119687
|
+
}
|
|
119450
119688
|
this.engine.lintDocument(document.textDocument, true).catch(() => {
|
|
119451
119689
|
});
|
|
119452
119690
|
}
|
|
@@ -119623,6 +119861,9 @@ async function extractVariable(root, document, range, outputChannel) {
|
|
|
119623
119861
|
return;
|
|
119624
119862
|
}
|
|
119625
119863
|
const doc = import_coc29.workspace.getDocument(document.uri);
|
|
119864
|
+
if (!doc) {
|
|
119865
|
+
return;
|
|
119866
|
+
}
|
|
119626
119867
|
const tempFile = await getTempFileWithDocumentContents(document);
|
|
119627
119868
|
const workspaceFolder = import_coc29.workspace.getWorkspaceFolder(doc.uri);
|
|
119628
119869
|
const workspaceRoot = workspaceFolder ? import_coc29.Uri.parse(workspaceFolder.uri).fsPath : import_coc29.workspace.cwd;
|
|
@@ -119644,6 +119885,9 @@ async function extractMethod(root, document, range, outputChannel) {
|
|
|
119644
119885
|
return;
|
|
119645
119886
|
}
|
|
119646
119887
|
const doc = import_coc29.workspace.getDocument(document.uri);
|
|
119888
|
+
if (!doc) {
|
|
119889
|
+
return;
|
|
119890
|
+
}
|
|
119647
119891
|
const tempFile = await getTempFileWithDocumentContents(document);
|
|
119648
119892
|
const workspaceFolder = import_coc29.workspace.getWorkspaceFolder(doc.uri);
|
|
119649
119893
|
const workspaceRoot = workspaceFolder ? import_coc29.Uri.parse(workspaceFolder.uri).fsPath : import_coc29.workspace.cwd;
|
|
@@ -119942,6 +120186,7 @@ async function activate(context) {
|
|
|
119942
120186
|
}
|
|
119943
120187
|
if (pyrightCfg.get("disableDiagnostics")) {
|
|
119944
120188
|
disabledFeatures.push("diagnostics");
|
|
120189
|
+
disabledFeatures.push("pullDiagnostic");
|
|
119945
120190
|
}
|
|
119946
120191
|
if (pyrightCfg.get("disableDocumentation")) {
|
|
119947
120192
|
disabledFeatures.push("hover");
|