-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How to set indentation to 2 spaces? #48
Comments
Hey @blldw; which editor are you using? Asking to make sure it is lsp formatting features that are formatting your code and not the editor. At the moment csharp-ls provides about 0 :) configuration -- but this should be feasible to do by setting roslyn configurables. |
I'm using Emacs 29.0.50 for editing the CSharp code, and whenever I input a `;',
I'm using Emacs 29.0.50 for editing the CSharp code, and how can I change the roslyn configurations? |
hmm, have you tried configuring I am not 100% sure how it is setup on your machine, but I think by default e.g. I have this on my config.el file which works quite nicely for my coding style.. (after! csharp-mode
(defun sm-csharp-mode-setup ()
(setq indent-tabs-mode nil)
(setq c-syntactic-indentation t)
(c-set-style "ellemtel")
(setq c-basic-offset 4)
(setq truncate-lines t)
(setq tab-width 4)
(setq evil-shift-width 4)) also @kstatz12 is working on .editorconfig support so maybe that will help #49 in your case maybe you don't even need changes in csharp-ls if you set proper values in .editorconfig and you have https://github.com/editorconfig/editorconfig-emacs plugged in.. |
If I only use csharp-mode when writing csharp code, 2 space indentation works fine; However, If I enable lsp-mode, the problem I posted will occur:
@razzmatazz Your configuration for 4 spaces indentation worked, but not the solution for 2 space indentation. With LSP, C/C++, Python, and Javascript all worked with 2 space indentation, and C# is an exception. I can't figure out whether the problem is attributed to |
I am accustomed to using 2 spaces of indentation, and I would like to know whether there is a variable to keep the indentation to 2 spaces or if there is any way to keep these 2 spaces of indentation. When I input a `;', the code becomes 4 spaces of indentation automatically, and I want to avoid this happening.
The text was updated successfully, but these errors were encountered: