Skip to content

Commit 749a789

Browse files
authored
Fix quick info for pp symbols (#78173)
Fixes #78171 CC @CyrusNajmabadi
2 parents 00b71c8 + a4f4d0f commit 749a789

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5544,6 +5544,31 @@ static void Main(string[] args)
55445544
""");
55455545
}
55465546

5547+
[Fact, WorkItem("https://github.com/dotnet/roslyn/issues/78171")]
5548+
public async Task TestPreprocessingSymbol()
5549+
{
5550+
var markup = """
5551+
using System.Threading;
5552+
using System.Threading.Tasks;
5553+
5554+
class Program
5555+
{
5556+
async Task Process(CancellationToken cancellationToken = default)
5557+
{
5558+
#if N$$ET
5559+
// .NET requires 100ms delay in this fictional example
5560+
await Task.Delay(100, cancellationToken);
5561+
#else
5562+
// .NET Framework requires 200ms delay in this fictional example, and we can't pass a CT on it
5563+
await Task.Delay(200);
5564+
#endif
5565+
}
5566+
}
5567+
""";
5568+
5569+
await TestAsync(markup, MainDescription("NET"));
5570+
}
5571+
55475572
[Fact, WorkItem("http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/546849")]
55485573
public async Task TestIndexedProperty()
55495574
{

src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions_Accessibility.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ private static bool IsSymbolAccessibleCore(
133133
case SymbolKind.Assembly:
134134
case SymbolKind.NetModule:
135135
case SymbolKind.RangeVariable:
136+
case SymbolKind.Preprocessing:
136137
// These types of symbols are always accessible (if visible).
137138
return true;
138139

0 commit comments

Comments
 (0)