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