Commit Graph

28 Commits

Author SHA1 Message Date
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
Rich Chiodo
e01b0fe205
Add test(s) that validate Pyright can talk over LSP (#7172)
* Everything building, but not running

* More tests passing

* Fix test to open a file

* Remove unused functions and consolidate others

* Remove unused custom lsp messages

* Add comments
2024-01-31 16:38:37 -08:00
Eric Traut
064f02e15e
Fixed a bug that led to incorrect type evaluation when a constrained TypeVar includes literal types as constraints. This addresses #6917. (#6929) 2024-01-06 15:19:03 -07:00
Rich Chiodo
a5b352d929
Change all file paths to use a new URI class. (#6519)
* Preliminary idea

* First commit

* Refactor all uri based path functions to uriUtils

* Most of real code building

* More tests working

* More progress on the tests

* Rest of typecheck errors

* Move URIs even further to prevent accidental issues

* More tests

* Relative path fixes

* More test fixes and changes to 'startsWith'

* Uri tests all passing

* remove uri tests from path utils tests

* Fix relative paths for partial stub remapping

* Make isEmpty look empty and fix empty check for resolved paths

* Fix module name retrieval issue

* Use map instead of set for URI list

* Another path is empty fix.

* Fix importresolver finding source files for stubs

* Fixup actual defs to match expected format

* Relative path differences again

* Fix some comparisons

* More comparison fixes

* Config of ('.') was using current directory to find module names

* Shortcut empty URI for existence

* Add back ignoring case

* Fix regex matching

* All tests passing

* Fix build after merge

* Fix failing tests

* Fix rootDirectory and python path from interpreter

* Some perf improvements

* Don't bother reparsing in file system

* More tests and some logging output

* Extra data for analyzing slowness

* Fix build problems

* Refactor to not use vscode.URI except for initial parse

* Try without vscode uri validation

* Rework to new perf idea

* Split out class and interface

* All uri tests passing

* Fix other tests

* Cache results for faster perf

* Add memoization decorator

* combinePath remove one layer and make key gen faster

* Move caches local

* Generalize the memoization and optimize zero arg funcs

* Cache more stuff

* slight speedup for cache saving

* slight improvement by just returning the cached item

* Small optimization to skip loop if possible

* Further speedup for similar calls of combinePath

* Make it possible to switch between profiled and not

* Another small optimization

* Cache files in directory

* Small opt for isNativeModuleFileName

* Speed up getting pytyped info

* Fix command line parsing to expand ~
Slight perf improvement for exists cached by not splitting

* Split out instrumenting memoization

* Remove instrumented memoizationin

* Fix comment

* Fix build on ubuntu/mac

* Fix windows specific problems with tests
Fix auto import to work with windows file paths

* Fix command line output

* Try fixing CI path for failing test

* fix output paths in other spots

* More file output locations

* Output more data for failing test

* Put validation back and fix test

* Fix import cycles message to not show URI path

* Remove printing of config options

* More review feedback

* Missed a spot in the review feedback

* Fix build error

* Update packages/pyright-internal/src/analyzer/importResolver.ts

Co-authored-by: Erik De Bonte <erikd@microsoft.com>

* Update packages/pyright-internal/src/analyzer/analyzerFileInfo.ts

Co-authored-by: Erik De Bonte <erikd@microsoft.com>

* Update packages/pyright-internal/src/analyzer/backgroundAnalysisProgram.ts

Co-authored-by: Erik De Bonte <erikd@microsoft.com>

* Review feedback from Erik

* Revert changes to launch.json

* Fixup config options to use same roots as before

* Fix casing for cwd test on windows

* Fix spack differences

* Add back in the instrumentation until figure import resolve cache

* Fixup after merge

* Fix another equals comparison

* Merge error

* Fix after merge

* Fixup after merge

* Keep track of case sensitivity in the URIs

* Fix test failures on windows/mac

* Switch to the faster version

* Remove memoization

* Review feedback for some renames

* Review feedback

* Feedback from Erik, put back memoization for simple stuff

* fix prettier

* Fix typo and cache URI creations

* Add a comment

* Review feedback from Eric

* Fix crash in config options

* Missed a piece of feedback

---------

Co-authored-by: Erik De Bonte <erikd@microsoft.com>
2023-12-07 09:15:39 -08:00
Heejae Chang
73165c50c2
Push pylance changes to pyright (#5248)
* Push pylance changes to pyright

* Update packages/pyright-internal/src/backgroundThreadBase.ts

Co-authored-by: Erik De Bonte <erikd@microsoft.com>

---------

Co-authored-by: Erik De Bonte <erikd@microsoft.com>
2023-06-07 15:03:40 -07:00
Eric Traut
c059711256 Added "auto fix imports" to settings.json. 2023-04-18 20:35:27 -07:00
Rich Chiodo
8c0ba8a78a
Show a warning when a stdlib module is being overridden (#4132)
* Working for simple cases

* Fix localize

* Move logic to source mapper

* Add support for the current file

* Add rename file command

* Fix comments

* Closer to getting tests to work. Rename added

* Rework how stdlib modules are found. Fix tests

* Do the rename without bringing up a dialog

* Fix tests and add docs

* Fix tests on unix

* Review feedback

* Default shadowed imports to off

* Missed spot for execEnv not needing to be passed
2022-11-04 16:45:16 -07:00
Eric Traut
88abe7ae96 Removed obsolete options from launch.json file. 2022-06-09 17:48:02 -07:00
PylanceBot
bbc4282691
pull-pylance-with-pyright-1.1.253 (#3556)
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>
2022-06-08 10:16:10 -07:00
Jake Bailey
915207671a
Fix more unresolvable import completions, module refactoring updates, remove getDeclaredTypeForExpression (#2369)
Co-authored-by: HeeJae Chang <hechang@microsoft.com>
2021-10-04 11:25:25 -07:00
Jake Bailey
d2771b18a8
Sync from Pylance (#2329)
Co-authored-by: Bill Schnurr <bschnurr@microsoft.com>
Co-authored-by: HeeJae Chang <hechang@microsoft.com>
2021-09-22 14:26:36 -07:00
Eric Traut
6fdf8ea272 Fixed a crash in the "--verifytypes" feature of the CLI. 2021-01-22 16:35:12 -08:00
Jake Bailey
91a5f8d515
Update deps (TS 4.1, others), switch to LSP-native progress reporting (#1277) 2020-12-14 15:13:10 -08:00
Eric Traut
8cfb43138f Removed unused launch configuration. 2020-11-24 09:11:35 -08:00
Eric Traut
b51b131351 Fixed launch.json for launching the CLI. 2020-09-27 22:20:03 -07:00
Jake Bailey
da39a2a78a
Convert repo into a lerna monorepo, add a validation workflow (#978) 2020-08-28 19:46:48 -07:00
Jake Bailey
02bdbdee07 Revert markdown changes, restore .vscode for server (#115) 2020-02-25 12:57:54 -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
Jake Bailey
8d2cca7289 Mass reformat ts/js/md with ESLint quick fixes and prettier (#113) 2020-02-24 16:52:23 -08:00
Eric Traut
5a7903133a Optimized production build of server, reducing the startup time and overall size of the VS Code extension significantly. 2019-10-05 22:42:25 -07:00
Eric Traut
21320b0288 Replaced --timing command-line switch with --stats, which prints out more information. 2019-04-14 17:44:44 -07:00
Eric Traut
692ec961f2 Improved console messages for command-line. 2019-04-06 14:09:18 -07:00
Eric Traut
3ddfe52302 Fixed (and documented) exit codes for command-line app.
Added --timing flag to conditionally report detailed timing stats.
2019-04-04 22:35:53 -07:00
Eric Traut
01204a1db2 Fixed debugging of command-line tool. 2019-03-26 23:53:50 -07:00
Eric Traut
9df1398320 Fixed regression in launch script. 2019-03-25 01:53:56 -07:00
Eric Traut
816c4131e3 Added new build:clientServer script to speed up inner loop of debugging. 2019-03-24 18:05:31 -07:00
Eric Traut
8afce050bd Fixed unit tests. 2019-03-24 00:01:35 -07:00
Eric Traut
a4fb40d565 Added .vscode/launch.json file. 2019-03-11 22:02:14 -07:00