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

EditorConfig support flakey after LSP initialization / restart. #5874

Closed
Tracked by #5951
StringEpsilon opened this issue Jun 28, 2023 · 2 comments
Closed
Tracked by #5951

EditorConfig support flakey after LSP initialization / restart. #5874

StringEpsilon opened this issue Jun 28, 2023 · 2 comments
Assignees
Milestone

Comments

@StringEpsilon
Copy link

StringEpsilon commented Jun 28, 2023

In version v2.0.238, I noticed that under some circumstances my editorconfig formatting settings are ignored in favor of the defaults.

Notably this affects csharp_new_line_before_open_brace.

Before:

public class ExampleClass {
	public string TestProperty { get; set; }
}

After:

public class ExampleClass 
{
	public string TestProperty { get; set; }
}

The problem sometimes fixes itself after a couple minutes. Sometimes I need to restart the language server again. Sometimes I need to restart VS Code.

It can also be tricky to reliably replicate.

Relevant editorconfig section:

[*]
csharp_style_var_when_type_is_apparent = true
csharp_prefer_braces = true:error
csharp_new_line_before_else = false
csharp_new_line_before_open_brace = none
csharp_new_line_before_catch = false
csharp_new_line_before_finally = false
csharp_style_prefer_range_operator = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true

Final note: The formatter still respects my indentation settings, even if I change back and forth in the .editorconfig without reloading the LSP. But the csharp_new_line_before_open_brace option remains broken.

@StringEpsilon StringEpsilon changed the title EditorConfig support flakey after LSP initilization / restart. EditorConfig support flakey after LSP initialization / restart. Jun 28, 2023
@arunchndr arunchndr added this to the GA milestone Jun 28, 2023
@arunchndr arunchndr modified the milestones: GA, Preview 2 Jun 28, 2023
@arunchndr arunchndr modified the milestones: Preview 2, GA Jul 10, 2023
@arunchndr arunchndr modified the milestones: GA, Post GA Jul 25, 2023
@dibarbet dibarbet modified the milestones: Post GA, August Aug 2, 2023
@arunchndr arunchndr modified the milestones: August, October Oct 2, 2023
@beccamc beccamc assigned akhera99 and unassigned beccamc Dec 20, 2023
@dibarbet
Copy link
Member

@StringEpsilon can you still reproduce this issue on the latest (prerelease) version of the extension? I have not been able to.

If you can - can you let me know if you're using DevKit and what commands you're using to restart the server?

@dibarbet dibarbet modified the milestones: October2023, August2024 Jul 31, 2024
@StringEpsilon
Copy link
Author

I haven't had the issue come up in quite a while. I also can't force it now. I'd say this is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants