Repository navigation
Use stdin for PythonTA document linting - #26
Merged
Merged
Conversation
Coverage Report for CI Build 37417097920Coverage decreased (-15.0%) to 62.402%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
david-yz-liu
reviewed
Oct 1, 2026
david-yz-liu
left a comment
Contributor
There was a problem hiding this comment.
Hi @PraneethS42, the changes look okay to me, but I don't think this is working properly. When I run this with the example in the README, here's what I see (after expanding the error):
This is not the expected error message, and seems to indicate that some junk characters are being sent to PythonTA.
Contributor
Author
|
That's interesting, I'll take a look at this shortly. When I was testing, I was running it on some other personal Python files as opposed to the README example. I'll make sure to test that first in the future. |
Contributor
Author
|
Could you take another look and see if it's working on your system as intended? |
david-yz-liu
approved these changes
Oct 8, 2026
david-yz-liu
left a comment
Contributor
There was a problem hiding this comment.
Works great, thanks @PraneethS42!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
This PR updates the language server to lint the contents supplied by VS Code through standard input instead of rereading the saved file from disk.
Using
document.sourceensures PythonTA analyzes the document content known to the language server. PythonTA 2.13.1 introduced the required--stdinsupport.Language server changes
bundled/tool/lsp_server.py_linting_helper--stdinto PythonTA instead of the document filenamestdin_*.pyURI. Since each stdin invocation analyzes one document, the server extracts diagnostics from that result and republishes them using the actual VS Code document URIbundled/tool/lsp_jsonrpc.py"") are forwarded when PythonTA runs through the alternate-interpreter JSON-RPC pathDependency changes
pyproject.tomlpython-ta==2.13.1release, which includes stdin supportuv.lockuv syncto lock PythonTA 2.13.1 and its package metadataTest changes
src/test/python_tests/test_server.pydocument.source: proves PythonTA reads from stdinsrc/test/python_tests/test_lsp_server_helpers.pysrc/test/python_tests/test_lsp_jsonrpc.pysrc/test/python_tests/test_notebook.pyScreenshots of your changes (if applicable)
Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]into a[x]in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)