Commit Graph

1687 Commits

Author SHA1 Message Date
Heejae Chang
81bfc73697
added completion test coverage (#579) 2020-03-24 11:11:33 -07:00
Eric Traut
17d7df157d Published 1.1.29 2020-03-23 21:52:20 -07:00
Eric Traut
2cb40ade2c Replaced type cache mechanism with one that's more robust.
Fixed bug in TypeVar matching logic for functions when a later parameter's generic type influenced the type of an earlier parameter. This situation requires multiple passes to resolve all type variables properly.
2020-03-23 21:25:40 -07:00
Eric Traut
6acfd77200 Added cancellation support to the type evaluator using the same technique as in the TypeScript compliler. Updated the program module to properly handle cancellation during invocation of the type evaluator. Removed cancellation from parse and bind calls; these are very fast, and it's not worth adding the complexity of cancellation to them. 2020-03-22 14:56:32 -07:00
Eric Traut
2ba0f63cf1 Added additional diagnostic context for type var assignments so it's clear whether the type var is invariant, covariant, or contravariant. 2020-03-22 10:32:33 -07:00
Eric Traut
6b2a5941ea Fixed recent regression that caused a crash when using the "find references" or "rename symbol" features. 2020-03-21 21:17:45 -07:00
Eric Traut
7ae0d93829 Fixed a few more bugs found with manual testing and code review. 2020-03-21 00:02:51 -06:00
Eric Traut
911e42c91c Fixed a few bugs in logic that determines whether to report diagnostics for a given source file. Diagnostics were previously suppressed for type stubs found in the "typings" directory but should not have been. Diagnostics were also suppressed for local source files that are imported by included files. And diagnostics were not properly added or cleared when a file was opened and the "openFilesOnly" setting was in effect. 2020-03-20 23:30:28 -06:00
Eric Traut
589ba8f7a1 Fixed several bugs in the logic that handles type matching of functions. It wasn't properly taking into account name-only and position-only markers in parameter lists. 2020-03-20 22:28:20 -06:00
Heejae Chang
4b194b0431
added auto venv detection, LS extension points, auto detection on library changes and more tests added. (#574)
auto venv detection makes sure pyright automatically exlude virtual environment from user codes
LS extension points lets plug in such as intellicode to extend what shows up in completion list
auto detection on library let pyright to refresh automatically when new packages are installed/removed.

more test coverage on code fix, new features and etc
2020-03-20 12:17:25 -07:00
Eric Traut
8faf8e2da2 Fixed name of function in analyzerServiceExecutor to match coding style. 2020-03-20 12:44:48 -06:00
Eric Traut
0501d89ee3 Updated dependencies to work around reported vulnerability. 2020-03-20 10:06:08 -06:00
Eric Traut
0993fe7a4c Hid type arguments and type parameters when printing types related to pseudo-generic classes. Since these type parameters are internally synthesized, they are confusing for users to see. 2020-03-20 10:00:20 -06:00
Eric Traut
5e1e2c759a Published 1.1.28 2020-03-17 22:41:55 -06:00
Eric Traut
d29087520b When a class contains an __init__ method whose input parameters are not annotated, generate a "pseudo-generic" class parameterized by the types of the init method's input parameters. This allows call-site specialization of the class, which provides better type checking and type completion suggestions. 2020-03-17 18:06:59 -06:00
Eric Traut
5f719d49e6 Added support for the multi-parameter form of the built-in "type" call. 2020-03-17 14:24:42 -06:00
Eric Traut
0ab9caf39a Fixed bug in parser where a single-element tuple atom used as a subscript index was handled incorrectly. 2020-03-17 13:01:16 -06:00
Heejae Chang
1bc8b1ba63
added initial support for cancellation and added more test coverages on common and tokenizers. (#566) 2020-03-16 09:29:18 -07:00
Eric Traut
acac40b339 Handle the case where a function parameter with a type annotation that includes a generic (TypeVar) is assigned its value via a default argument rather than an explicit argument by the caller. The TypeVar should be matched using the default argument in this case. 2020-03-15 10:52:51 -06:00
Eric Traut
58f2ba3b4e Updated all dependencies to latest versions. 2020-03-15 09:15:53 -06:00
Eric Traut
3e6ad93a89
Merge pull request #564 from microsoft/dependabot/npm_and_yarn/acorn-7.1.1
Bump acorn from 7.1.0 to 7.1.1
2020-03-14 21:19:31 -07:00
dependabot[bot]
77629c4000
Bump acorn from 7.1.0 to 7.1.1
Bumps [acorn](https://github.com/acornjs/acorn) from 7.1.0 to 7.1.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/7.1.0...7.1.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-14 18:55:39 +00:00
Eric Traut
c12b64cdaf Published 1.1.27 2020-03-11 19:59:18 -07:00
Eric Traut
b870963dde Fixed bug where a symbol declared within a class scope is used before it is assigned but a symbol with the same name exists in the containing scope. In this case, the symbol should not be flagged as "unbound". 2020-03-11 18:09:19 -07:00
Eric Traut
fb1d0667bb Fixed misspelling in comment. 2020-03-11 15:25:56 -07:00
Eric Traut
d433fd6d28 Added support for TypedDict classes that use other TypedDict classes in a nested manner. 2020-03-11 15:25:43 -07:00
Eric Traut
5f17e83254 Improved performance of "find symbol" and "rename symbol" operations for symbols that are local and not visible outside of the current source file. 2020-03-09 21:32:13 -07:00
Eric Traut
ca694d9d00
Merge pull request #559 from microsoft/erictr/restart_server
Implemented "Restart Server" command.
2020-03-09 15:09:20 -07:00
Eric Traut
93804d3c07 Implemented "Restart Server" command. 2020-03-08 12:17:19 -07:00
Eric Traut
d8584313ac Fixed bug in type narrowing logic for isinstance and in the logic for detecting unnecessary isinstance and issubclass calls. In both cases, they were not properly handling the case where a class derived from an unknown class. 2020-03-08 11:46:16 -07:00
Eric Traut
60c0f02b5d Published 1.1.26 2020-03-08 00:01:01 -08:00
Eric Traut
ac0960b252 Implemented true MRO for method resolution. 2020-03-07 23:54:58 -08:00
Eric Traut
e25817b014 Make use of MRO for data class entries and completions. 2020-03-07 18:03:02 -08:00
Eric Traut
5240656d6d Removed redundant function getSymbolFromBaseClasses in typeUtils because the same functionality is already exposed via the function lookUpClassMember.
Made consistent use of isProtocolClass flag rather than iterating over all base classes each time to look for 'Protocol'.
2020-03-07 17:34:53 -08:00
Heejae Chang
3fcc152a3d
added code coverage on CI. (#557) 2020-03-06 15:48:43 -08:00
Heejae Chang
b69a8df48d
refactored on analysis completed handler (#553)
this should let derived class to override behavior on analysis complete
2020-03-03 13:12:01 -08:00
Heejae Chang
d4c0c0cdd4
made LS to automatically add "src" as one of extra path to find imports. (#552)
it is common pratice where user start vscode on repo root but sources are under src. this change introduces a new option called "autoSearchPaths" (on by default) that will let LS to detect such case and add "src" as extra path to search packages.

this PR also includes misc fix on test framework where all file path is normalized to absolute path, let verify diagnostics to handle empty error case and etc.
2020-03-03 11:38:37 -08:00
Eric Traut
090fc5ab70 Started to add support for true MRO. The MRO is calculated for each class, and errors are reported, but the MRO is not yet used for method lookup. That will be part of the next phase. 2020-03-02 07:37:51 -08:00
Eric Traut
39788f5032 Removed unnecessary parameter from several typeUtils functions. 2020-03-02 07:31:31 -08:00
Eric Traut
909f3e6408 Added "verboseOutput" config setting, allowing verbose logs to be enabled when used with VS Code extension. 2020-03-01 16:37:05 -08:00
Eric Traut
4db6a27358 Added support for overloaded functions that are async. 2020-03-01 16:15:27 -08:00
Heejae Chang
41497e7e43
added test for hover doc string (#550) 2020-02-28 12:10:17 -08:00
Heejae Chang
3f5738399d
Merge pull request #546 from heejaechang/pyrightChanges
improved doc string and more style changes
2020-02-26 21:29:33 -08:00
HeeJae Chang
b59e05b9ac removed unnecessary escape on regex 2020-02-25 21:04:38 -08:00
Eric Traut
003ee1bd2e Fixed bug in "organize imports" command where it was not properly handling wildcard imports. 2020-02-25 16:12:43 -07:00
Eric Traut
6aab4412a3 Added detection of inconsistent use of spaces and tabs that leads to ambiguity in indentation. 2020-02-25 16:03:48 -07:00
Jake Bailey
02bdbdee07 Revert markdown changes, restore .vscode for server (#115) 2020-02-25 12:57:54 -08:00
Hugues Valois
46cdcd0ee9 Docstring to markdown (#107)
Add docstring converter.
2020-02-25 10:03:43 -08:00
Jake Bailey
01e45c7a31
Merge pull request #543 from heejaechang/formatting
use prettier for formatting and put all launch setting on repo root
2020-02-24 17:49:10 -08:00
Heejae Chang
6c1238aee2 added lanuch setting to run tests from repo root (#114)
* allow tests to be run from repo root

* remove comments

* reformated using json default formatter

* delete ones in server folder. no longer needed. from now on, open vscode from root folder to run tests
2020-02-24 17:34:42 -08:00