Skip to content

Consider unsafe-fixes settings for code actions - #15666

Merged
dhruvmanila merged 1 commit into
mainfrom
dhruv/server-unsafe-fixes
Jan 22, 2025
Merged

Consider unsafe-fixes settings for code actions#15666
dhruvmanila merged 1 commit into
mainfrom
dhruv/server-unsafe-fixes

Conversation

@dhruvmanila

Copy link
Copy Markdown
Member

Summary

Closes: #13960

Test Plan

Using the example from astral-sh/ruff-vscode#672:

Screen.Recording.2025-01-22.at.11.27.23.AM.mov

@dhruvmanila dhruvmanila added bug Something isn't working server Related to the LSP server labels Jan 22, 2025
@github-actions

Copy link
Copy Markdown
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

directory.to_path_buf(),
Arc::new(RuffSettings {
path: Some(pyproject),
unsafe_fixes: settings.unsafe_fixes,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you remember what's the reason for only storing parts of the settings instead of the entire settings struct with accessors for the linter/formatter settings?

@dhruvmanila dhruvmanila Jan 22, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it started out with just having LinterSettings and FormatterSettings (#10950) but later on we realized (via bug reports) that exclusions weren't being considered by the server which led to adding the FileResolverSettings (#11551).

It makes me wonder if we should simply store the entire Settings struct in RuffSettings. It seems like we eventually will need all of them anyway?

Yeah, I agree. I can do that as a follow-up.

@MichaReiser MichaReiser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This looks good. It makes me wonder if we should simply store the entire Settings struct in RuffSettings. It seems like we eventually will need all of them anyway?

@dhruvmanila
dhruvmanila merged commit 043ff61 into main Jan 22, 2025
@dhruvmanila
dhruvmanila deleted the dhruv/server-unsafe-fixes branch January 22, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working server Related to the LSP server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider unsafe-fixes config value for code action / command

2 participants