Skip to content

Design: Put system namespaces first in generated code - #10242

Merged
smitpatel merged 1 commit into
devfrom
sortusings
Nov 9, 2017
Merged

smitpatel merged 1 commit into
devfrom
sortusings

Conversation

@smitpatel

Copy link
Copy Markdown
Contributor

Don't generate empty namespace if context is not in namespce

Resolves #10225
Resolves #2467

{
/// <inheritdoc />
public virtual int Compare(string x, string y)
=> x?.StartsWith("System", StringComparison.Ordinal) == true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edge case, but this would include things that begin with:

  • Systematic
  • Systematize
  • Systemic
  • Systemize

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

== "System" OR StartsWith("System.") sounds good?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'll work.

Don't generate empty namespace if context is not in namespce

Resolves #10225
Resolves #2467
@smitpatel
smitpatel merged commit 32c336e into dev Nov 9, 2017
@smitpatel
smitpatel deleted the sortusings branch November 9, 2017 19:42
@julielerman

Copy link
Copy Markdown

awesome. thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants