-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add daemon command to get type of an expression (#13209)
Implementation is straightforward (I also tried to make it future-proof, so it is easy to add new inspections). Few things to point out: * I added a more flexible traverser class, that supports shared visit logic and allows for `O(log n)` search by early return. * I noticed a bunch of places where line/column/full name were not set. Did a quick pass and fixed as many as I can. * I also implement basic support for expression attributes and go to definition (there are few tricky corner cases left, but they can be addressed later). The current _default_ logic is optimized for speed, while it may give stale results (e.g if file was edited, but has full tree loaded in memory). My thinking here is that users typically want to get inspections really fast (like on mouse hover over an expression), so the editor integrations that would use this can call with default flag values, and only use `--force-reload` or a full `dmypy recheck` if they know some file(s) were edited. Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
- Loading branch information
1 parent
086e823
commit 4687cec
Showing
23 changed files
with
2,060 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.