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

Test plan for Global Using Directive feature #51307

Closed
60 of 62 tasks
AlekseyTs opened this issue Feb 18, 2021 · 2 comments
Closed
60 of 62 tasks

Test plan for Global Using Directive feature #51307

AlekseyTs opened this issue Feb 18, 2021 · 2 comments

Comments

@AlekseyTs
Copy link
Contributor

AlekseyTs commented Feb 18, 2021

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
@Youssef1313
Copy link
Member

From Discord:

image

@AlekseyTs Was this case considered? i.e, Is that behavior by design?).

@333fred
Copy link
Member

333fred commented Jun 25, 2021

This is by design. Global usings behave just like regular usings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants