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 "variable" kind for parameter completion #2061

Merged
merged 2 commits into from
Jan 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class CompletionService :
{ WellKnownTags.Method, CompletionItemKind.Method },
{ WellKnownTags.Module, CompletionItemKind.Module },
{ WellKnownTags.Operator, CompletionItemKind.Operator },
{ WellKnownTags.Parameter, CompletionItemKind.Value },
{ WellKnownTags.Parameter, CompletionItemKind.Variable },
{ WellKnownTags.Property, CompletionItemKind.Property },
{ WellKnownTags.RangeVariable, CompletionItemKind.Variable },
{ WellKnownTags.Reference, CompletionItemKind.Reference },
Expand Down
19 changes: 19 additions & 0 deletions tests/OmniSharp.Roslyn.CSharp.Tests/CompletionFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ public Class1()
Assert.Contains("foo", completions.Items.Select(c => c.TextEdit.NewText));
}

[Theory]
[InlineData("dummy.cs")]
[InlineData("dummy.csx")]
public async Task ParameterCompletion(string filename)
{
const string input =
@"public class Class1 {
public Class1(string foo)
{
foo$$
}
}";

var completions = await FindCompletionsAsync(filename, input, SharedOmniSharpTestHost);
Assert.Contains("foo", completions.Items.Select(c => c.Label));
Assert.Contains("foo", completions.Items.Select(c => c.TextEdit.NewText));
Assert.Equal(CompletionItemKind.Variable, completions.Items.First(c => c.TextEdit.NewText == "foo").Kind);
}

[Theory]
[InlineData("dummy.cs")]
[InlineData("dummy.csx")]
Expand Down