Skip to content

Consider --preview flag for server subcommand#12208

Merged
dhruvmanila merged 1 commit intomainfrom
dhruv/server-preview
Jul 18, 2024
Merged

Consider --preview flag for server subcommand#12208
dhruvmanila merged 1 commit intomainfrom
dhruv/server-preview

Conversation

@dhruvmanila
Copy link
Copy Markdown
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
@github-actions
Copy link
Copy Markdown
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
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