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

handle code actions requiring a separate file than the current buffer #359

Merged
merged 4 commits into from
Apr 22, 2018
Merged

handle code actions requiring a separate file than the current buffer #359

merged 4 commits into from
Apr 22, 2018

Conversation

tlo-johnson
Copy link
Contributor

when a code action does things in a file other than the current buffer, nothing happens. here's a fix for that ... seems to work as best i tested it.

a few things

  • is there a test suite to run ensuring i am not breaking anything?
  • not sure what to do when a new file is opened. should the user be taken back to the buffer from where the code action was run? should the new file be saved automatically? right now the user is left in the new file that was created, the file is not saved.
  • my python is non-existent so if there's a better way to accomplish this don't hesitate to let me know / change it.

thx

@tlo-johnson
Copy link
Contributor Author

oh .. feel free to squash the commits. i should have done that ... sorry

@nickspoons
Copy link
Member

I've only just become a maintainer, but historically the system here has been to do a straight merge, and let the submitter be responsible for whether they want to squash, so I'm just following that system. But if you prefer me to squash your PRs I can do that.

@nickspoons
Copy link
Member

To answer the points above:

  • No there is no test suite currently unfortunately. PR#287 will address that for the python code at least.
  • In my opinion a code action that results in a change in another buffer/file should go to that buffer if there's only one - but not for e.g. refactoring changes that might affect many files though. What is an example of a code action that this affects/fixes?
  • There have been a lot of coders with different styles who have contributed to the python before now. As long as it works and is reasonably consistent with the existing code style(s!) I'd say it's fine. Once the two big python PRs have been merged, we might be able to look at some rewrites if we need to.

@tlo-johnson
Copy link
Contributor Author

tlo-johnson commented Apr 21, 2018 via email

@nickspoons
Copy link
Member

nickspoons commented Apr 21, 2018

Great, I'll give it a try when I get some time later on, thanks!

I guess this is similar to dotnet/vscode-csharp#2112, which is apparently fixed by OmniSharp/omnisharp-roslyn#1143. I don't suppose you're testing against the latest version of omnisharp-roslyn?

@tlo-johnson
Copy link
Contributor Author

tlo-johnson commented Apr 21, 2018 via email

@nickspoons
Copy link
Member

Updated to the latest release, or are you building roslyn from source?

@tlo-johnson
Copy link
Contributor Author

tlo-johnson commented Apr 21, 2018 via email

@nickspoons
Copy link
Member

Great, I do the same thing. That fix was merged 2 weeks ago so this should be good.

I don't think vim ever pulled the servers itself, but it had them as submodules. We removed that as it was overly complicated - for the majority of users downloading the releases is the best option.

@tlo-johnson
Copy link
Contributor Author

tlo-johnson commented Apr 21, 2018 via email

@nickspoons
Copy link
Member

Hi @tadesegha, I've given this a try and it works well. After saying my personal preference was to switch to the new file buffer, I had a quick look at how VSCode handles this situation and they leave focus in the current buffer too, so let's leave this as it is. The new buffer is just a away anyway.

Thanks very much!

@nickspoons nickspoons merged commit d9ea240 into OmniSharp:master Apr 22, 2018
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.

2 participants