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

Handle skipped trivia in the C# tokenizer #11207

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 7 additions & 7 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
-->
<PropertyGroup>
<_MicrosoftWebToolsPackageVersion>17.11.11-preview-0001</_MicrosoftWebToolsPackageVersion>
<_MicrosoftVisualStudioShellPackagesVersion>17.11.39721</_MicrosoftVisualStudioShellPackagesVersion>
<_MicrosoftVisualStudioPackagesVersion>17.11.191</_MicrosoftVisualStudioPackagesVersion>
<_MicrosoftVisualStudioShellPackagesVersion>17.12.39557-preview.2.1</_MicrosoftVisualStudioShellPackagesVersion>
<_MicrosoftVisualStudioPackagesVersion>17.12.145-preview</_MicrosoftVisualStudioPackagesVersion>
<_VisualStudioLanguageServerProtocolVersion>17.12.1-preview</_VisualStudioLanguageServerProtocolVersion>
<_MicrosoftExtensionsPackageVersion>8.0.0</_MicrosoftExtensionsPackageVersion>
<_BasicReferenceAssembliesVersion>1.7.2</_BasicReferenceAssembliesVersion>
Expand All @@ -17,7 +17,7 @@
<_RoslynDiagnosticAnalyzersPackageVersion>3.11.0-beta1.24508.2</_RoslynDiagnosticAnalyzersPackageVersion>
<_MicrosoftVisualStudioLanguageServicesPackageVersion>$(MicrosoftVisualStudioLanguageServicesPackageVersion)</_MicrosoftVisualStudioLanguageServicesPackageVersion>
<_XunitPackageVersion>2.6.6</_XunitPackageVersion>
<_MicrosoftBuildPackageVersion>17.11.0-preview-24309-01</_MicrosoftBuildPackageVersion>
<_MicrosoftBuildPackageVersion>17.12.0-preview-24426-07</_MicrosoftBuildPackageVersion>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -85,14 +85,14 @@
<PackageVersion Include="Microsoft.VisualStudio.LanguageServices.Implementation.Symbols" Version="$(_MicrosoftVisualStudioLanguageServicesPackageVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.LiveShare" Version="0.3.1074" />
<PackageVersion Include="Microsoft.VisualStudio.ProjectSystem.SDK" Version="17.7.294-pre" />
<PackageVersion Include="Microsoft.VisualStudio.RpcContracts" Version="17.11.8" />
<PackageVersion Include="Microsoft.VisualStudio.RpcContracts" Version="17.12.11-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.Framework" Version="$(_MicrosoftVisualStudioShellPackagesVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Shell.15.0" Version="$(_MicrosoftVisualStudioShellPackagesVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Telemetry" Version="17.13.14" />
<PackageVersion Include="Microsoft.VisualStudio.Text.Data" Version="$(_MicrosoftVisualStudioPackagesVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Text.Implementation" Version="$(_MicrosoftVisualStudioPackagesVersion)" NoWarn="NU1701" />
<PackageVersion Include="Microsoft.VisualStudio.Text.Logic" Version="$(_MicrosoftVisualStudioPackagesVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.11.20" />
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.12.13-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Validation" Version="17.8.8" />
<PackageVersion Include="Microsoft.VisualStudio.Web" Version="16.10.0-preview-1-31008-014" />
<PackageVersion Include="Microsoft.WebTools.Languages.Html" Version="$(_MicrosoftWebToolsPackageVersion)" />
Expand All @@ -104,12 +104,12 @@
<PackageVersion Include="Microsoft.WebTools.Shared" Version="$(_MicrosoftWebToolsPackageVersion)" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Nerdbank.Streams" Version="2.11.74" />
<PackageVersion Include="Nerdbank.Streams" Version="2.11.79" />
<PackageVersion Include="NuGet.VisualStudio" Version="17.9.1" />
<PackageVersion Include="Roslyn.Diagnostics.Analyzers" Version="$(_RoslynDiagnosticAnalyzersPackageVersion)" />
<PackageVersion Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutablePackageVersion)" />
<PackageVersion Include="System.Resources.Extensions" Version="8.0.0" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="8.0.1" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataPackageVersion)" />
<PackageVersion Include="System.Security.Cryptography.Xml" Version="7.0.1" />
Expand Down
76 changes: 38 additions & 38 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,82 +11,82 @@
<Sha>1ebd9ce245112164207d961c0d2faea741c7c489</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Wpf" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Wpf" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.13.0-2.24554.8">
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.13.0-2.24564.3">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>8fc87e00bbe35131f7d3707621ae18e1af1aae55</Sha>
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency>
</ProductDependencies>
Expand Down
38 changes: 19 additions & 19 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,25 @@
<MicrosoftSourceBuildIntermediatearcadePackageVersion>9.0.0-beta.24516.2</MicrosoftSourceBuildIntermediatearcadePackageVersion>
<MicrosoftDotNetXliffTasksPackageVersion>1.0.0-beta.23475.1</MicrosoftDotNetXliffTasksPackageVersion>
<MicrosoftSourceBuildIntermediatexlifftasksPackageVersion>1.0.0-beta.23475.1</MicrosoftSourceBuildIntermediatexlifftasksPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>4.13.0-2.24554.8</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>4.13.0-2.24554.8</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
<MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>
<MicrosoftCodeAnalysisCommonPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisCommonPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.13.0-2.24554.8</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
<MicrosoftSourceBuildIntermediateroslynPackageVersion>4.13.0-2.24554.8</MicrosoftSourceBuildIntermediateroslynPackageVersion>
<MicrosoftVisualStudioLanguageServicesPackageVersion>4.13.0-2.24554.8</MicrosoftVisualStudioLanguageServicesPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>4.13.0-2.24564.3</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>4.13.0-2.24564.3</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
<MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>
<MicrosoftCodeAnalysisCommonPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisCommonPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
<MicrosoftSourceBuildIntermediateroslynPackageVersion>4.13.0-2.24564.3</MicrosoftSourceBuildIntermediateroslynPackageVersion>
<MicrosoftVisualStudioLanguageServicesPackageVersion>4.13.0-2.24564.3</MicrosoftVisualStudioLanguageServicesPackageVersion>
<!--
Exception - Microsoft.Extensions.ObjectPool and System.Collections.Immutable packages are not updated by automation,
but are present in Version.Details.xml for source-build PVP flow. See the comment in Version.Details.xml for more information.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,4 +396,92 @@ public void DirectiveBetweenSwitchAndCase_BeforeBrace()
}
""");
}

[Fact]
public void DirectiveAfterCSharpCode_01()
{
ParseDocumentTest("""
@{
var x = #if true
var y = 1;
}
""");
}

[Fact]
public void DirectiveAfterCSharpCode_02()
{
ParseDocumentTest("""
@{
var x = #if true
<div>Test</div>
}
""");
}

[Fact]
public void DirectiveAfterCSharpCode_03()
{
ParseDocumentTest("""
@{
var x = #if true;
var y = 1;
}
""");
}

[Fact]
public void DirectiveAfterCSharpCode_04()
{
ParseDocumentTest("""
@{
var x = #if true;
<div>Test</div>
}
""");
}

[Fact]
public void DirectiveAfterCSharpCode_05()
{
ParseDocumentTest("""
@{
if (true) #if true
var y = 1;
}
""");
}

[Fact]
public void DirectiveAfterCSharpCode_06()
{
ParseDocumentTest("""
@{
if (true) #if true
<div>Test</div>
}
""");
}

[Fact]
public void DirectiveAfterCSharpCode_07()
{
ParseDocumentTest("""
@{
if (true #if true)
var y = 1;
}
""");
}

[Fact]
public void DirectiveAfterCSharpCode_08()
{
ParseDocumentTest("""
@{
if (true #if true)
<div>Test</div>
}
""");
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Source Location: (2:0,2 [13] x:\dir\subdir\Test\TestComponent.razor)
Source Location: (2:0,2 [13] x:\dir\subdir\Test\TestComponent.razor)
|
#if true
|
Generated Location: (986:28,2 [13] )
|
Generated Location: (986:28,2 [13] )
|
#if true
|
Source Location: (20:3,2 [11] x:\dir\subdir\Test\TestComponent.razor)
|

Source Location: (20:3,2 [11] x:\dir\subdir\Test\TestComponent.razor)
|
#endif
|
Generated Location: (1120:36,2 [11] )
|
Generated Location: (1120:36,2 [11] )
|
#endif
|
|

Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Source Location: (2:0,2 [13] x:\dir\subdir\Test\TestComponent.razor)
Source Location: (2:0,2 [13] x:\dir\subdir\Test\TestComponent.razor)
|
#if true
|
Generated Location: (733:21,0 [13] )
|
Generated Location: (733:21,0 [13] )
|
#if true
|
Source Location: (20:3,2 [11] x:\dir\subdir\Test\TestComponent.razor)
|

Source Location: (20:3,2 [11] x:\dir\subdir\Test\TestComponent.razor)
|
#endif
|
Generated Location: (877:30,0 [11] )
|
Generated Location: (877:30,0 [11] )
|
#endif
|
|

Loading
Loading