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

Use correct span when requesting code actions from OmniSharp #1606

Merged
merged 1 commit into from
Jul 7, 2017

Conversation

DustinCampbell
Copy link
Member

Fixes #1605

When calling CodeActionProvider.provideCodeActions(...), VS Code passes the range of the word to the left of the editor caret if there's no selection. This ends up causing refactorings like Extract Method to be offered even when the user hasn't selected any code. Now, we'll check to see if there's actually a selection and use that instead of the range that's given.

To fully fix this issue, I've made several changes in OmniSharp: OmniSharp/omnisharp-roslyn#899. Once that goes in, we'll need to update the version of OmniSharp used by C# for VS Code.

Fixes dotnet#1605

When calling CodeActionProvider.provideCodeActions(...), VS Code passes the range of the word to the left of the editor caret if there's no selection. This ends up causing refactorings like Extract Method to be offered even when the user hasn't selected any code. Now, we'll check to see if there's actually a selection and use that instead of the range that's given.

To fully fix this issue, I've made several changes in OmniSharp: OmniSharp/omnisharp-roslyn#899. Once that goes in, we'll need to update the version of OmniSharp used by C# for VS Code.
@DustinCampbell DustinCampbell merged commit ae03105 into dotnet:master Jul 7, 2017
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.

Selection-based refactorings should not appear when there is no selection
2 participants