Commit Graph

5849 Commits

Author SHA1 Message Date
Eric Traut
2c4a9da2ae More tweaks to documentation and README files. Added a navbar to docs site. 2023-03-06 17:52:06 -07:00
Eric Traut
65874c5254 Small tweak for main docs page. 2023-03-06 17:45:37 -07:00
Eric Traut
deabba5e6a Tweaked documentation theming and added language highlighting for json. 2023-03-06 17:44:15 -07:00
Eric Traut
2827c94d89 Small correction to settings documentation. 2023-03-06 16:10:06 -07:00
Eric Traut
dc87fa46af Added a missing HTML tag to index.html. 2023-03-06 16:03:19 -07:00
Eric Traut
f7be9cc5cc A few more README tweaks. 2023-03-06 16:03:07 -07:00
Eric Traut
6cb2f4a058 Moved installation instructions and FAQ to their own docs pages, further simplifying the main README. 2023-03-06 15:58:44 -07:00
Eric Traut
b61f121efe Minor tweak to README. 2023-03-06 15:51:49 -07:00
Eric Traut
fe4eec0a7e Added link to new documentation on main README. 2023-03-06 15:50:28 -07:00
Eric Traut
4c4aec52a5 Added support for docsify-based docs site. 2023-03-06 15:46:07 -07:00
Eric Traut
b3fd962116 Fixed bugs in documentation. 2023-03-06 15:45:51 -07:00
Eric Traut
09161fdca4 Added an error message for Concatenate if a TypeVarTuple is used in the concatenated list of types. This addresses https://github.com/microsoft/pylance-release/issues/4046. 2023-03-06 13:03:22 -07:00
Eric Traut
f8edba07e5 Fixed regression in --verifytypes where variables assigned from calls to TypeVar, ParamSpec, TypeVarTuple, NewType, TypedDict, and NamedTuple were marked as ambiguous. This addresses https://github.com/microsoft/pyright/issues/4600. 2023-03-06 12:34:09 -07:00
Eric Traut
6f07019c89 Switched from a map to a set in type verifier. No functional change. 2023-03-06 12:24:05 -07:00
Eric Traut
5180be804b Fixed bug that resulted in the incorrect type evaluation for a function or method that returns Union[*Ts] where Ts is a TypeVarTuple bound to *tuple[()]. This addresses https://github.com/microsoft/pyright/issues/4739. 2023-03-06 11:03:25 -07:00
Eric Traut
735c19a1c9 Improved documentation for ... function bodies. 2023-03-06 10:49:54 -07:00
Eric Traut
7197a8d624 Added documentation for import statements. 2023-03-06 08:49:00 -07:00
Eric Traut
bafc4d09a3 Added common routine for determining whether a type is a metaclass instance. 2023-03-06 07:41:36 -07:00
Eric Traut
f82de84bdf Changed reportSelfClsParameterName check to accept mcs and mcls for first parameter in an instance method within a metaclass (i.e. a subclass of type). This addresses https://github.com/microsoft/pyright/issues/4736. 2023-03-05 23:15:01 -07:00
Eric Traut
315031a47b Fixed a bug that led to a false positive error when using a subclass of type as a base class in a class declaration. This addresses https://github.com/microsoft/pyright/issues/4737. 2023-03-05 23:10:19 -07:00
Eric Traut
dbe9e3ab88 Fixed misspelling in variable name. 2023-03-05 11:51:12 -07:00
Eric Traut
6910128279 Changed import modeling behavior for import statements with multi-part module names. The statement import a.b.c now implies import a; import a.b; import a.b.c. This addresses https://github.com/microsoft/pyright/issues/4732. 2023-03-05 11:40:48 -07:00
Eric Traut
9281721960 Fixed bug that resulted in incorrect type evaluation of arguments to functools.partial call along with false positive errors. The problem is that the special-case logic for functools.partial was not applying bidirectional type inference when evaluating the arg type. This addresses https://github.com/microsoft/pylance-release/issues/4044. 2023-03-05 08:08:46 -07:00
Eric Traut
58db719c67 Fixed performance issue that affected long if/elif chains. This addresses https://github.com/microsoft/pyright/issues/4728. 2023-03-05 00:44:50 -07:00
Eric Traut
a36c24c39f Fixed recent regression that caused incorrect behavior when Required and NotRequired when nested within an Annotated. 2023-03-04 00:43:35 -07:00
Eric Traut
364cb03065 Fixed a bug that resulted in an incorrect reporting of "unreachable code" after a call to a generator function that contains an unreachable yield statement. This addresses https://github.com/microsoft/pylance-release/issues/4041. 2023-03-03 23:56:46 -07:00
Eric Traut
0a206e8841 Removed the need for the binder to understand typing.Required and typing.NotRequired special forms. This allows these forms to be imported, re-exported, and aliased. 2023-03-03 13:19:18 -07:00
Eric Traut
05371729ae Removed some unused fields. 2023-03-03 08:01:03 -07:00
Eric Traut
f8ce7ca1fd Made JSON parsing stricter for the pyrightconfig.json file. Previously, a JSON syntax error was not detected or reported. This addresses https://github.com/microsoft/pyright/issues/4722. 2023-03-03 00:52:06 -07:00
Eric Traut
3035662636 If no files are found and no errors are detected but the --outputjson command-line option is used, a json report should still be issued. This addresses https://github.com/microsoft/pyright/issues/4723. 2023-03-03 00:24:06 -07:00
Eric Traut
659fdfab75 Improved handling of typing.TypeAlias so it can be aliased and re-exported from other files. This addresses https://github.com/microsoft/pyright/issues/4197. 2023-03-03 00:08:32 -07:00
Eric Traut
edfe2aa268 Improved error handling for dictionary expressions that use bidirectional type inference when the key type doesn't match the expected type. 2023-03-03 00:07:47 -07:00
Eric Traut
963d80b192 Fixed misspelled function name in completion provider. No functional change. 2023-03-02 14:25:56 -07:00
Eric Traut
7035c8361f Made first steps toward moving Final and TypeAlias processing out of the binder. This is in support of https://github.com/microsoft/pyright/issues/4197. 2023-03-02 13:21:08 -07:00
Eric Traut
81f21ee3d4 Added support for type guard patterns type(x) == T and type(x) != T. This addresses https://github.com/microsoft/pyright/issues/4719. 2023-03-01 23:29:44 -07:00
Grace Petryk
ac3487e03f
Fix indented code blocks in docstrings (#4717)
* fix indented code blocks in docstrings

* require same indent level for closing tag

* nit: comments

* review: added test

* use tripleTick constant instead of escaping

* chore: prettier

---------

Co-authored-by: Eric Traut <eric@traut.com>
2023-03-01 23:29:14 -07:00
PylanceBot
93a4ef878d
[PylanceBot] Pull Pylance with Pyright 1.1.296 (#4716)
Co-authored-by: Bill Schnurr <bschnurr@microsoft.com>
Co-authored-by: HeeJae Chang <hechang@microsoft.com>
Co-authored-by: Erik De Bonte <erikd@microsoft.com>
Co-authored-by: Rich Chiodo <rchiodo@microsoft.com>
2023-03-01 15:51:08 -08:00
Eric Traut
124334db92 Fixed a bug that caused the variance for type parameters to be incorrectly inferred when an auto-variance class derived from a non-auto-variance class. This addresses https://github.com/microsoft/pyright/issues/4713. 2023-03-01 15:27:08 -07:00
Eric Traut
3c72a3733e Performance optimization: reduced formatting of error messages in cases where it can be determined that they are not needed (e.g. in speculative evaluation code paths). 2023-03-01 14:40:01 -07:00
Michael Davis
7ef5bf86f0
Declare workspaceFolders support in server capabilities (#4666)
* Declare workspaceFolders support in server capabilities

The `vscode-languageserver-node` dependency will attempt dynamic
capability registration for workspace folder change notifications
if this `workspace.workspaceFolders.changeNotifications` is not set
in the `InitializeResult`. That is problematic for clients that don't
support dynamic capability registration: if we send a JSONRPC error,
the server will exit because of the rejected promise.

The server has support for workspace folders and requests and uses
change notifications as far as I can see, so I believe it's more
correct to declare support for these up-front anyways.

* Fix formatting

---------

Co-authored-by: Heejae Chang <1333179+heejaechang@users.noreply.github.com>
Co-authored-by: Eric Traut <eric@traut.com>
2023-03-01 14:18:45 -07:00
Eric Traut
02b4c17b24 Added logic to detect when a type alias is used in a generic class declaration's base class list and a type parameter used with the type alias is incompatible with the variance required for the type alias. This addresses https://github.com/microsoft/pyright/issues/4699. 2023-03-01 11:47:53 -07:00
Eric Traut
569b5dc730 Fixed a bug that resulted in a false negative when defining a generic class that derives from another generic class and the type parameter isn't compatible with the variance of the base class. 2023-03-01 11:46:17 -07:00
Eric Traut
2ce319c001 Implemented missing check for generic type alias specialization when too few type arguments are provided. This addresses https://github.com/microsoft/pyright/issues/4709. 2023-03-01 10:13:02 -07:00
Eric Traut
e2f8a7376f Fixed a recent regression that resulted in an incorrect type evaluation when using a __new__ method whose return type annotation is Self. This addresses https://github.com/microsoft/pyright/issues/4705. 2023-03-01 01:49:49 -07:00
Eric Traut
bea60409c1 Fixed a bug that led to a false positive error when using the | operator with two dicts whose keys or values are defined as literals. This addresses part of https://github.com/microsoft/pyright/issues/4707. 2023-03-01 01:30:50 -07:00
Eric Traut
c458d16aea Added support for bidirectional type inference for dictionary expressions with dictionary expansion entries. This partially addresses https://github.com/microsoft/pyright/issues/4707. 2023-02-28 23:05:40 -07:00
Eric Traut
55c917ab32 Extended logic that searches for site-packages directory within a venv to handle the case where multiple /lib/python3.X/site-packages are present. The new logic prefers the configured Python version rather than picking the first one returned by the file system. This addresses https://github.com/microsoft/pyright/issues/4708. 2023-02-28 22:33:36 -07:00
Eric Traut
8c79c1bb5a Published 1.1.296 2023-02-28 01:03:52 -07:00
Eric Traut
85c043dc32 Improved performance by not inferring return type of overloaded implementation when binding an overloaded method to an object. 2023-02-28 00:19:24 -07:00
ErezAmihud
2857963212
add gitlab ci documentation (#4704) 2023-02-27 13:57:05 -07:00