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

OmniSharp seems to randomly forget EditorConfig state #1955

Closed
alexrp opened this issue Sep 15, 2020 · 6 comments · Fixed by #2028
Closed

OmniSharp seems to randomly forget EditorConfig state #1955

alexrp opened this issue Sep 15, 2020 · 6 comments · Fixed by #2028

Comments

@alexrp
Copy link

alexrp commented Sep 15, 2020

Steps to reproduce:

  1. Clone git://github.com/flare-lang/flare.git and git://github.com/flare-lang/flare-performance.git next to each other.
  2. Create a workspace and add the two cloned directories to it.
  3. Restart VS Code and re-open the newly created workspace.
  4. Wait for OmniSharp to finish analyzing the flare repository.
  5. Start opening random files between the two repositories.
  6. Eventually, OmniSharp will forget its state from flare/.editorconfig resulting in thousands of error diagnostics.

Unfortunately, I haven't been able to narrow down an exact action (or sequence of actions) that reproduces this reliably, but opening files at random seems to eventually trigger the issue. It's worth noting that the issue does not occur if I open the flare repository by itself (i.e. without using a multi-root workspace).

Restarting OmniSharp usually resolves the issue for some time, though it eventually pops up again, usually within 5-10 minutes. Given the time it takes to fully analyze the solution (during which IDE functionality is very limited), this isn't a great workaround.

(Note: I am aware that OmniSharp doesn't have good support for multi-root workspaces at the moment (judging by other issues tracking progress in this area) but since the flare-performance repository contains no C#/.NET code whatsoever, I would expect there not to be issues in this particular scenario.)

Versions used:

  • VS Code 1.49.0
  • C# extension 1.23.2
  • OmniSharp 1.37.2-beta.11
  • .NET 5.0 RC1
@filipw filipw transferred this issue from OmniSharp/omnisharp-roslyn Sep 15, 2020
@filipw
Copy link
Member

filipw commented Sep 15, 2020

I have moved this into omnisharp-vscode as multi-root workspaces is a VS Code concept.

@alexrp
Copy link
Author

alexrp commented Sep 18, 2020

@filipw unfortunately, it seems I was wrong. I'm now able to reproduce this on a smaller project using a single workspace. I'm starting to think it has nothing to do with the workspace setup, and might be a bug in omnisharp-roslyn after all.

I've also noticed that whenever I edit .editorconfig, OmniSharp seems to just completely forget all the settings therein without actually reloading them. This particular behavior is completely consistent. Might be related.

I'll try to put together a smaller repro project.

@JoeRobich JoeRobich changed the title OmniSharp seems to randomly forget EditorConfig state in multi-root workspaces OmniSharp seems to randomly forget EditorConfig state Sep 22, 2020
@JoeRobich
Copy link
Member

Edited title to show this isn't multiroot workspace dependant. Moving to OmniSharp-Roslyn

@JoeRobich JoeRobich transferred this issue from dotnet/vscode-csharp Sep 22, 2020
@alexrp
Copy link
Author

alexrp commented Sep 26, 2020

I don't have a reduced repro yet, but what I can say is that having VS Code open while at the same time running e.g. dotnet build or dotnet run in an external terminal seems to trigger the issue consistently.

@alexrp
Copy link
Author

alexrp commented Oct 12, 2020

I think I've managed to find two ways to reliably repro the issue:

  1. git clone [email protected]:alexrp/system-terminal.git
  2. Open the directory in VS Code and wait for analysis to finish
  3. Open src/core/core.csproj in VS Code
  4. Make an arbitrary change like inserting <!-- --> somewhere, then save the document

At this point, OmniSharp seems to forget all its EditorConfig state.

Another way, with the same project:

  1. Open the directory in VS Code
  2. Open an external terminal in the directory
  3. Run dotnet run -p src/sample hosting

Again OmniSharp seems to forget its EditorConfig state.

@alexrp
Copy link
Author

alexrp commented Oct 12, 2020

Editing a project file seems to trigger the issue consistently even after restarting OmniSharp from within VS Code.

It's inconsistent whether dotnet run will trigger the issue after restarts. It always happens on the first run after starting VS Code, though.

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