-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Address remaining prototype comments #53929
Address remaining prototype comments #53929
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple minor fixes
state = _comparer.Equals(builder.GetLastEntries()[0], entry) ? EntryState.Cached : EntryState.Modified; | ||
} | ||
|
||
builder.AddEntry(entry, state); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add tests for this change / commit (making Join
comparable)
src/Compilers/Core/Portable/SourceGeneration/Nodes/NodeStateTable.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/AdditionalSourcesCollection.cs
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/Nodes/DriverStateTable.cs
Outdated
Show resolved
Hide resolved
|
||
var exception = Assert.Throws<ArgumentException>(() => asc.Add("file5.cs", SourceText.From("", encoding: null))); | ||
|
||
// check the exception contains the excpected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var source = @" | ||
class C { } | ||
"; | ||
var parseOptions = TestOptions.Regular.WithLanguageVersion(LanguageVersion.Preview); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TestOptions.RegularPreview
Assert.Equal(texts[0], calledFor[0].Item2.Single()); | ||
|
||
// edit the additional texts, and verify that the output was *not* called again on the next run | ||
driver = driver.RemoveAdditionalTexts(texts.ToImmutableArray()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create
is just a helper method, and calls ToImmutableArray()
under the hood. We should probably expose a Create
overload that takes an ImmutableArray
directly, but this is the same as V1.
Fixes various issue remaining with the feature, may be easiest to go commit by commit.
Note there is still one remaining comment here: https://github.com/chsienki/roslyn/blob/2a2d444eaa27a53cf84011645cbc729b5a9adc5d/src/Compilers/CSharp/Test/Semantic/SourceGeneration/GeneratorDriverTests.cs#L459 which is a skipped test. We should decide if the behavior difference is acceptable or not.