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

Consider --preview flag for server subcommand #12208

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Conversation

dhruvmanila
Copy link
Member

@dhruvmanila dhruvmanila commented Jul 5, 2024

Summary

This PR removes the requirement of --preview flag to run the ruff server and instead considers it to be an indicator to turn on preview mode for the linter and the formatter.

resolves: #12161

Test Plan

Add test cases to assert the preview value is updated accordingly.

In an editor context, I used the local ruff executable in Neovim with the --preview flag and verified that the preview-only violations are being highlighted.

Running with:

require('lspconfig').ruff.setup({
  cmd = {
    '/Users/dhruv/work/astral/ruff/target/debug/ruff',
    'server',
    '--preview',
  },
})

The screenshot shows that E502 is highlighted with the below config in pyproject.toml:

Screenshot 2024-07-17 at 16 43 09

@dhruvmanila dhruvmanila added the server Related to the LSP server label Jul 5, 2024
Copy link
Contributor

github-actions bot commented Jul 5, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@dhruvmanila dhruvmanila force-pushed the dhruv/server-preview branch from 0ad5123 to 4fc10d9 Compare July 8, 2024 14:12
@dhruvmanila

This comment was marked as outdated.

@dhruvmanila dhruvmanila force-pushed the dhruv/server-preview branch 3 times, most recently from 8e5605b to 9863e4f Compare July 17, 2024 10:18
@dhruvmanila dhruvmanila marked this pull request as ready for review July 17, 2024 10:19
@dhruvmanila dhruvmanila requested a review from MichaReiser July 17, 2024 10:19
@dhruvmanila dhruvmanila force-pushed the dhruv/server-preview branch from 9863e4f to 24f9a75 Compare July 17, 2024 10:34
@dhruvmanila dhruvmanila force-pushed the dhruv/server-preview branch from 24f9a75 to 0f7a0d4 Compare July 17, 2024 10:39
@dhruvmanila dhruvmanila merged commit 2e77b77 into main Jul 18, 2024
20 checks passed
@dhruvmanila dhruvmanila deleted the dhruv/server-preview branch July 18, 2024 05:35
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 this pull request may close these issues.

Update preview logic for Ruff server
2 participants