diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6d8b5d71d0..6421d0ed46 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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))
diff --git a/build/Packages.props b/build/Packages.props
index 17b6b8d7e8..03e5071c63 100644
--- a/build/Packages.props
+++ b/build/Packages.props
@@ -14,6 +14,7 @@
+
diff --git a/src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj b/src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj
index 7755a3546b..28ce5eea30 100644
--- a/src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj
+++ b/src/OmniSharp.Roslyn.CSharp/OmniSharp.Roslyn.CSharp.csproj
@@ -12,6 +12,7 @@
+
diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/BufferManagerFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/BufferManagerFacts.cs
index 2eb53cf89f..5dfdd3b9ba 100644
--- a/tests/OmniSharp.Roslyn.CSharp.Tests/BufferManagerFacts.cs
+++ b/tests/OmniSharp.Roslyn.CSharp.Tests/BufferManagerFacts.cs
@@ -25,19 +25,16 @@ public async Task UpdateBufferIgnoresVoidRequests()
{
using (var host = CreateOmniSharpHost(new TestFile("test.cs", "class C {}")))
{
- Assert.Equal(2, host.Workspace.CurrentSolution.Projects.Count());
+ Assert.Single(host.Workspace.CurrentSolution.Projects);
Assert.Single(host.Workspace.CurrentSolution.Projects.ElementAt(0).Documents);
- Assert.Single(host.Workspace.CurrentSolution.Projects.ElementAt(1).Documents);
await host.Workspace.BufferManager.UpdateBufferAsync(new Request() { });
- Assert.Equal(2, host.Workspace.CurrentSolution.Projects.Count());
+ Assert.Single(host.Workspace.CurrentSolution.Projects);
Assert.Single(host.Workspace.CurrentSolution.Projects.ElementAt(0).Documents);
- Assert.Single(host.Workspace.CurrentSolution.Projects.ElementAt(1).Documents);
await host.Workspace.BufferManager.UpdateBufferAsync(new Request() { FileName = "", Buffer = "enum E {}" });
- Assert.Equal(2, host.Workspace.CurrentSolution.Projects.Count());
+ Assert.Single(host.Workspace.CurrentSolution.Projects);
Assert.Single(host.Workspace.CurrentSolution.Projects.ElementAt(0).Documents);
- Assert.Single(host.Workspace.CurrentSolution.Projects.ElementAt(1).Documents);
}
}
diff --git a/tests/OmniSharp.Roslyn.CSharp.Tests/IntellisenseFacts.cs b/tests/OmniSharp.Roslyn.CSharp.Tests/IntellisenseFacts.cs
index f1985ebd9a..171cc74b06 100644
--- a/tests/OmniSharp.Roslyn.CSharp.Tests/IntellisenseFacts.cs
+++ b/tests/OmniSharp.Roslyn.CSharp.Tests/IntellisenseFacts.cs
@@ -142,7 +142,7 @@ public Class1()
System.Guid.gu$$
}
}";
-
+
var completions = await FindCompletionsAsync(filename, input);
ContainsCompletions(completions.Select(c => c.CompletionText).Take(1), "NewGuid");
}
@@ -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")]
diff --git a/tests/OmniSharp.Tests/UpdateBufferFilterFacts.cs b/tests/OmniSharp.Tests/UpdateBufferFilterFacts.cs
index 66d8d6fa4d..dbe86862f4 100644
--- a/tests/OmniSharp.Tests/UpdateBufferFilterFacts.cs
+++ b/tests/OmniSharp.Tests/UpdateBufferFilterFacts.cs
@@ -59,7 +59,7 @@ public async Task UpdateBuffer_AddsNewDocumentsIfNeeded()
{
await host.Workspace.BufferManager.UpdateBufferAsync(new Request() { FileName = "test2.cs", Buffer = "interface I {}" });
- Assert.Equal(2, host.Workspace.CurrentSolution.GetDocumentIdsWithFilePath("test2.cs").Length);
+ Assert.Single(host.Workspace.CurrentSolution.GetDocumentIdsWithFilePath("test2.cs"));
var docId = host.Workspace.CurrentSolution.GetDocumentIdsWithFilePath("test2.cs").FirstOrDefault();
Assert.NotNull(docId);
var sourceText = await host.Workspace.CurrentSolution.GetDocument(docId).GetTextAsync();
@@ -82,7 +82,7 @@ public async Task UpdateBuffer_TransientDocumentsDisappearWhenProjectAddsThem()
await host.Workspace.BufferManager.UpdateBufferAsync(new Request() { FileName = "transient.cs", Buffer = "interface I {}" });
var docIds = host.Workspace.CurrentSolution.GetDocumentIdsWithFilePath("transient.cs");
- Assert.Equal(2, docIds.Length);
+ Assert.Single(docIds);
// simulate a project system adding the file for real
var project1 = host.Workspace.CurrentSolution.Projects.First();
diff --git a/tests/TestUtility/OmniSharpTestHost.cs b/tests/TestUtility/OmniSharpTestHost.cs
index e81b14f6e6..f66ab824f2 100644
--- a/tests/TestUtility/OmniSharpTestHost.cs
+++ b/tests/TestUtility/OmniSharpTestHost.cs
@@ -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)))