-
Notifications
You must be signed in to change notification settings - Fork 419
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 Syntax-Tree not updated with edits made during initial startup #1655
Comments
/cc @JoeRobich |
Interesting. Do you save the file in If you enable trace log, can you see the |
The files don't get saved at any point. I don't know how to tell if an |
I was able to reproduce, and can assure that no Maybe VSCode Extension should buffer up the requests when server is in starting state? Or just send them as they'll be available in STDIN anyway, and will be read in correct order once server is initialized. See https://github.com/OmniSharp/omnisharp-roslyn/blob/master/src/OmniSharp.Stdio/Host.cs#L129 |
"buffering up requests" is something we've done in OmniSharp-vim, but the problem is knowing when OmniSharp-roslyn is completely initialised and ready for the requests. See #1521 |
This reproduces for me only if I don't Ctrl+S the edited file during the loading process. This leads me to believe the issue is that buffer requests were consumed by temporary "Misc" Document object omnisharp has created at edited file path (because it tried to find any project in solution including edited file path, but there are no projects in solution at this point). When Projects finish loading, they replace those temp Documents with permanent Document objects belonging to them, but since the new document objects load state from the File System, this doesn't include in-vscode edits done during the loading. Since project load subroutine already looks up temporary documents in order to delete them when permanent objects arrive, loading up their src content or some variant of this may be a non-intrusive way of fixing this. |
Repro steps:
public static void Tester(){}
and this function referencing it to your other class:public void Foo(){ Program.Tester(); }
Shift-Alt-F12
(Find-all-references) on the declaration of Tester and see that you get no results.Shift-Alt-F12
again. See that it now finds the reference.Expected behavior:
Changes made while Omnisharp is loading the initial document should still be processed and cause an update to the Syntax-tree, even if it's on a delay.
Actual behavior:
Changes made while Omnisharp is loading are "lost", only being "discovered" when another edit causes the Syntax-tree/semantic model to be re-evaluated.
CC @NTaylorMullen who I looked at this with.
The text was updated successfully, but these errors were encountered: