Lucian Wischik
c0fbb93ee4
Debugging ( #7332 )
...
* launch.json CLI debug that bypasses webpack
I got a bit irritated in my edit-build-debug inner loop with the time to run webpack.
This commit adds a new launch target called "Pyright CLI (pyright-internal)" which bypasses webpack and just runs the package straight from the packages/pyright-internal/out directory where tsc has built it.
* fix outFiles directive
The VSCode docs say about outFiles:
> By default, VS Code will search your entire workspace, excluding node_modules, for sourcemaps. In large workspaces, this search might be slow. You can configure the locations where VS Code will search for source maps by setting the outFiles attribute in your launch.json.
I guess this is the right change to make? it didn't make any difference in VSCode debugger's ability to hit breakpoints, though.
---------
Co-authored-by: Eric Traut <eric@traut.com>
2024-02-25 15:26:06 -07:00
Eric Traut
f7e37d51b9
Added support for call-site return type inference for class and instance methods. This addresses https://github.com/microsoft/pylance-release/issues/5515 . ( #7335 )
2024-02-25 14:50:28 -07:00
Eric Traut
3232c25589
Added special-case handling for 'typing_extensions' module whose stubs are part of typeshed's stdlib stubs even though it is not part of stdlib. This addresses #7318 .
2024-02-24 05:13:20 -07:00
Eric Traut
22b94ae3c3
Fixed a bug that leads to incorrect type inference for a lambda when passed to a constructor in certain circumstances. This addresses #7326 .
2024-02-23 14:09:10 -07:00
Eric Traut
218ee2f82c
Fixed a bug that resulted in "reportUnnecessaryTypeIgnoreComment" diagnostics to be generated even if the source file was in the "ignore" list. This addresses #7325 .
2024-02-23 11:04:16 -07:00
Eric Traut
c8f1f082fc
Added support for concatenated strings used in a @deprecated
decorator. This addresses #7319 .
2024-02-23 08:09:20 -07:00
Eric Traut
2b36897227
Fixed a bug that resulted in a false negative when attempting to use TypedDict
or Protocol
as an upper bound when using PEP 695 syntax. This addresses #7317 .
2024-02-22 14:39:51 -07:00
Eric Traut
e67047551e
Improved consistency of documentation when talking about diagnostic settings.
2024-02-21 15:39:13 -07:00
Eric Traut
512e29e70e
Documented support for PEP 728.
2024-02-21 15:34:05 -07:00
Eric Traut
bcf694bd9c
Implemented provisional support for PEP 728 (support for extra items within TypedDicts). You must set enableExperimentalFeatures to true for now. This addresses #7232 . ( #7313 )
2024-02-21 15:33:28 -07:00
dependabot[bot]
87171fbf96
Bump ip from 2.0.0 to 2.0.1 ( #7304 )
...
Bumps [ip](https://github.com/indutny/node-ip ) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1 )
---
updated-dependencies:
- dependency-name: ip
dependency-type: indirect
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-20 12:11:31 -07:00
PylanceBot
e955fab18e
[PylanceBot] Pull Pylance with Pyright 1.1.351 ( #7298 )
...
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-20 10:58:51 -08:00
Eric Traut
bc2544c996
Published 1.1.351
2024-02-19 15:25:09 -07:00
Eric Traut
6078f3deea
Fixed build break.
2024-02-19 15:17:19 -07:00
Eric Traut
9265ebd4b0
Added check for the use of an implicit position-only parameter (one that starts with a double underscore) that is located after a non-position-only parameter. This addresses #7290 . ( #7297 )
2024-02-19 15:13:25 -07:00
Eric Traut
9af0c64c88
Fixed a bug that led to incorrect type evaluation for a call that targets a generic function that uses a default argument for one of the generic parameters. This addresses #7291 . ( #7296 )
2024-02-19 14:23:27 -07:00
Eric Traut
8cc8a75bf6
Fixed a bug that results in a false positive with the reportUnnecessaryCast
check if the second argument is a special form. This addresses #7294 .
2024-02-19 09:10:10 -07:00
Eric Traut
9e32b8fd57
Updated documentation to indicate support for PEP 742.
2024-02-19 01:17:00 -07:00
Eric Traut
08d3f6d38c
Added provisional support for draft PEP 742 (TypeIs).
2024-02-19 01:03:55 -07:00
Eric Traut
1700e5451b
Updated typeshed stubs to the latest version.
2024-02-19 00:36:06 -07:00
Eric Traut
d34a84c1d2
Fixed bug that results in a false positive error when calling update
on a TypedDict with zero defined entries. This addresses #7289 .
2024-02-18 13:48:29 -07:00
Eric Traut
caab6bdd02
Fixed bug that results in a false positive error when assigning a tuple value that includes an unpacked TypeVarTuple to another tuple that also includes an unpacked TypeVarTuple. This addresses #7285 . ( #7287 )
2024-02-17 16:12:38 -07:00
Eric Traut
169443d5e5
Fixed a false positive reportUnknownArgumentType
error when assigning an empty list or dict expression to an index expression subscripted with a slice. This addresses #7278 . ( #7286 )
2024-02-17 15:15:11 -07:00
Eric Traut
ab2c824167
Changed behavior of CLI's --watch
mode. Previously, it reported diagnostic deltas when it detected a change, but it is more useful if it reports all remaining diagnostics even for files that it didn't reanalyze due to a file change. This addresses #7267 .
2024-02-17 14:46:36 -07:00
Eric Traut
853241c9b4
Added missing check for inappropriate use of an unpacked TypeVarTuple within a TypeAliasType type parameter list. This addresses #7284 .
2024-02-17 13:41:15 -07:00
Eric Traut
effa6a24cb
Fixed a bug in the type narrowing logic for class pattern matching that resulted in incorrect narrowing in the negative (fall-through) case. This addresses #7280 . ( #7283 )
2024-02-17 01:34:55 -07:00
Eric Traut
5d78e9eeba
Change the heuristic for determining whether a metaclass supports __or__
. In the case where the metaclass derives from Any or Unknown, pyright now assumes that it doesn't override __or__
. This addresses #7260 .
2024-02-15 17:49:04 -08:00
Eric Traut
fed85eca65
Fixed a bug that results in a false positive error when a enum.nonmember
value is assigned to a class-scoped variable with a type annotation in an Enum class. This addresses #7265 . ( #7266 )
2024-02-14 19:42:36 -08:00
Eric Traut
4b206e3068
Fixed a bug that results in a false positive error when a method defined within a named tuple is overridden by a subclass. This addresses #7256 . ( #7259 )
2024-02-13 21:07:09 -08:00
Eric Traut
2ff6efb6d1
Fixed a recent regression that results in a false positive error when an Enum
subclass overrides __new__
or __init__
and then a subclass of that class assigns tuple values when defining enum members. This addresses #7252 . ( #7253 )
2024-02-13 01:02:59 -08:00
Eric Traut
6149e25c43
Fixed bug that results in a false positive "no overload implementation" error if an overloaded function is passed through a decorator that uses a ParamSpec. This addresses #7221 . ( #7246 )
2024-02-12 00:39:52 -08:00
PylanceBot
b1bb82d8f1
[PylanceBot] Pull Pylance with Pyright 1.1.350 ( #7240 )
...
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-09 13:35:42 -08:00
Erik De Bonte
ca64a6ceeb
Restrict vscode-pyright document selector to file
and untitled
schemes ( #7231 )
2024-02-08 15:41:21 -08:00
PylanceBot
e9f1cc51fe
[PylanceBot] Pull Pylance with Pyright 1.1.350 ( #7219 )
...
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-06 16:38:59 -08:00
Lucian Wischik
3f6e47f719
Clarify that "exclude" overrides include directories *and* files ( #7216 )
...
The exclude directive overrides include directories *and* include files.
I verified by experiment, and also by reading the source code https://github.com/ljw1004/pyright/blob/main/packages/pyright-internal/src/common/uri/uriUtils.ts#L54
2024-02-06 12:02:57 -08:00
Eric Traut
df9aa7cb01
Published 1.1.350
2024-02-05 08:37:40 -08:00
Eric Traut
ae4bc87530
Improved misleading diagnostic message when attempting to call a special type form.
2024-02-04 16:22:44 -08:00
Eric Traut
626f6553ab
Added missing check for out-of-bound index accesses for named tuple instances. This addresses #7196 . ( #7207 )
2024-02-04 15:26:04 -08:00
Eric Traut
e2fab5397c
Added check for use of TypedDict
or NamedTuple
as second argument to isinstance
call, which isn't allowed. This addresses #7203 . ( #7206 )
2024-02-04 14:53:33 -08:00
Eric Traut
63f7e9e7bb
Added check for an attempt to delete a named tuple entry. This addresses #7197 . ( #7205 )
2024-02-04 13:19:20 -08:00
Eric Traut
9334c9509f
Merge branch 'main' of https://github.com/microsoft/pyright into main
2024-02-04 12:46:15 -08:00
Eric Traut
87eb5c2b64
Updated typeshed stubs to the latest version.
2024-02-04 12:45:49 -08:00
Eric Traut
ab6a784f34
Added missing check for an attempt to override a field in a named tuple within a subclass. This addresses #7198 . ( #7199 )
2024-02-03 22:45:49 -08:00
Eric Traut
20c0423748
Added missing check for an attempt to override a field in a named tuple within a subclass. This addresses #7198 .
2024-02-03 22:37:44 -08:00
Eric Traut
fe00eaa8a4
Fixed bug in isinstance
type narrowing logic that leads to incorrect narrowed type when the filter type (the second argument) and the test type (the first argument) are both type variables. This addresses #7081 . ( #7194 )
2024-02-02 23:23:35 -08:00
Eric Traut
9e2136cb5a
Added code to deduplicate references returned by the textDocument/references LSP call. This addresses #7171 .
2024-02-02 23:02:28 -08:00
Eric Traut
9716d80fd1
Improved handling of unreachability analysis for an "implied else" (an if/elif chain that is missing a final "else" clause). This addresses #7189 . ( #7191 )
2024-02-02 16:54:17 -08:00
Eric Traut
7c060cb328
Another tweak to improve interruptions.
2024-02-02 12:58:09 -08:00
Eric Traut
e5f13bbad0
Fixed a bug that results in a false positive error when a TypeVar bound to a union of literals is used in the specialization of a TypeAlias whose TypeVar is bound to a wider union of literals. This addresses #7184 . ( #7187 )
2024-02-02 00:56:00 -08:00
Eric Traut
42d853f3d4
Fixed a bug that results in a false negative when a None
type is in… ( #7176 )
...
* Fixed a bug that results in a false negative when a `None` type is included in an unpacked argument within a function call. This addresses #7175 .
* Improved logic for unpacked arguments that contain an "Unbound" type.
2024-01-31 20:50:15 -08:00