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
spam to the def line
ModuleNotFoundError to 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 dict
chould probably link to:
- The file lines (only the second one to
/usr/lib/python3.8/genericpath.py does)
exists to the docs for os.path.exists() (and this is probably one of the most complicated examples based on how it's exposed via genericpath through os.path)
- The docs for
os.path.exists()?
- The docs for
os.stat()?
TypeError could 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.
spam is 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
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.
could link to:
spamto thedeflineModuleNotFoundErrorto the exception's docschould probably link 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)os.path.exists()?os.stat()?TypeErrorcould link to the exception's docsProblems to solve to open up as much linking as possible would include:
spamis defined to link to it (but which could be a step towards partial IntelliSense)