Skip to content

Adds .editorconfig file #2876

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

Closed
wants to merge 1 commit into from
Closed

Conversation

sobolevn
Copy link
Contributor

It was really bothering me that my vscode was not adding 4 spaces as the default ident.

What is editorconfig? It is a tool to standartize things like new lines, idents, and whitespaces across different editors and different OSes.
Docs: https://editorconfig.org/

@youknowone
Copy link
Member

youknowone commented Aug 13, 2021

Do you experience it even after installing RLS(Rust Language Server)? We just follow the default rule of rustfmt, so I expect that must be configured well at least after installing the plugins if there is no special settings already.

@sobolevn
Copy link
Contributor Author

I use https://github.com/rust-analyzer/rust-analyzer
Without this file it is inconvenient in the formatting part 🙂

@fanninpm
Copy link
Contributor

No real need. Just make sure "editor.formatOnSave": true is in your workspace's .vscode/settings.json, and rustfmt will take care of the rest. (Remember to turn it off when you're working within the Lib/ directory, though.)

@youknowone
Copy link
Member

I think formatOnSave is a convenient tool but not the proper solution of the wrong indentation for editing itself. I wonder why it happens. I tried a bare vscode but didn't have that problem. So now I think you have some global indent configuration in vscode.

To test a bare vscode, stroke . key in anywhere of https://github.com/RustPython/RustPython/ . it will show a web version of vscode without much things.

@youknowone
Copy link
Member

I think #2897 is a reasonable support for this PR, though it only can fix the indent problem but not formatting itself.

@youknowone youknowone closed this Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants