Merged
Conversation
rchiodo
approved these changes
Oct 8, 2025
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: sympy (https://github.com/sympy/sympy)
+ .../projects/sympy/sympy/solvers/bivariate.py:134:15 - error: Operator "-" not supported for "None" (reportOptionalOperand)
+ .../projects/sympy/sympy/solvers/bivariate.py:138:17 - error: Operator "-" not supported for type "Basic | Any | Unknown" (reportOperatorIssue)
+ .../projects/sympy/sympy/solvers/bivariate.py:143:23 - error: Operator "-" not supported for "None" (reportOptionalOperand)
+ .../projects/sympy/sympy/solvers/deutils.py:233:14 - error: Operator "not in" not supported for types "str" and "Unknown | int"
+ Operator "not in" not supported for types "str" and "int" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:420:38 - error: Argument of type "int | Any | Unknown | Expr" cannot be assigned to parameter "expr" of type "Expr" in function "make_args"
+ .../projects/sympy/sympy/solvers/diophantine/diophantine.py:420:38 - error: Argument of type "Unknown | Expr | Literal[0]" cannot be assigned to parameter "expr" of type "Expr" in function "make_args"
- Type "int | Any | Unknown | Expr" is not assignable to type "Expr"
+ Type "Unknown | Expr | Literal[0]" is not assignable to type "Expr"
- "int" is not assignable to "Expr" (reportArgumentType)
+ "Literal[0]" is not assignable to "Expr" (reportArgumentType)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:499:19 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:500:19 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:501:19 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:564:42 - error: Operator "*" not supported for types "int" and "Unknown | Basic"
- Operator "*" not supported for types "int" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:564:50 - error: Operator "*" not supported for types "Expr" and "Unknown | Basic"
- Operator "*" not supported for types "Expr" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:720:42 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:730:19 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:731:19 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:732:19 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:809:47 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:836:26 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:837:22 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:838:36 - error: Operator "*" not supported for types "int | Any | Unknown" and "Unknown | Basic"
- Operator "*" not supported for types "int" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:838:42 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:838:51 - error: Operator "*" not supported for types "int | Any | Unknown" and "Unknown | Basic"
- Operator "*" not supported for types "int" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:838:57 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:838:66 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:840:53 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:849:18 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:851:22 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:860:22 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:860:36 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:862:27 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:863:27 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:864:27 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:865:27 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:866:27 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:867:27 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:871:24 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:872:24 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:873:24 - error: Operator "**" not supported for types "Unknown | Basic" and "Literal[2]"
- Operator "**" not supported for types "Basic" and "Literal[2]" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:874:24 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:875:24 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:876:24 - error: Operator "*" not supported for types "Unknown | Basic" and "Unknown | Basic"
- Operator "*" not supported for types "Basic" and "Basic" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:883:37 - error: Operator "*" not supported for types "int | Any | Unknown" and "Unknown | None"
- Operator "*" not supported for types "int" and "None" (reportOperatorIssue)
- .../projects/sympy/sympy/solvers/diophantine/diophantine.py:883:45 - error: Operator "*" not supported for types "int | Any | Unknown" and "Unknown | None"
... (truncated 412 lines) ...
|
maxwell-k
added a commit
to maxwell-k/ale
that referenced
this pull request
Jan 10, 2026
pyright>=1.1.407 needs textDocument/diagnostic requests. pyright changed in <microsoft/pyright#11010>. Both VS Code and pyright come from Microsoft. > VS code asks for workspace diagnostics and then expects the server to > continually provide progress as things change. Without the workaround below, ALE does not (1) ask pyright for diagnostics or (2) receive any diagnostics from pyright. Debugging the behaviour I can see that: 1. pyright does not send capability responses including diagnosticProvider. 2. ALE does not set the pull_model capability without diagnosticProvider in the response from pyright. 3. Without the pull_model capability ale#lsp#message#Diagnostic is not called and no textDocument/diagnostic message is sent. 4. Without a textDocument/diagnostic message, pyright==1.1.407 does not provide any diagnostics. pack/submodules/start/ale/autoload/ale/lsp.vim:280 pack/submodules/start/ale/autoload/ale/lsp_linter.vim:572 Put another way: > it never sends any textDocument/diagnostic requests so pyright never > responds with any diagnostics. —<zed-industries/zed#40980 (comment)>
maxwell-k
added a commit
to maxwell-k/ale
that referenced
this pull request
Jan 10, 2026
pyright>=1.1.407 needs textDocument/diagnostic requests. pyright changed in <microsoft/pyright#11010>. Both VS Code and pyright come from Microsoft. > VS code asks for workspace diagnostics and then expects the server to > continually provide progress as things change. Without the workaround below, ALE does not (1) ask pyright for diagnostics or (2) receive any diagnostics from pyright. Debugging the behaviour I can see that: 1. pyright does not send capability responses including diagnosticProvider. 2. ALE does not set the pull_model capability without diagnosticProvider in the response from pyright. 3. Without the pull_model capability ale#lsp#message#Diagnostic is not called and no textDocument/diagnostic message is sent. 4. Without a textDocument/diagnostic message, pyright==1.1.407 does not provide any diagnostics. pack/submodules/start/ale/autoload/ale/lsp.vim:280 pack/submodules/start/ale/autoload/ale/lsp_linter.vim:572 Put another way: > it never sends any textDocument/diagnostic requests so pyright never > responds with any diagnostics. —<zed-industries/zed#40980 (comment)>
maxwell-k
added a commit
to maxwell-k/ale
that referenced
this pull request
Feb 5, 2026
pyright>=1.1.407 needs textDocument/diagnostic requests. pyright changed in <microsoft/pyright#11010>. Both VS Code and pyright come from Microsoft. > VS code asks for workspace diagnostics and then expects the server to > continually provide progress as things change. Without the workaround below, ALE does not (1) ask pyright for diagnostics or (2) receive any diagnostics from pyright. Debugging the behaviour I can see that: 1. pyright does not send capability responses including diagnosticProvider. 2. ALE does not set the pull_model capability without diagnosticProvider in the response from pyright. 3. Without the pull_model capability ale#lsp#message#Diagnostic is not called and no textDocument/diagnostic message is sent. 4. Without a textDocument/diagnostic message, pyright==1.1.407 does not provide any diagnostics. pack/submodules/start/ale/autoload/ale/lsp.vim:280 pack/submodules/start/ale/autoload/ale/lsp_linter.vim:572 Put another way: > it never sends any textDocument/diagnostic requests so pyright never > responds with any diagnostics. —<zed-industries/zed#40980 (comment)>
maxwell-k
added a commit
to maxwell-k/ale
that referenced
this pull request
Mar 4, 2026
pyright>=1.1.407 needs textDocument/diagnostic requests. pyright changed in <microsoft/pyright#11010>. Both VS Code and pyright come from Microsoft. > VS code asks for workspace diagnostics and then expects the server to > continually provide progress as things change. Without the workaround below, ALE does not (1) ask pyright for diagnostics or (2) receive any diagnostics from pyright. Debugging the behaviour I can see that: 1. pyright does not send capability responses including diagnosticProvider. 2. ALE does not set the pull_model capability without diagnosticProvider in the response from pyright. 3. Without the pull_model capability ale#lsp#message#Diagnostic is not called and no textDocument/diagnostic message is sent. 4. Without a textDocument/diagnostic message, pyright==1.1.407 does not provide any diagnostics. pack/submodules/start/ale/autoload/ale/lsp.vim:280 pack/submodules/start/ale/autoload/ale/lsp_linter.vim:572 Put another way: > it never sends any textDocument/diagnostic requests so pyright never > responds with any diagnostics. —<zed-industries/zed#40980 (comment)>
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.
The majority of these changes are around handling workspace pull diagnostics, which didn't work the way we originally thought.
VS code asks for workspace diagnostics and then expects the server to continually provide progress as things change.
This PR is changing Pyright to do that and to register dynamically for pull diagnostics based on the value 'diagnosticMode'.