Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ruff server] LSP treats pyi/stub files as regular python files instead of stub files. ruff-lsp does the right thing. #11534

Closed
akshetpandey opened this issue May 24, 2024 · 1 comment · Fixed by #11535
Assignees
Labels
server Related to the LSP server

Comments

@akshetpandey
Copy link
Contributor

akshetpandey commented May 24, 2024

version: 0.4.5

Tried the new ruff-server, noticed that it was giving me lint warning about pyi files that were not reported by ruff check.

Going back to ruff-lsp fixed it.

@charliermarsh charliermarsh added the server Related to the LSP server label May 24, 2024
@charliermarsh
Copy link
Member

Thanks, will take a look.

@snowsignal snowsignal self-assigned this May 24, 2024
charliermarsh pushed a commit that referenced this issue May 26, 2024
## Summary

Fixes #11534.

`DocumentQuery::source_type` now returns `PySourceType::Stub` when the
document is a `.pyi` file.

## Test Plan

I confirmed that stub-specific rule violations appeared with a build
from this PR (they were not visible from a `main` build).

<img width="1066" alt="Screenshot 2024-05-24 at 2 15 38 PM"
src="https://github.com/astral-sh/ruff/assets/19577865/cd519b7e-21e4-41c8-bc30-43eb6d4d438e">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
server Related to the LSP server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants