2 writes to _state
Microsoft.CodeAnalysis (2)
SourceGeneration\GeneratorDriver.cs (2)
34
_state
= state;
40
_state
= new GeneratorDriverState(parseOptions, optionsProvider, generators, incrementalGenerators, additionalTexts, ImmutableArray.Create(new GeneratorState[generators.Length]), DriverStateTable.Empty, SyntaxStore.Empty, driverOptions, runtime: TimeSpan.Zero);
34 references to _state
Microsoft.CodeAnalysis (34)
SourceGeneration\GeneratorDriver.cs (34)
88
var newState =
_state
.With(sourceGenerators:
_state
.Generators.AddRange(generators),
89
incrementalGenerators:
_state
.IncrementalGenerators.AddRange(incrementalGenerators),
90
generatorStates:
_state
.GeneratorStates.AddRange(new GeneratorState[generators.Length]));
101
var existingIndex =
_state
.Generators.IndexOf(generator);
105
states.Add(
_state
.GeneratorStates[existingIndex]);
113
return FromState(
_state
.With(generators, incrementalGenerators, states.ToImmutableAndFree()));
118
var newGenerators =
_state
.Generators;
119
var newStates =
_state
.GeneratorStates;
120
var newIncrementalGenerators =
_state
.IncrementalGenerators;
132
return FromState(
_state
.With(sourceGenerators: newGenerators, incrementalGenerators: newIncrementalGenerators, generatorStates: newStates));
137
var newState =
_state
.With(additionalTexts:
_state
.AdditionalTexts.AddRange(additionalTexts));
143
var newState =
_state
.With(additionalTexts:
_state
.AdditionalTexts.RemoveRange(additionalTexts));
158
var newState =
_state
.With(additionalTexts:
_state
.AdditionalTexts.Replace(oldText, newText));
162
public GeneratorDriver ReplaceAdditionalTexts(ImmutableArray<AdditionalText> newTexts) => FromState(
_state
.With(additionalTexts: newTexts));
165
? FromState(
_state
.With(parseOptions: newOptions))
169
? FromState(
_state
.With(optionsProvider: newOptions))
174
var results =
_state
.Generators.ZipAsArray(
175
_state
.GeneratorStates,
185
return new GeneratorDriverRunResult(results,
_state
.RunTime);
209
var generatorTimings =
_state
.Generators.ZipAsArray(
_state
.GeneratorStates, (generator, generatorState) => new GeneratorTimingInfo(generator, generatorState.ElapsedTime));
210
return new GeneratorDriverTimingInfo(
_state
.RunTime, generatorTimings);
216
if (
_state
.Generators.IsEmpty)
218
return
_state
.With(stateTable: DriverStateTable.Empty, runTime: TimeSpan.Zero);
223
var state =
_state
;
309
var syntaxStoreBuilder =
_state
.SyntaxStore.ToBuilder(compilation, syntaxInputNodes.ToImmutableAndFree(),
_state
.TrackIncrementalSteps, cancellationToken);
311
var driverStateBuilder = new DriverStateTable.Builder(compilation,
_state
, syntaxStoreBuilder, cancellationToken);
361
if (outputKind.HasFlag(outputNode.Kind) && !
_state
.DisabledOutputs.HasFlag(outputNode.Kind))
372
var prefix = GetFilePathPrefixForGenerator(this.
_state
.BaseDirectory, generator);