forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed as not planned
Labels
area-terminalfeature-requestRequest for new features or functionalityRequest for new features or functionalityneeds proposalNeed to make some design decisionsNeed to make some design decisions
Description
https://code.visualstudio.com/updates/v1_49#_terminal-link-providers
Not only for jumping to specific positions from a traceback, but potentially to stdlib docs as appropriate (including to the right version based on the selected environment).
E.g.
Traceback (most recent call last):
File "/home/brettcannon/scratch/Some Python test space/whatever.py", line 4, in <module>
spam()
File "/home/brettcannon/scratch/Some Python test space/whatever.py", line 2, in spam
import blah
ModuleNotFoundError: No module named 'blah'could link to:
- Source lines
spamto thedeflineModuleNotFoundErrorto the exception's docs
Traceback (most recent call last):
File "/home/brettcannon/scratch/Some Python test space/whatever.py", line 3, in <module>
os.path.exists({})
File "/usr/lib/python3.8/genericpath.py", line 19, in exists
os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not dictchould probably link to:
- The file lines (only the second one to
/usr/lib/python3.8/genericpath.pydoes) existsto the docs foros.path.exists()(and this is probably one of the most complicated examples based on how it's exposed viagenericpaththroughos.path)- The docs for
os.path.exists()? - The docs for
os.stat()? TypeErrorcould link to the exception's docs
Problems to solve to open up as much linking as possible would include:
- Parsing a file to find out where e.g.
spamis defined to link to it (but which could be a step towards partial IntelliSense) - Resolving function names back to their docs (only useful when they are extension modules as otherwise the traceback should end up traversing into the source enough to get us what we are after)
- Mapping stdlib source back to their documentation (which would probably involve generating a static mapping of file paths and names to their docs; sphinx's index files which are publicly accessible for cross-referencing would help here)
- Bonus points for making this all work offline if someone has Python's docs cached locally
el-hult
Metadata
Metadata
Assignees
Labels
area-terminalfeature-requestRequest for new features or functionalityRequest for new features or functionalityneeds proposalNeed to make some design decisionsNeed to make some design decisions