Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixed declaration name completion regression #1520

Merged
merged 5 commits into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
All changes to the project will be documented in this file.

## [1.32.21] - not yet released
* Fixed a regression on declaration name completion (PR: [#1520](https://github.com/OmniSharp/omnisharp-roslyn/pull/1520))

## [1.32.20] - 2019-06-03
* Added support for `TreatWarningsAsErrors` in csproj files (PR: [#1459](https://github.com/OmniSharp/omnisharp-roslyn/pull/1459))
* Updated to Roslyn `3.2.0-beta3-19281-01` to match VS dev16.2p2 (PR: [#1511](https://github.com/OmniSharp/omnisharp-roslyn/pull/1511))
Expand Down
1 change: 1 addition & 0 deletions build/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<PackageReference Update="Dotnet.Script.DependencyModel" Version="0.6.1" />
<PackageReference Update="Dotnet.Script.DependencyModel.NuGet" Version="0.6.2" />

<PackageReference Update="Humanizer" Version="2.2.0" />
<PackageReference Update="McMaster.Extensions.CommandLineUtils" Version="2.2.4" />

<PackageReference Update="Microsoft.AspNetCore.Diagnostics" Version="2.1.1" />
Expand Down
1 change: 1 addition & 0 deletions src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Humanizer" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" />
<PackageReference Include="System.Reactive" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
Expand Down
20 changes: 19 additions & 1 deletion tests/OmniSharp.Roslyn.CSharp.Tests/IntellisenseFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public Class1()
System.Guid.gu$$
}
}";

var completions = await FindCompletionsAsync(filename, input);
ContainsCompletions(completions.Select(c => c.CompletionText).Take(1), "NewGuid");
}
Expand Down Expand Up @@ -285,6 +285,24 @@ public MyClass2()
ContainsCompletions(completions.Select(c => c.CompletionText).Take(1), "text");
}

[Theory]
[InlineData("dummy.cs")]
[InlineData("dummy.csx")]
public async Task Returns_declaration_names(string filename)
{
const string source =
@"
public class MyClass
{
MyClass m$$
}
";

var completions = await FindCompletionsAsync(filename, source);
ContainsCompletions(completions.Select(c => c.CompletionText), "my", "myClass", "My", "MyClass");
}


[Theory]
[InlineData("dummy.cs")]
[InlineData("dummy.csx")]
Expand Down
4 changes: 2 additions & 2 deletions tests/TestUtility/OmniSharpTestHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public void AddFilesToWorkspace(params TestFile[] testFiles)
{
TestHelpers.AddProjectToWorkspace(
this.Workspace,
"project.json",
new[] { "dnx451", "dnxcore50" },
"project.csproj",
new[] { "net472" },
testFiles.Where(f => f.FileName.EndsWith(".cs", StringComparison.OrdinalIgnoreCase)).ToArray());

foreach (var csxFile in testFiles.Where(f => f.FileName.EndsWith(".csx", StringComparison.OrdinalIgnoreCase)))
Expand Down