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

Adds support for /completion and /completion/resolve endpoints for Cake. #1944

Merged
merged 4 commits into from Sep 15, 2020

Conversation

bjorkstromm
Copy link
Member

// [Fact]
// public async Task ShouldGetCompletionWithAdditionalTextEdits()
// {
// const string input = @"Regex.Repl$$";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyone know how to get a completion with Additional Text? In Cake, e.g. we don't have System.Text.RegularExpressions namespace imported by default. This was my attempt to get a completion from CompletionItemExtensions.TypeImportCompletionProvider. I also tried var regex == new Rege$$, but that didn't work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's disabled by default, you need to pass in an option RoslynExtensionsOptions:EnableImportCompletion
https://github.com/OmniSharp/omnisharp-roslyn/blob/master/tests/OmniSharp.Roslyn.CSharp.Tests/CompletionFacts.cs#L1399

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thank you!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auch! Does AdditionalTextEdits always contain the whole buffer? //cc @333fred
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, yes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, yes.

Thanks for the quick reply. In that case I think I'll just remove all additional texts for Cake files. Can Completion return Additional text, or is it just the Resolver that adds this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Override completion can do this as well, and those are not usually so long.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I managed to get override completion in at least. Or if it doesn't bring in an unimported type.

@bjorkstromm bjorkstromm marked this pull request as ready for review September 15, 2020 19:36
@JoeRobich JoeRobich merged commit 8f10a7f into OmniSharp:master Sep 15, 2020
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.

Missing Cake Response handlers in V1.37.1
4 participants