-
Notifications
You must be signed in to change notification settings - Fork 416
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
Fix missing signatures for some cases #1290
Merged
david-driscoll
merged 9 commits into
OmniSharp:master
from
SirIntruder:fixMissingSignatures
Nov 2, 2018
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
23da744
Fix missing signatures
1b18f7f
this makes more sense
83b5937
Merge branch 'master' into fixMissingSignatures
filipw ec3b6e1
Merge branch 'master' into fixMissingSignatures
SirIntruder bf44800
Merge branch 'master' into fixMissingSignatures
SirIntruder 50dc856
Merge branch 'master' into fixMissingSignatures
DustinCampbell 3dc94da
Merge branch 'master' into fixMissingSignatures
f8ea622
enhance tests
42aa10d
Merge branch 'master' into fixMissingSignatures
filipw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,21 +177,21 @@ public async Task AttributeCtorSingleParam(string filename) | |
const string source = | ||
@"using System; | ||
[MyTest($$)] | ||
public class TestClass | ||
public class TestClass | ||
{ | ||
public static void Main() | ||
{ | ||
} | ||
} | ||
public class MyTestAttribute : Attribute | ||
public class MyTestAttribute : Attribute | ||
{ | ||
public MyTestAttribute(int value) | ||
{ | ||
} | ||
}"; | ||
var actual = await GetSignatureHelp(filename, source); | ||
var actual = await GetSignatureHelp(filename, source); | ||
Assert.Equal(0, actual.ActiveParameter); | ||
|
||
var signature = actual.Signatures.ElementAt(0); | ||
Assert.Single(signature.Parameters); | ||
Assert.Equal("value", signature.Parameters.ElementAt(0).Name); | ||
|
@@ -206,13 +206,13 @@ public async Task AttributeCtorTestParameterLabels(string filename) | |
const string source = | ||
@"using System; | ||
[MyTest($$)] | ||
public class TestClass | ||
public class TestClass | ||
{ | ||
public static void Main() | ||
{ | ||
} | ||
} | ||
public class MyTestAttribute : Attribute | ||
public class MyTestAttribute : Attribute | ||
{ | ||
public MyTestAttribute(int value1,double value2) | ||
{ | ||
|
@@ -238,13 +238,13 @@ public async Task AttributeCtorActiveParamBasedOnComma(string filename) | |
const string source = | ||
@"using System; | ||
[MyTest(2,$$)] | ||
public class TestClass | ||
public class TestClass | ||
{ | ||
public static void Main() | ||
{ | ||
} | ||
} | ||
public class MyTestAttribute : Attribute | ||
public class MyTestAttribute : Attribute | ||
{ | ||
public MyTestAttribute(int value1,double value2) | ||
{ | ||
|
@@ -263,13 +263,13 @@ public async Task AttributeCtorNoParam(string filename) | |
const string source = | ||
@"using System; | ||
[MyTest($$)] | ||
public class TestClass | ||
public class TestClass | ||
{ | ||
public static void Main() | ||
{ | ||
} | ||
} | ||
public class MyTestAttribute : Attribute | ||
public class MyTestAttribute : Attribute | ||
{ | ||
public MyTestAttribute() | ||
{ | ||
|
@@ -733,6 +733,40 @@ static void M1(int a,int b,int c,int d) { } | |
Assert.Equal(4, actual.Signatures.Count()); | ||
} | ||
|
||
[Theory] | ||
[InlineData("dummy.cs")] | ||
[InlineData("dummy.csx")] | ||
public async Task LiteralContextMethod(string filename) | ||
{ | ||
const string source = | ||
@"class A | ||
{ | ||
static void M() | ||
{ | ||
string three = 3.ToString($$); | ||
} | ||
}"; | ||
var actual = await GetSignatureHelp(filename, source); | ||
Assert.NotEmpty(actual.Signatures); | ||
} | ||
|
||
[Theory] | ||
[InlineData("dummy.cs")] | ||
[InlineData("dummy.csx")] | ||
public async Task TypeOfContextMethod(string filename) | ||
{ | ||
const string source = | ||
@"class A | ||
{ | ||
static void M() | ||
{ | ||
var members = typeof(A).GetMembers($$); | ||
} | ||
}"; | ||
var actual = await GetSignatureHelp(filename, source); | ||
Assert.NotEmpty(actual.Signatures); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be great if this could also assert that one of the intended signatures exists. |
||
} | ||
|
||
[Fact] | ||
public async Task OverloadedExtensionMethods1() | ||
{ | ||
|
@@ -882,7 +916,7 @@ public static void Main() | |
var flag = Compare($$); | ||
} | ||
///<summary>Checks if object is tagged with the tag.</summary> | ||
/// <param name=""gameObject"">The game object.</param> | ||
/// <param name=""gameObject"">The game object.</param> | ||
/// <param name=""tagName"">Name of the tag.</param> | ||
/// <returns>Returns <c> true</c> if object is tagged with tag.</returns> | ||
public static bool Compare(GameObject gameObject, string tagName) | ||
|
@@ -914,7 +948,7 @@ public static void Main() | |
var flag = Compare($$); | ||
} | ||
///<summary>Checks if object is tagged with the tag.</summary> | ||
/// <param name=""gameObject"">The game object.</param> | ||
/// <param name=""gameObject"">The game object.</param> | ||
/// <param name=""tagName"">Name of the tag.It has the default value as <c>null</c></param> | ||
/// <returns>Returns <c> true</c> if object is tagged with tag.</returns> | ||
public static bool Compare(GameObject gameObject, string tagName = null) | ||
|
@@ -943,7 +977,7 @@ public static void Main() | |
var flag = Compare($$); | ||
} | ||
///<summary>Checks if object is tagged with the tag.</summary> | ||
/// <param name=""gameObject"">The game object.</param> | ||
/// <param name=""gameObject"">The game object.</param> | ||
/// <param name=""tagName"">Name of the tag.</param> | ||
/// <returns>Returns <c>true</c> if object is tagged with tag.</returns> | ||
public static bool Compare(GameObject gameObject, string tagName) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if this could also assert that one of the intended signatures exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way we can avoid potential signatures being removed when they shouldn't have been.