Skip to content

Test plan for Global Using Directive feature #51307

@AlekseyTs

Description

@AlekseyTs

Championed issue: dotnet/csharplang#3428
Proposal: https://github.com/dotnet/csharplang/blob/master/proposals/csharp-10.0/GlobalUsingDirective.md
Feature branch: https://github.com/dotnet/roslyn/tree/features/GlobalUsingDirective

Syntax:

  • Valid global using
  • Misplaced global using inside namespace
  • Misplaced global using after usings
  • global using with top-level statements
    • With regular usings following
    • Without regular usings following
    • Misplaced after top-level statements
  • extern using
    • Before
    • After

Semantics:

  • Global usings respected across files
    • using directives
    • using aliases
  • Global usings respected inside namespaces (observable in aliases inside namespaces)
    • using directives
    • using aliases
  • Usings inside namespaces override global
    • using directives
    • using aliases
  • Extern usings visible to global usings
  • Global and top-level using considered at the same precedence (causing ambiguities)
    • using directives
    • using aliases
  • Global usings not visible in top-level aliases in same/separate files
    • using directives
    • using aliases
  • Duplicate global usings
    • Same file
      • using directives
      • using aliases
    • Different files
      • using directives
      • using aliases
  • Duplicate using
    • Same file
      • using directives
      • using aliases
    • Different file
      • using directives
      • using aliases
  • PDB information reflects global usings where appropriate
  • Determinism: global using ordering is correctly handled for deterministic builds
    There are a lot of tests with different order of global usings, also a set of ImportsInPdb_* tests that verify PDB content for global usings.

Productivity:

  • LangVersion
  • global and using keywords completion and colorization
  • Syntax normalizer
  • unused global using
  • features that automatically add usings (such as copy&paste) should no longer add a using when a global using already exists
  • sorting of usings
    • With externs as well
    • Without externs
  • symbol completion for types that are missing (not imported) should no longer suggest types that are already imported via global using
  • 'Move type to new file' carries the usings with it it thinks are needed in the new file. We should ensure that global usings are handled sensibly in this case (tbd what 'sensibly' means here).
  • Public API for getting all global usings in a Compilation
  • GoToDef on global alias
  • GetTypeInfo/GetSymbolInfo/GetDeclaredSymbol
  • GetAliasInfo
  • GetSpeculativeAliasInfo
    • Same file
    • Different file
  • EnC
  • Add using quickfix suggests global as well (?) - Consider if "Add Using" quickfix should suggest adding "global" using as well #55895
  • Find All References for a "global" alias should find references across all files - Find all references for a "global" using alias finds alias references only in the file that defines it  #55894

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions