Skip to content

Test plan for enhanced #line directives #54509

@cston

Description

@cston

Proposal: dotnet/csharplang#4747
Spec: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-10.0/enhanced-line-directives.md

#line (startLine, startChar) - (endLine, endChar) charOffset "fileName"

Parsing

  • -langversion
  • in inactive region
  • incomplete directive
  • missing tokens
  • unexpected token types
  • with extra/no trivia between tokens

Semantics

  • CSharpSyntaxTree.GetLineMappings()
  • values out of range
  • (endLine, endChar) < (startLine, startChar)
  • before/after #line default, #line hidden, #line number
  • diagnostic reported for mapped span
  • sequence points in mapped span
  • diagnostics and GetLineMappings() return default (unmapped) spans after malformed #line
  • spans that start/end before/after charOffset with single- and multi-line spans
  • spans shorter/longer than mapped span with single- and multi-line spans
  • SyntaxNormalizer
  • CSharpCompiler.ResolveEmbeddedFilesFromExternalSourceDirectives()

Productivity

  • Classification: ClassifyTrivia(), ClassifyPreprocessorDirective()
  • Formatting
  • EnC after changing #line
  • CSharpSyntaxFacts.TryGetExternalSourceInfo()

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions