1220 references to Solution
AnalyzerRunner (2)
CodeRefactoringRunner.cs (2)
96document.Project.Solution, new ProgressTracker(), cancellationToken).ConfigureAwait(false); 104var changes = applyChangesOperation.ChangedSolution.GetChanges(document.Project.Solution);
IdeBenchmarks (1)
RegexClassifierBenchmarks.cs (1)
84var extensionManager = document.Project.Solution.Services.GetService<IExtensionManager>();
IdeCoreBenchmarks (1)
ProjectOperationBenchmarks.cs (1)
107var solution = Project.Solution;
Microsoft.CodeAnalysis.CodeStyle.Fixes (36)
AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (3)
27var service = context.Document.Project.Solution.Services.GetRequiredService<ISupportedChangesService>(); 67var newSolution = await renameActionSet.UpdateSolutionAsync(documentWithInvalidFolders.Project.Solution, cancellationToken).ConfigureAwait(false); 68Debug.Assert(newSolution != document.Project.Solution);
AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
47fixAllContext.Project.Solution,
AbstractConvertToAsyncCodeFixProvider.cs (1)
72var otherDocument = document.Project.Solution.GetDocument(syntaxTree);
AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
164var solution = document.Project.Solution; 198return newDocument.Project.Solution;
AbstractMakeMethodSynchronousCodeFixProvider.cs (5)
77var solution = document.Project.Solution; 110var newSolution = newDocument.Project.Solution; 133methodSymbol, document.Project.Solution, cancellationToken).ConfigureAwait(false); 146document.Project.Solution, referencedSymbol.Locations.ToImmutableArray(), cancellationToken).ConfigureAwait(false); 151return document.Project.Solution;
AbstractMoveDeclarationNearReferenceService.cs (1)
83var editor = new SyntaxEditor(root, document.Project.Solution.Services);
AbstractMoveDeclarationNearReferenceService.State.cs (1)
91var findReferencesResult = await SymbolFinder.FindReferencesAsync(LocalSymbol, document.Project.Solution, cancellationToken).ConfigureAwait(false);
AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
67var solutionServices = document.Project.Solution.Services;
AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
292var editor = new SyntaxEditor(root, document.Project.Solution.Services); 914var referencedSymbols = await SymbolFinder.FindReferencesAsync(local, document.Project.Solution, cancellationToken).ConfigureAwait(false);
AbstractUnsealClassCodeFixProvider.cs (3)
43type, document.Project.Solution, cancellationToken).ConfigureAwait(false); 50c => UnsealDeclarationsAsync(document.Project.Solution, definition.DeclaringSyntaxReferences, c), 66var editor = new SyntaxEditor(root, document.Project.Solution.Services);
AbstractUpgradeProjectCodeFixProvider.cs (1)
44var solution = project.Solution;
AbstractUseCollectionInitializerCodeFixProvider.cs (1)
99var subEditor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
AbstractUseConditionalExpressionCodeFixProvider.cs (1)
62var nestedEditor = new SyntaxEditor(root, document.Project.Solution.Services);
AbstractUseObjectInitializerCodeFixProvider.cs (1)
100var subEditor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
AddParameterService.cs (2)
83var solution = invocationDocument.Project.Solution; 151method, invocationDocument.Project.Solution, cancellationToken).ConfigureAwait(false);
DocumentExtensions.cs (3)
79var workspace = document.Project.Solution.Workspace; 144var semanticModelService = document.Project.Solution.Services.GetRequiredService<ISemanticModelReuseWorkspaceService>(); 200var solution = document.Project.Solution;
NamingStyleCodeFixProvider.cs (1)
110document.Project.Solution, symbol, new SymbolRenameOptions(), fixedName,
ProjectExtensions.cs (2)
37=> project.Solution.Workspace.Services.GetExtendedLanguageServices(project.Language); 86var solutionOrProjectFilePath = project.Solution?.FilePath ?? project.FilePath;
SupportedChangesServiceExtensions.cs (1)
13=> project.Solution.Services.GetRequiredService<ISupportedChangesService>().CanApplyParseOptionChange(oldOptions, newOptions, project);
SyntaxEditorBasedCodeFixProvider.cs (1)
82var editor = new SyntaxEditor(root, document.Project.Solution.Services);
TextDocumentExtensions.cs (2)
39return textDocument.Project.Solution.WithAdditionalDocumentText(textDocument.Id, text, PreservationMode.PreserveIdentity).GetTextDocument(textDocument.Id)!; 48return textDocument.Project.Solution.WithAnalyzerConfigDocumentText(textDocument.Id, text, PreservationMode.PreserveIdentity).GetTextDocument(textDocument.Id)!;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (14)
ConvertToRecordEngine.cs (1)
113var solutionEditor = new SolutionEditor(document.Project.Solution);
CSharpCodeGenerationService.cs (1)
77var newContext = context with { Solution = newDocument.Project.Solution };
CSharpInlineDeclarationCodeFixProvider.cs (1)
118var editor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
67var editor = new SyntaxEditor(root, document.Project.Solution.Services);
CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
43var editor = new SyntaxEditor(memberDeclaration, document.Project.Solution.Services);
CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
47return project.Solution.WithProjectCompilationOptions(project.Id, compilationOptions.WithAllowUnsafe(true));
CSharpUpgradeProjectCodeFixProvider.cs (2)
98return project.Solution.WithProjectParseOptions(project.Id, parseOptions.WithLanguageVersion(parsedNewVersion)); 103return project.Solution;
CSharpUseDeconstructionCodeFixProvider.cs (1)
68var editor = new SyntaxEditor(root, document.Project.Solution.Services);
CSharpUseLocalFunctionCodeFixProvider.cs (1)
117document.Project.Solution.Services, currentRoot,
EmbeddedStatementPlacementCodeFixProvider.cs (1)
51var editor = new SyntaxEditor(root, document.Project.Solution.Services);
MakeLocalFunctionStaticCodeFixHelper.cs (3)
36var syntaxEditor = new SyntaxEditor(root, document.Project.Solution.Services); 56localFunctionSymbol, document.Project.Solution, documentImmutableSet, cancellationToken).ConfigureAwait(false); 128capture, document.Project.Solution, documentImmutableSet, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (2)
CSharpMatchFolderAndNamespaceTests.cs (2)
71return project.WithDefaultNamespace(defaultNamespace).Solution; 928solution = project.WithDefaultNamespace(DefaultNamespace).Solution;
Microsoft.CodeAnalysis.CSharp.EditorFeatures (4)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (1)
183return document.Project.Solution.WithDocumentText(
Formatting\CSharpFormattingInteractionService.cs (1)
100return Task.FromResult(Formatter.GetFormattedTextChanges(parsedDocument.Root, SpecializedCollections.SingletonEnumerable(formattingSpan), document.Project.Solution.Services, options, cancellationToken).ToImmutableArray());
StringCopyPaste\StringCopyPasteCommandHandler.cs (1)
228var copyPasteService = documentBeforePaste.Project.Solution.Services.GetRequiredService<IStringCopyPasteService>();
StringCopyPaste\StringCopyPasteCommandHandler_CutCopy.cs (1)
67var copyPasteService = document.Project.Solution.Services.GetService<IStringCopyPasteService>();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (27)
CodeActions\ApplyChangesOperationTests.cs (1)
36var codeAction = new TestCodeAction(_changeSolution(context.Document.Project.Solution));
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (2)
929Assert.NotEqual(documentToModify.Project.Solution, modifiedSolution); 933Assert.Equal(documentToModify.Project.Solution, modifiedSolution);
CodeActions\Preview\PreviewExceptionTests.cs (1)
118extensionManager = document.Project.Solution.Services.GetService<IExtensionManager>() as EditorLayerExtensionManager.ExtensionManager;
CodeActions\Preview\PreviewTests.cs (1)
74var solution = _oldDocument.Project.Solution;
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (4)
3213workspace.ChangeSolution(updatedP1.Solution); 3267workspace.ChangeSolution(updatedProject.Solution); 3284document.Project.Solution.Workspace.TryApplyChanges(newDoc.Project.Solution);
Completion\CompletionServiceTests.cs (1)
174Assert.True(workspace.SetCurrentSolution(_ => project.Solution, WorkspaceChangeKind.SolutionChanged));
CSharpMatchFolderAndNamespaceTests.cs (2)
71return project.WithDefaultNamespace(defaultNamespace).Solution; 928solution = project.WithDefaultNamespace(DefaultNamespace).Solution;
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (1)
59.Projects.Single().AddAdditionalDocument(name: "dummy.txt", text: "", filePath: "dummy.txt").Project.Solution;
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
47AddDocument("test.cs", SourceText.From(source, Encoding.UTF8), filePath: Path.Combine(TempRoot.Root, "test.cs")).Project.Solution; 465AddDocument("test.cs", root, filePath: Path.Combine(TempRoot.Root, "test.cs")).Project.Solution;
Formatting\CodeCleanupTests.cs (2)
743project = project.Solution.WithProjectFilePath(project.Id, @$"z:\\{project.FilePath}").GetProject(project.Id); 745workspace.TryApplyChanges(project.Solution);
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (2)
129using var workspace = (TestWorkspace)project.Solution.Workspace; 258var compilationFactory = project.Solution.Services.GetRequiredLanguageService<ICompilationFactoryService>(LanguageNames.CSharp);
PdbSourceDocument\ImplementationAssemblyLookupServiceTests.cs (3)
54var workspace = (TestWorkspace)project.Solution.Workspace; 92var workspace = (TestWorkspace)project.Solution.Workspace; 133var workspace = (TestWorkspace)project.Solution.Workspace;
PdbSourceDocument\PdbSourceDocumentTests.cs (1)
865using var workspace = (TestWorkspace)project.Solution.Workspace;
Workspaces\WorkspaceTests_EditorFeatures.cs (4)
1241workspace.TryApplyChanges(doc.Project.Solution); 1248workspace.TryApplyChanges(project.RemoveAdditionalDocument(doc.Id).Solution); 1269workspace.TryApplyChanges(doc.Project.Solution); 1276workspace.TryApplyChanges(project.RemoveAnalyzerConfigDocument(doc.Id).Solution);
Microsoft.CodeAnalysis.CSharp.Features (31)
ChangeSignature\CSharpChangeSignatureService.cs (1)
863convertedType = await SymbolFinder.FindSourceDefinitionAsync(convertedType, document.Project.Solution, cancellationToken).ConfigureAwait(false)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
42if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
69var solution = project.Solution;
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
44if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (2)
41if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles 67document.Project.Solution, allDocumentIds, containerSpan, cancellationToken).ConfigureAwait(false);
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (2)
35if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles) 127var editor = new SyntaxEditor(root, document.Project.Solution.Services);
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (1)
50if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
Completion\CompletionProviders\SnippetCompletionProvider.cs (3)
65var solution = document.Project.Solution; 126completionContext, document.Project.Solution.Services, semanticModel, isPreProcessorContext: true); 142completionContext, document.Project.Solution.Services, semanticModel, isPreProcessorContext: false);
ConvertToRecordEngine.cs (1)
113var solutionEditor = new SolutionEditor(document.Project.Solution);
CSharpInlineDeclarationCodeFixProvider.cs (1)
118var editor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
67var editor = new SyntaxEditor(root, document.Project.Solution.Services);
CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
47return project.Solution.WithProjectCompilationOptions(project.Id, compilationOptions.WithAllowUnsafe(true));
CSharpUpgradeProjectCodeFixProvider.cs (2)
98return project.Solution.WithProjectParseOptions(project.Id, parseOptions.WithLanguageVersion(parsedNewVersion)); 103return project.Solution;
CSharpUseDeconstructionCodeFixProvider.cs (1)
68var editor = new SyntaxEditor(root, document.Project.Solution.Services);
CSharpUseLocalFunctionCodeFixProvider.cs (1)
117document.Project.Solution.Services, currentRoot,
EmbeddedStatementPlacementCodeFixProvider.cs (1)
51var editor = new SyntaxEditor(root, document.Project.Solution.Services);
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
111document.Project.Solution,
Formatting\CSharpAccessibilityModifiersNewDocumentFormattingProvider.cs (1)
42var editor = new SyntaxEditor(root, document.Project.Solution.Services);
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (1)
211var solution = project.Solution;
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
49var solution = project.Solution;
MakeLocalFunctionStaticCodeFixHelper.cs (3)
36var syntaxEditor = new SyntaxEditor(root, document.Project.Solution.Services); 56localFunctionSymbol, document.Project.Solution, documentImmutableSet, cancellationToken).ConfigureAwait(false); 128capture, document.Project.Solution, documentImmutableSet, cancellationToken).ConfigureAwait(false);
NavigationBar\CSharpNavigationBarItemService.cs (1)
54return GetMembersInTypes(document.Project.Solution, tree, typesInFile, cancellationToken);
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (1)
141var hostAnalyzers = document.Project.Solution.State.Analyzers;
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
270var editor = new SyntaxEditor(root, document.Project.Solution.Services);
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
CSharpCodeGenerationService.cs (1)
77var newContext = context with { Solution = newDocument.Project.Solution };
CSharpRemoveUnnecessaryImportsService.cs (1)
78var provider = document.Project.Solution.Services;
CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
43var editor = new SyntaxEditor(memberDeclaration, document.Project.Solution.Services);
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (3)
CodeGeneration\SymbolEditorTests.cs (1)
45return ws.AddProject(proj).Solution;
Formatting\FormattingTreeEditTests.cs (2)
46var result1 = Formatter.Format(root1, document.Project.Solution.Services, options, CancellationToken.None); 59var result2 = Formatter.Format(root2, document.Project.Solution.Services, options, CancellationToken.None);
Microsoft.CodeAnalysis.EditorFeatures (73)
AddImports\AbstractAddImportsPasteCommandHandler.cs (3)
145var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 177document.Project.Solution.Workspace.TryApplyChanges(updatedDocument.Project.Solution);
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (1)
101HandleResult(result, document.Project.Solution, workspace, context);
Classification\Semantic\AbstractSemanticOrEmbeddedClassificationViewTaggerProvider.cs (1)
114var workspaceContextService = document.Project.Solution.Services.GetRequiredService<IWorkspaceContextService>();
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (2)
328return new(classificationService.ComputeSyntacticChangeRange(currentDocument.Project.Solution.Services, previousRoot, currentRoot, _diffTimeout, cancellationToken)); 430classificationService.AddSyntacticClassifications(document.Project.Solution.Services, root, span.Span.ToTextSpan(), tempList, cancellationToken);
CodeDefinitionWindow\DefinitionContextTracker.cs (1)
201var definitionItem = symbol.ToNonClassifiedDefinitionItem(document.Project.Solution, includeHiddenLocations: false);
CommentSelection\AbstractCommentSelectionBase.cs (1)
157var formattedChanges = Formatter.GetFormattedTextChanges(newRoot, formattingSpans, document.Project.Solution.Services, formattingOptions, rules: null, cancellationToken);
Diagnostics\AbstractPushOrPullDiagnosticsTaggerProvider.PushDiagnosticsTaggerProvider.cs (1)
130var workspace = document.Project.Solution.Workspace;
Diagnostics\AbstractPushOrPullDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs (1)
101var workspace = project.Solution.Workspace;
EditAndContinue\ActiveStatementTaggerProvider.cs (1)
79var activeStatementTrackingService = document.Project.Solution.Services.GetService<IActiveStatementTrackingService>();
EditAndContinue\ActiveStatementTrackingService.cs (2)
169var compileTimeSolution = _compileTimeSolutionProvider.GetCompileTimeSolution(designTimeDocument.Project.Solution); 350var solution = document.Project.Solution;
EditAndContinue\EditAndContinueDiagnosticAnalyzer.cs (2)
56var workspace = designTimeDocument.Project.Solution.Workspace; 69var designTimeSolution = designTimeDocument.Project.Solution;
EditAndContinue\PdbMatchingSourceTextProvider.cs (1)
86var oldSolutionVersion = oldDocument.Project.Solution.WorkspaceVersion;
EncapsulateField\AbstractEncapsulateFieldCommandHandler.cs (2)
78var workspace = initialDocument.Project.Solution.Workspace; 118var solution = document.Project.Solution;
Extensibility\NavigationBar\AbstractEditorNavigationBarItemService.cs (1)
48var workspace = document.Project.Solution.Workspace;
ExternalAccess\IntelliCode\IntentProcessor.cs (2)
108newSolution = await newSolution.WithMergedLinkedFileChangesAsync(originalDocument.Project.Solution, cancellationToken: cancellationToken).ConfigureAwait(false); 114var docChanges = await GetTextChangesForDocumentAsync(newSolution, currentDocument.Project.Solution, changedDocumentId, cancellationToken).ConfigureAwait(false);
ExternalAccess\VSTypeScript\VSTypeScriptGoToSymbolService.cs (1)
40document.Project.Solution.Workspace, cancellationToken).ConfigureAwait(false);
ExternalAccess\VSTypeScript\VSTypeScriptNavigationBarItemService.cs (1)
65var workspace = document.Project.Solution.Workspace;
ExtractInterface\AbstractExtractInterfaceCommandHandler.cs (1)
85if (!document.Project.Solution.Workspace.TryApplyChanges(result.UpdatedSolution))
ExtractMethod\ExtractMethodCommandHandler.cs (3)
127var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 161var notificationService = document.Project.Solution.Services.GetService<INotificationService>(); 239var solution = project.Solution;
Formatting\FormatCommandHandler.cs (1)
80var ruleFactory = document.Project.Solution.Services.GetRequiredService<IHostDependentFormattingRuleFactoryService>();
Formatting\FormatCommandHandler.Paste.cs (1)
70var solution = document.Project.Solution;
GoToDefinition\AbstractGoToCommandHandler`2.cs (2)
194document.Project.Solution.Workspace, 262var service = document.Project.Solution.Services.GetRequiredService<IWorkspaceStatusService>();
GoToDefinition\AbstractGoToDefinitionService.cs (3)
38var solution = document.Project.Solution; 81project.Solution, 98var solution = project.Solution;
GoToDefinition\GoToDefinitionCommandHandler.cs (2)
160var notificationService = document.Project.Solution.Services.GetRequiredService<INotificationService>(); 170var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (3)
140var solution = this.Document.Project.Solution; 162this.Document.Project.Solution.CanApplyChange(ApplyChangesKind.ChangeDocumentInfo)) 172var symbolSourceDocument = this.Document.Project.Solution.GetDocument(RenameSymbol.Locations.Single().SourceTree);
InlineRename\InlineRenameService.cs (2)
121document.Project.Solution.Workspace, 141var workspace = document.Project.Solution.Workspace;
InlineRename\InlineRenameSession.cs (2)
183_baseSolution = _triggerDocument.Project.Solution; 835_triggerDocument.Project.Solution);
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (2)
573var textDiffService = oldDocument.Project.Solution.Services.GetService<IDocumentTextDifferencingService>(); 591var textDiffService = preMergeDocument.Project.Solution.Services.GetService<IDocumentTextDifferencingService>();
IntelliSense\AsyncCompletion\CompletionSource.cs (3)
187document.Project, document.Project.Services, sourceText, triggerLocation.Position, roslynTrigger, options, document.Project.Solution.Options, _roles); 453document, triggerLocation, options, document.Project.Solution.Options, roslynTrigger, _roles, cancellationToken).ConfigureAwait(false); 589var supportedPlatforms = SymbolCompletionItem.GetSupportedPlatforms(roslynItem, document.Project.Solution);
IntelliSense\Helpers.cs (2)
148var target = new QuickInfoHyperLink(document.Project.Solution.Workspace, absoluteUri); 159var workspace = document.Project.Solution.Workspace;
Intents\DeleteParameterIntentProvider.cs (1)
71var changedDocuments = changeSignatureResult.UpdatedSolution.GetChangedDocuments(priorDocument.Project.Solution).ToImmutableArray();
Interactive\InteractiveSession.cs (2)
234solution = initProject.Solution.AddDocument( 241solution = newSubmissionProject.Solution.AddDocument(
NavigateTo\NavigateToHelpers.cs (1)
38var workspace = document.Project.Solution.Workspace;
NavigationBar\NavigationBarController.cs (1)
224workspace: d.Project.Solution.Workspace,
Preview\AbstractPreviewFactoryService.cs (6)
290var rightWorkspace = new PreviewWorkspace(document.Project.Solution); 372var leftWorkspace = new PreviewWorkspace(document.Project.Solution); 480var leftWorkspace = new PreviewWorkspace(oldDocument.Project.Solution); 483var rightWorkspace = new PreviewWorkspace(newDocument.Project.Solution); 537var leftWorkspace = new PreviewWorkspace(oldDocument.Project.Solution); 540var rightWorkspace = new PreviewWorkspace(newDocument.Project.Solution);
ReferenceHighlighting\ReferenceHighlightingViewTaggerProvider.cs (1)
149var solution = document.Project.Solution;
RenameTracking\RenameTrackingCancellationCommandHandler.cs (1)
43RenameTrackingDismisser.DismissVisibleRenameTracking(document.Project.Solution.Workspace, document.Id);
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs (1)
93_document.Project.Solution.Services.GetService<INotificationService>()
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (2)
127var workspace = document.Project.Solution.Workspace; 196var solution = document.Project.Solution;
RenameTracking\RenameTrackingTaggerProvider.StateMachine.cs (1)
244document.Project.Solution.Workspace,
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (2)
215var sourceSymbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, document.Project.Solution, _cancellationToken).ConfigureAwait(false) ?? symbol; 229var sourceSymbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, document.Project.Solution, _cancellationToken).ConfigureAwait(false) ?? symbol;
Shared\Extensions\ITextSnapshotExtensions.cs (1)
78var service = document.Project.Solution.Services.GetService<IWorkspaceStatusService>();
SpellCheck\RoslynSpellCheckFixerProvider.cs (1)
114var workspace = document.Project.Solution.Workspace;
Structure\AbstractStructureTaggerProvider.cs (1)
86if (openDocument.Project.Solution.Workspace is MetadataAsSourceWorkspace masWorkspace &&
Microsoft.CodeAnalysis.EditorFeatures.Cocoa (14)
AsyncSuggestedActionsSource.cs (2)
104using var _1 = RemoteKeepAliveSession.Create(document.Project.Solution, _listener); 176var workspace = document.Project.Solution.Workspace;
Controller.cs (1)
134_providers = document.Project.Solution.Services.SelectMatchingExtensionValues(
FixAllGetFixesService.cs (2)
115var workspace = fixAllState.Project.Solution.Workspace; 132fixAllState.Project.Solution,
NavigableSymbolService.NavigableSymbolSource.cs (1)
57var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
NavigationCommandHandlers\FindBaseSymbolsCommandHandler.cs (1)
90var definitionItem = overriddenSymbol.ToNonClassifiedDefinitionItem(document.Project.Solution, includeHiddenLocations: true);
NavigationCommandHandlers\FindDerivedSymbolsCommandHandler.cs (2)
104document.Project.Solution, cancellationToken).ConfigureAwait(false); 108var definitionItem = candidate.ToNonClassifiedDefinitionItem(document.Project.Solution, includeHiddenLocations: true);
NavigationCommandHandlers\FindExtensionMethodsCommandHandler.cs (1)
69var solution = document.Project.Solution;
NavigationCommandHandlers\FindImplementingMembersCommandHandler.cs (1)
149var definitionItem = impl.ToNonClassifiedDefinitionItem(project.Solution, includeHiddenLocations: true);
NavigationCommandHandlers\FindMemberOverloadsCommandHandler.cs (1)
86var definitionItem = curSymbol.ToNonClassifiedDefinitionItem(document.Project.Solution, includeHiddenLocations: true);
NavigationCommandHandlers\FindReferencesOfOverloadsCommandHandler.cs (1)
125var symbolsToAdd = await GatherSymbolsAsync(sym, document.Project.Solution, cancellationToken).ConfigureAwait(false);
SuggestedActionsSource.cs (1)
165var workspace = document.Project.Solution.Workspace;
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (2)
ChangeSignature\ChangeSignatureTestState.cs (1)
75return (TestChangeSignatureOptionsService)InvocationDocument.Project.Solution.Services.GetRequiredService<IChangeSignatureOptionsService>();
Diagnostics\AbstractSuppressionAllCodeTests.cs (1)
111document.Project.Solution, new ProgressTracker(), CancellationToken.None).GetAwaiter().GetResult();
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (10)
Completion\AbstractCompletionProviderTests.cs (3)
510document.Project.Solution.Workspace.TryApplyChanges(newDoc.Project.Solution); 1060var isTextualTriggerCharacterResult = service.ShouldTriggerCompletion(document.Project, document.Project.Services, text, position + 1, trigger, options, document.Project.Solution.Options, GetRoles(document));
Diagnostics\GenerateType\GenerateTypeTestState.cs (2)
69return (TestGenerateTypeOptionsService)InvocationDocument.Project.Solution.Services.GetRequiredService<IGenerateTypeOptionsService>(); 77return (TestProjectManagementService)InvocationDocument.Project.Solution.Services.GetService<IProjectManagementService>();
Diagnostics\GenerateType\TestGenerateTypeOptionsService.cs (1)
55DefaultNamespace ??= projectManagementService.GetDefaultNamespace(Project, Project?.Solution.Workspace);
Diagnostics\TestDiagnosticAnalyzerDriver.cs (2)
62var dxs = await _diagnosticAnalyzerService.GetDiagnosticsAsync(project.Solution, project.Id, document.Id, _includeSuppressedDiagnostics); 73var dxs = await _diagnosticAnalyzerService.GetDiagnosticsAsync(project.Solution, project.Id, includeSuppressedDiagnostics: _includeSuppressedDiagnostics);
EditAndContinue\EditAndContinueTestHelpers.cs (1)
405var newSolution = oldProject.Solution;
ExtractInterface\ExtractInterfaceTestState.cs (1)
75return (TestExtractInterfaceOptionsService)ExtractFromDocument.Project.Solution.Services.GetService<IExtractInterfaceOptionsService>();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (78)
CodeFixes\CodeFixServiceTests.cs (3)
373extensionManager = (EditorLayerExtensionManager.ExtensionManager)document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 824var solution = await codeAction.GetChangedSolutionInternalAsync(txtDocument.Project.Solution); 882return document.Project.Solution.WithAdditionalDocumentText(document.Id, newText);
CodeRefactorings\CodeRefactoringServiceTest.cs (5)
117var extensionManager = (EditorLayerExtensionManager.ExtensionManager)document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 189var solution = await codeAction.GetChangedSolutionInternalAsync(project.Solution); 228var solution = await codeAction.GetChangedSolutionInternalAsync(project.Solution); 257return document.Project.Solution.WithAdditionalDocumentText(document.Id, newText); 258return document.Project.Solution.WithAnalyzerConfigDocumentText(document.Id, newText);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (5)
198var applied = workspace.TryApplyChanges(document.Project.Solution); 401ImmutableArray.Create(DiagnosticData.Create(document.Project.Solution, Diagnostic.Create(NoNameAnalyzer.s_syntaxRule, location, properties), document.Project))), 616var incrementalAnalyzer = (DiagnosticIncrementalAnalyzer)service.CreateIncrementalAnalyzer(project.Solution.Workspace); 652var applied = workspace.TryApplyChanges(project.Solution); 1152Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(new TestGeneratorReference(generator)).Solution));
Diagnostics\DiagnosticDataTests.cs (3)
231secondDocument = firstDocument.Project.Solution.AddProject("TestProject2", "TestProject2", LanguageNames.CSharp) 239firstDocument = secondDocument.Project.Solution.GetRequiredDocument(firstDocument.Id); 263firstDocument = firstDocument.Project.Solution
Diagnostics\DiagnosticsSquiggleTaggerProviderTests.cs (1)
68workspace.TryApplyChanges(document.WithText(text.WithChanges(new TextChange(new TextSpan(text.Length - 1, 1), string.Empty))).Project.Solution);
EditAndContinue\ActiveStatementsMapTests.cs (3)
92.AddDocument("doc", SourceText.From(source, Encoding.UTF8), filePath: "a.cs").Project.Solution; 147.AddDocument("doc", SourceText.From(source, Encoding.UTF8), filePath: "a.cs").Project.Solution; 198.AddDocument("doc", SourceText.From(source, Encoding.UTF8), filePath: "a.cs").Project.Solution;
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (37)
128solution = project.Solution; 158solution = document.Project.Solution; 161return document.Project.Solution; 573solution = projectQ.Solution; 683solution = document.Project.Solution; 985solution = project.Solution; 1038solution = project.Solution; 1096solution = documentA.Project.Solution; 1112solution = documentB.Project.Solution; 1181solution = project.Solution; 1192solution = document0.Project.Solution; 1570solution = project.Solution; 1580solution = document1.Project.Solution; 1680solution = project.Solution; 1724solution = project.Solution; 1866AddDocument("A.cs", "class Program { void Main() { System.Console.WriteLine(1); } }", filePath: pathA).Project.Solution. 1869AddDocument("B.cs", "class B {}", filePath: pathB).Project.Solution. 1872AddDocument("C.cs", "class C {}", filePath: pathC).Project.Solution; 1898solution = projectD.Solution; 1953solution = project.Solution.AddAnalyzerReference(projectId, new TestGeneratorReference(generator)); 2120solution = documentB2.Project.Solution; 2140await debuggingSession.GetCurrentActiveStatementPositionAsync(documentB2.Project.Solution, (_, _, _) => new(trackedActiveSpans), activeStatements[1].ActiveInstruction, CancellationToken.None)); 2434solution = document1.Project.Solution; 2524solution = project.Solution; 2588solution = project.Solution; 2614solution = document1.Project.Solution; 2652solution = project.Solution; 3253solution = document1.Project.Solution.RemoveDocument(document1.Id); 3346solution = projectB.Solution; 3601await debuggingSession.GetCurrentActiveStatementPositionAsync(document1.Project.Solution, (_, _, _) => new(trackedActiveSpans1), activeInstruction1, CancellationToken.None)); 3604await debuggingSession.GetCurrentActiveStatementPositionAsync(document1.Project.Solution, (_, _, _) => new(trackedActiveSpans1), activeInstruction2, CancellationToken.None)); 3722var document = project.Solution.AddDocument(documentInfo).GetDocument(documentInfo.Id); 3724solution = document.Project.Solution; 3791solution = p.Solution.AddDocument(linkedDocId, doc.Name, text, filePath: doc.FilePath); 4474solution = projectP.Solution; 4561solution = projectP.Solution; 4628solution = projectP.Solution;
EditAndContinue\EditSessionActiveStatementsTests.cs (2)
76solution = project.Solution; 180solution = dummyProject.Solution.AddDocument(DocumentId.CreateNewId(dummyProject.Id, NoCompilationConstants.LanguageName), "a.dummy", "");
EditAndContinue\EmitSolutionUpdateResultsTests.cs (1)
36var solution = document.Project.Solution;
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (2)
83var linkedDocument = document.Project.Solution.Projects.Single(p => p != document.Project).Documents.Single(); 85var newSolution = document.Project.Solution
Preview\PreviewWorkspaceTests.cs (9)
65Assert.True(previewWorkspace.TryApplyChanges(project.Solution)); 79Assert.True(previewWorkspace.TryApplyChanges(project.Solution)); 83.AddDocument("document", "").Project.Solution; 89var changedSolution = previewWorkspace.CurrentSolution.Projects.First().Documents.First().WithText(SourceText.From(text)).Project.Solution; 95.RemoveDocument(previewWorkspace.CurrentSolution.Projects.First().DocumentIds[0]).Solution; 112Assert.True(previewWorkspace.TryApplyChanges(document.Project.Solution)); 197incrementalAnalyzer.CreateIncrementalAnalyzer(leftDocument.Project.Solution.Workspace); 198incrementalAnalyzer.CreateIncrementalAnalyzer(rightDocument.Project.Solution.Workspace); 234Assert.True(previewWorkspace.TryApplyChanges(project.Solution));
SolutionCrawler\WorkCoordinatorTests.cs (5)
198var changedSolution = solution.AddProject("P3", "P3", LanguageNames.CSharp).AddDocument("D1", "").Project.Solution; 293var worker = await ExecuteOperation(workspace, w => w.ChangeProject(project.Id, project.Solution)); 321var worker = await ExecuteOperation(workspace, w => w.ChangeProject(project.Id, project.Solution)); 349var worker = await ExecuteOperation(workspace, w => w.ChangeProject(project.Id, project.Solution)); 1673var documentTrackingService = (TestDocumentTrackingService)document.Project.Solution.Services.GetRequiredService<IDocumentTrackingService>();
TextEditor\OpenDocumentTests.cs (2)
63Assert.Same(workspace.CurrentSolution, newDocumentWithChanges.Project.Solution); 69Assert.NotSame(workspace.CurrentSolution, originalDocumentWithChanges.Project.Solution);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (14)
NavigableSymbols\NavigableSymbolService.NavigableSymbolSource.cs (1)
57var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
NavigateTo\NavigateToItemDisplay.cs (2)
117var workspace = document.Project.Solution.Workspace; 131var workspace = document.Project.Solution.Workspace;
Peek\PeekableItemFactory.cs (1)
62var solution = project.Solution;
Peek\PeekableItemSource.cs (2)
76var services = document.Project.Solution.Services; 130var workspace = project.Solution.Workspace;
QuickInfo\ContentControlService.cs (1)
71var workspace = new PreviewWorkspace(document.Project.Solution);
QuickInfo\Extensions.cs (1)
39var cloneServices = document.Project.Solution.Services.ExportProvider.GetExports<ITextBufferCloneService>();
SignatureHelp\Controller.cs (1)
134_providers = document.Project.Solution.Services.SelectMatchingExtensionValues(
Suggestions\AsyncSuggestedActionsSource.cs (2)
104using var _1 = RemoteKeepAliveSession.Create(document.Project.Solution, _listener); 176var workspace = document.Project.Solution.Workspace;
Suggestions\FixAll\FixAllGetFixesService.cs (2)
115var workspace = fixAllState.Project.Solution.Workspace; 132fixAllState.Project.Solution,
Suggestions\SuggestedActionsSource.cs (1)
165var workspace = document.Project.Solution.Workspace;
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (24)
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
122Dim newSln = appConfigDoc.Project.Solution.WithAdditionalDocumentText(appConfigDoc.Id, SourceText.From("true", text.Encoding))
Diagnostics\DiagnosticServiceTests.vb (10)
334solution = p1.Solution 338solution = p2.Solution 537diagnostics = Await diagnosticService.GetDiagnosticsAsync(project.Solution).ConfigureAwait(False) 637Dim diagnostics = Await diagnosticService.GetDiagnosticsAsync(project.Solution, project.Id) 837Dim projectDiagnostics = Await diagnosticService.GetDiagnosticsForIdsAsync(project.Solution, project.Id) 980Dim diagnostics = (Await diagnosticService.GetDiagnosticsAsync(project.Solution, project.Id)). 1075Dim diagnostics = Await diagnosticService.GetDiagnosticsAsync(project.Solution, project.Id) 1460Dim descriptorsMap = project.Solution.State.Analyzers.GetDiagnosticDescriptorsPerReference(diagnosticService.AnalyzerInfoCache, project) 2186Dim hiddenDiagnostics = Await diagnosticService.GetDiagnosticsAsync(project.Solution, project.Id) 2273Dim diagnostics = Await diagnosticService.GetDiagnosticsAsync(project.Solution, project.Id)
FindReferences\FindReferencesTests.LinkedFiles.vb (10)
39Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 71Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 114Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 128references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 224Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 264Dim references = (Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing)).ToList() 306Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 349Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 392Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing) 435Dim references = Await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, progress:=Nothing, documents:=Nothing)
FindReferences\FindReferencesTests.vb (3)
298symbol, project.Solution, 309Function(g) GetFilePathAndProjectLabel(document.Project.Solution, g.Key), 421Function(g) GetFilePathAndProjectLabel(document.Project.Solution, g.Key),
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Internal\Editor\FSharpNavigationBarItemService.cs (1)
69var workspace = document.Project.Solution.Workspace;
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (2)
Completion\OmniSharpCompletionService.cs (2)
25return completionService.ShouldTriggerCompletion(document.Project, document.Project.Services, text, caretPosition, trigger, options.ToCompletionOptions(), document.Project.Solution.Options, roles); 37return completionService.GetCompletionsAsync(document, caretPosition, options.ToCompletionOptions(), document.Project.Solution.Options, trigger, roles, cancellationToken);
Microsoft.CodeAnalysis.ExternalAccess.Razor (2)
RazorClassifierAccessor.cs (1)
20document.Project.Solution.Services, document.Project, semanticModel, textSpan, options.UnderlyingObject, cancellationToken);
RazorSpanMappingServiceWrapper.cs (1)
36var diffService = newDocument.Project.Solution.Services.GetRequiredService<IDocumentTextDifferencingService>();
Microsoft.CodeAnalysis.Features (350)
AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (3)
27var service = context.Document.Project.Solution.Services.GetRequiredService<ISupportedChangesService>(); 67var newSolution = await renameActionSet.UpdateSolutionAsync(documentWithInvalidFolders.Project.Solution, cancellationToken).ConfigureAwait(false); 68Debug.Assert(newSolution != document.Project.Solution);
AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
47fixAllContext.Project.Solution,
AbstractConvertToAsyncCodeFixProvider.cs (1)
72var otherDocument = document.Project.Solution.GetDocument(syntaxTree);
AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
164var solution = document.Project.Solution; 198return newDocument.Project.Solution;
AbstractMakeMethodSynchronousCodeFixProvider.cs (5)
77var solution = document.Project.Solution; 110var newSolution = newDocument.Project.Solution; 138ImmutableArray.Create<ISymbol>(methodSymbol), document.Project.Solution, cancellationToken).ConfigureAwait(false); 146document.Project.Solution, referencedSymbol.Locations.ToImmutableArray(), cancellationToken).ConfigureAwait(false); 151return document.Project.Solution;
AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
67var solutionServices = document.Project.Solution.Services;
AbstractRemoveUnusedValuesCodeFixProvider.cs (3)
292var editor = new SyntaxEditor(root, document.Project.Solution.Services); 842var provider = document.Project.Solution.Services; 914var referencedSymbols = await SymbolFinder.FindReferencesAsync(local, document.Project.Solution, cancellationToken).ConfigureAwait(false);
AbstractUnsealClassCodeFixProvider.cs (3)
43type, document.Project.Solution, cancellationToken).ConfigureAwait(false); 50c => UnsealDeclarationsAsync(document.Project.Solution, definition.DeclaringSyntaxReferences, c), 66var editor = new SyntaxEditor(root, document.Project.Solution.Services);
AbstractUpgradeProjectCodeFixProvider.cs (1)
44var solution = project.Solution;
AbstractUseCollectionInitializerCodeFixProvider.cs (1)
99var subEditor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
AbstractUseConditionalExpressionCodeFixProvider.cs (2)
62var nestedEditor = new SyntaxEditor(root, document.Project.Solution.Services); 80var provider = document.Project.Solution.Services;
AbstractUseObjectInitializerCodeFixProvider.cs (1)
100var subEditor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (2)
55var services = _document.Project.Solution.Services; 74return Task.FromResult<Solution?>(constructorDocument.WithSyntaxRoot(newRoot).Project.Solution);
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (2)
42if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles) 184priorDocument.Project.Solution, postProcessChanges: true, cancellationToken).ConfigureAwait(false);
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
118var editor = new SyntaxEditor(syntaxRoot, document.Project.Solution.Services);
AddImport\AbstractAddImportCodeFixProvider.cs (1)
57var services = document.Project.Solution.Services;
AddImport\AbstractAddImportFeatureService.cs (7)
66document.Project.Solution, 128var projectToAssembly = new ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol>>(concurrencyLevel: 2, capacity: project.Solution.ProjectIds.Count); 129var referenceToCompilation = new ConcurrentDictionary<PortableExecutableReference, Compilation>(concurrencyLevel: 2, capacity: project.Solution.Projects.Sum(p => p.MetadataReferences.Count)); 157=> project.Solution.WorkspaceKind is WorkspaceKind.Host or WorkspaceKind.RemoteWorkspace; 295var solution = project.Solution; 427var solution = project.Solution; 517document.Project.Solution,
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (2)
45var operation = new ApplyChangesOperation(newProject.Solution); 107return new ApplyChangesOperation(newProject.Solution);
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (2)
61this.OriginalDocument.Project.Solution, cancellationToken).ConfigureAwait(false)); 77return updatedDocument.Project.Solution;
AddImport\CodeActions\MetadataSymbolReferenceCodeAction.cs (2)
30var projectWithReference = project.Solution.GetRequiredProject(FixData.PortableExecutableReferenceProjectId); 35return Task.FromResult<CodeActionOperation?>(new ApplyChangesOperation(project.AddMetadataReference(reference).Solution));
AddImport\CodeActions\ProjectSymbolReferenceCodeAction.cs (1)
47var applyOperation = new ApplyChangesOperation(projectWithAddedReference.Solution);
AddImport\CodeActions\SymbolReference.SymbolReferenceCodeAction.cs (1)
63return updatedProject ?? new ApplyChangesOperation(updatedDocument.Project.Solution);
AddImport\SearchScopes\MetadataSymbolsSearchScope.cs (1)
50var service = _assemblyProject.Solution.Services.GetService<ISymbolTreeInfoCacheService>();
AddImport\SearchScopes\SourceSymbolsProjectSearchScope.cs (1)
38var service = _project.Solution.Services.GetRequiredService<ISymbolTreeInfoCacheService>();
AddMissingReference\AddMissingReferenceCodeAction.cs (4)
41var dependencyGraph = project.Solution.GetProjectDependencyGraph(); 62var candidateProject = project.Solution.GetRequiredProject(candidateProjectId); 90new ApplyChangesOperation(_project.AddProjectReference(_projectReferenceToAdd).Solution))); 95var factoryService = _project.Solution.Services.GetRequiredService<IAddMetadataReferenceCodeActionOperationFactoryWorkspaceService>();
AddPackage\AbstractAddPackageCodeFixProvider.cs (1)
47var workspaceServices = document.Project.Solution.Services;
AddPackage\InstallPackageDirectlyCodeActionOperation.cs (1)
55_document.Project.Solution, packageName, versionOpt).ToList();
AddParameterService.cs (2)
83var solution = invocationDocument.Project.Solution; 151method, invocationDocument.Project.Solution, cancellationToken).ConfigureAwait(false);
ChangeSignature\AbstractChangeSignatureService.cs (3)
107symbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, document.Project.Solution, cancellationToken).ConfigureAwait(false) ?? symbol; 161var solution = document.Project.Solution; 409doc.Project.Solution.Services,
ChangeSignature\ChangeSignatureAnalyzedContext.cs (1)
31public Solution Solution => Document.Project.Solution;
CodeFixes\Configuration\ConfigurationUpdater.cs (9)
262return currentProject.Solution; 271return _project.Solution; 274var solution = editorConfigDocument.Project.Solution; 288var service = _project.Solution.Services.GetService<IAddSolutionItemService>(); 304if (_project.Solution?.FilePath == null) 314var currentSolution = _project.Solution; 315foreach (var projectId in _project.Solution.ProjectIds) 324currentSolution = addedAnalyzerConfigDocument.Project.Solution; 346var newSolution = project.Solution.AddAnalyzerConfigDocuments(ImmutableArray.Create(documentInfo));
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (1)
35new ApplyChangesOperation(changedSuppressionDocument.Project.Solution),
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageCodeAction.cs (1)
41var services = suppressionsDoc.Project.Solution.Services;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (5)
80var currentSolution = triggerDocument.Project.Solution; 95currentSolution = newDocument.Project.Solution; 110var currentSolution = triggerProject.Solution; 125currentSolution = newDocument.Project.Solution; 139var services = suppressionsDoc.Project.Solution.Services;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningCodeAction.cs (1)
87=> Formatter.Format(node, _document.Project.Solution.Services, _options, cancellationToken);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
116var oldSolution = fixAllState.Project.Solution;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (2)
65return _project.Solution; 70return editor.GetChangedDocument().Project.Solution;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (1)
221=> Formatter.Format(node, _document.Project.Solution.Services, _options, cancellationToken);
CodeFixesAndRefactorings\AbstractFixAllCodeAction.cs (2)
65var service = FixAllState.Project.Solution.Services.GetRequiredService<IFixAllGetFixesService>(); 79var service = FixAllState.Project.Solution.Services.GetRequiredService<IFixAllGetFixesService>();
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (5)
57var solution = document.Project.Solution; 92var solution = document.Project.Solution; 166var services = document.Project.Solution.Services; 216document.Project.Solution, progressTracker, cancellationToken).ConfigureAwait(false); 220newSolution = document.Project.Solution;
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsRefactoringProvider.cs (1)
64return modifiedDocument.Project.Solution;
CodeRefactorings\CodeRefactoringService.cs (3)
82if (document.Project.Solution.WorkspaceKind == WorkspaceKind.Interactive) 98var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 128var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>();
CodeRefactorings\ExtractMethod\AbstractExtractMethodCodeRefactoringProvider.cs (1)
43var solution = document.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (2)
65return document.Project.Solution; 78return modifiedSolution ?? document.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (3)
67var solutionWithNewDocument = documentWithMovedType.Project.Solution; 147var solutionWithNewDocument = projectToBeUpdated.Solution.AddDocument( 205return updatedDocument.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (1)
97return changedDocument.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.RenameFileEditor.cs (2)
28var modifiedSolution = SemanticDocument.Project.Solution 40var oldSolution = SemanticDocument.Document.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.RenameTypeEditor.cs (1)
30var solution = SemanticDocument.Document.Project.Solution;
CodeRefactorings\MoveType\MoveTypeCodeRefactoringProvider.cs (1)
25if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (7)
132var solution = document.Project.Solution; 193var solution = document.Project.Solution; 348var solution = document.Project.Solution; 471var solutionWithChangedNamespace = documentWithNewNamespace.Project.Solution; 555symbol, document.Project.Solution, progress, documents: null, 631var services = documentWithAddedImports.Project.Solution.Services; 785solution = document.Project.Solution;
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.cs (1)
26if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles ||
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
45var solution = _state.Document.Project.Solution;
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (1)
171var solution = document.Project.Solution;
Completion\CompletionOptions.cs (1)
69var solution = document.Project.Solution;
Completion\CompletionProvider.cs (1)
58=> ShouldTriggerCompletion(document.Project.Services, await document.GetTextAsync(cancellationToken).ConfigureAwait(false), caretPosition, trigger, options, document.Project.Solution.Options);
Completion\CompletionService.cs (1)
105var passThroughOptions = options ?? document?.Project.Solution.Options ?? OptionSet.Empty;
Completion\CompletionService.ProviderManager.cs (1)
98if (project is null || project.Solution.WorkspaceKind == WorkspaceKind.Interactive)
Completion\CompletionService_GetCompletions.cs (1)
45var passThroughOptions = options ?? document.Project.Solution.Options;
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (2)
137foreach (var project in context.Document.Project.Solution.Projects) 272var project = document.Project.Solution.GetRequiredProject(projectId);
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (2)
41var globalOptions = document.Project.Solution.Services.GetService<ILegacyGlobalCleanCodeGenerationOptionsWorkspaceService>(); 144document.Project.Solution,
Completion\Providers\AbstractPreprocessorCompletionProvider.cs (1)
23var solution = originatingDocument.Project.Solution;
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (2)
206var relatedDocumentIds = document.Project.Solution.GetRelatedDocumentIds(document.Id); 211var relatedDocument = document.Project.Solution.GetRequiredDocument(relatedId);
Completion\Providers\AbstractSymbolCompletionProvider.cs (2)
183supportedPlatformData = new SupportedPlatformData(completionContext.Document.Project.Solution, invalidProjects, totalProjects); 312var solution = document.Project.Solution;
Completion\Providers\CompletionUtilities.cs (2)
41if (solution is null || project.Solution.WorkspaceVersion > solution.WorkspaceVersion) 43solution = project.Solution;
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (2)
133var globalOptions = document.Project.Solution.Services.GetService<ILegacyGlobalCleanCodeGenerationOptionsWorkspaceService>(); 218var solution = document.Project.Solution;
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
76var solution = currentProject.Solution;
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (5)
67=> project.Solution.Services.GetRequiredService<IImportCompletionCacheService<ExtensionMethodImportCompletionCacheEntry, object>>(); 89await SymbolTreeInfo.GetInfoForMetadataReferenceAsync(project.Solution, peReference, checksum: null, cancellationToken).ConfigureAwait(false); 149var graph = project.Solution.GetProjectDependencyGraph(); 151return relevantProjectIds.Select(project.Solution.GetRequiredProject).Where(p => p.SupportsCompilation).ToImmutableArray(); 202_originatingDocument.Project.Solution, peReference, checksum: null, cancellationToken).ConfigureAwait(false);
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
140document.Project.Solution.Services,
Completion\Providers\SymbolCompletionItem.cs (6)
142var linkedDoc = document.Project.Solution.GetRequiredDocument(id); 193var supportedPlatforms = GetSupportedPlatforms(item, document.Project.Solution); 197var services = document.Project.Solution.Services; 208return document.Project.Solution.GetRequiredDocument(contextId); 358var supportedPlatforms = GetSupportedPlatforms(item, document.Project.Solution); 362return await CommonCompletionUtilities.CreateDescriptionAsync(document.Project.Solution.Services, semanticModel, position, symbols, options, supportedPlatforms, cancellationToken).ConfigureAwait(false);
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
84var editor = new SyntaxEditor(root, document.Project.Solution.Services);
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
419var services = document.Project.Solution.Services;
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
38if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (1)
151var editor = new SyntaxEditor(converter.ForEachInfo.SemanticModel.SyntaxTree.GetRoot(cancellationToken), document.Project.Solution.Services);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (6)
214var solution = document.Project.Solution; 251return document.WithSyntaxRoot(newRoot).Project.Solution; 430var solution = startingProject.Solution; 516var solution = startingDocument.Project.Solution; 578var currentSolution = startingDocument.Project.Solution; 599currentSolution = updatedDocument.Project.Solution;
Diagnostics\AbstractHostDiagnosticUpdateSource.cs (2)
135CreateId(analyzer, project), Workspace, project?.Solution, project?.Id, documentId: null, diagnostics: items.ToImmutableArray()); 141CreateId(analyzer, project), Workspace, project?.Solution, project?.Id, documentId: null);
DocumentHighlighting\AbstractDocumentHighlightsService.cs (4)
39var solution = document.Project.Solution; 71var solution = document.Project.Solution; 124symbol, document.Project.Solution, progress, 164var solution = startingDocument.Project.Solution;
DocumentSpanExtensions.cs (1)
16var solution = documentSpan.Document.Project.Solution;
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
2844var oldSyntaxDocument = oldProject.Solution.GetRequiredDocument(oldDeclaration.SyntaxTree);
EditAndContinue\DebuggingSession.cs (1)
785var newSolution = newProject.Solution;
EditAndContinue\EditSession.cs (4)
429var oldSourceGeneratedDocumentStates = await oldProject.Solution.State.GetSourceGeneratedDocumentStatesAsync(oldProject.State, cancellationToken).ConfigureAwait(false); 433var newSourceGeneratedDocumentStates = await newProject.Solution.State.GetSourceGeneratedDocumentStatesAsync(newProject.State, cancellationToken).ConfigureAwait(false); 493var oldSourceGeneratedDocumentStates = await oldProject.Solution.State.GetSourceGeneratedDocumentStatesAsync(oldProject.State, cancellationToken).ConfigureAwait(false); 497var newSourceGeneratedDocumentStates = await newProject.Solution.State.GetSourceGeneratedDocumentStatesAsync(newProject.State, cancellationToken).ConfigureAwait(false);
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (1)
274document.Project.Solution,
EditAndContinue\Remote\RemoteEditAndContinueServiceProxy.cs (2)
188diagnostic => RemapLocation(designTimeDocument, DiagnosticData.Create(document.Project.Solution, diagnostic, document.Project))); 195document.Project.Solution,
EncapsulateField\AbstractEncapsulateFieldService.cs (7)
112var solution = document.Project.Solution; 143var currentSolution = document.Project.Solution; 180var solution = document.Project.Solution; 219solution = document.Project.Solution; 226solution = updatedLinkedDocument.Project.Solution; 249document, document.Project.Solution, field, generatedProperty, fallbackOptions, cancellationToken).ConfigureAwait(false); 254return documentWithProperty.Project.Solution;
ExternalAccess\UnitTesting\API\UnitTestingSearchHelpers.cs (4)
32var client = await RemoteHostClient.TryGetClientAsync(project.Solution.Services, cancellationToken).ConfigureAwait(false); 43return await location.Value.Value.TryRehydrateAsync(project.Solution, cancellationToken).ConfigureAwait(false); 55var client = await RemoteHostClient.TryGetClientAsync(project.Solution.Services, cancellationToken).ConfigureAwait(false); 68result.AddIfNotNull(await location.TryRehydrateAsync(project.Solution, cancellationToken).ConfigureAwait(false));
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (2)
176var solution = thisDocument.Project.Solution; 223var solution = project.Solution;
ExtractClass\AbstractExtractClassRefactoringProvider.cs (1)
37var solution = context.Document.Project.Solution;
ExtractClass\ExtractClassWithDialogCodeAction.cs (4)
66var extractClassService = _service ?? _document.Project.Solution.Services.GetRequiredService<IExtractClassOptionsService>(); 84_document.Project.Solution, 127updatedDocument.Project.Solution, 266unformattedSolution = document.WithSyntaxRoot(currentRoot).Project.Solution;
ExtractInterface\AbstractExtractInterfaceService.cs (7)
143var solution = refactoringResult.DocumentToExtractFrom.Project.Solution; 201unformattedInterfaceDocument.Project.Solution, 242var unformattedSolution = documentWithInterface.Project.Solution; 275var notificationService = document.Project.Solution.Services.GetService<INotificationService>(); 279var service = document.Project.Solution.Services.GetService<IExtractInterfaceOptionsService>(); 317formattedSolution = simplifiedDocument.Project.Solution; 361unformattedSolution = document.WithSyntaxRoot(editor.GetChangedRoot()).Project.Solution;
ExtractMethod\ExtractMethodResult.cs (1)
98var services = DocumentWithoutFinalFormatting.Project.Solution.Services;
FindUsages\AbstractFindUsagesService_FindImplementations.cs (2)
43var solution = project.Solution; 75var solution = project.Solution;
FindUsages\AbstractFindUsagesService_FindReferences.cs (5)
35document.Project.Solution, definitionTrackingContext.GetDefinitions(), cancellationToken).ConfigureAwait(false); 135var solution = project.Solution; 166var progress = new FindReferencesProgressAdapter(project.Solution, context, options); 168symbol, project.Solution, progress, documents: null, options, cancellationToken); 222var solution = document.Project.Solution;
FindUsages\FindUsagesHelpers.cs (1)
43var mappingService = document.Project.Solution.Services.GetService<ISymbolMappingService>();
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (1)
153document.Project.Solution,
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.ConstructorDelegatingCodeAction.cs (2)
52var languageServices = project.Solution.Services.GetLanguageServices(_state.ContainingType.Language); 95_document.Project.Solution,
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.cs (3)
109priorDocument.Project.Solution, codeAction, cancellationToken).ConfigureAwait(false); 155if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles) 234var globalOptions = document.Project.Solution.Services.GetRequiredService<ILegacyGlobalOptionsWorkspaceService>();
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.FieldDelegatingCodeAction.cs (1)
81_document.Project.Solution,
GenerateConstructorFromMembers\AbstractGenerateConstructorFromMembersCodeRefactoringProvider.GenerateConstructorWithDialogCodeAction.cs (3)
60var service = _service._pickMembersService_forTesting ?? _document.Project.Solution.Services.GetRequiredService<IPickMembersService>(); 82var globalOptions = _document.Project.Solution.Services.GetRequiredService<ILegacyGlobalOptionsWorkspaceService>(); 99var solution = _document.Project.Solution;
GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.AbstractCodeAction.cs (1)
49_document.Project.Solution,
GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (1)
79var destinationProvider = semanticDocument.Project.Solution.Services.GetLanguageServices(ClassType.Language);
GenerateDefaultConstructors\GenerateDefaultConstructorsCodeRefactoringProvider.cs (1)
45if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (3)
58if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles) 262var globalOptions = document.Project.Solution.Services.GetRequiredService<ILegacyGlobalOptionsWorkspaceService>(); 277var globalOptions = document.Project.Solution.Services.GetRequiredService<ILegacyGlobalOptionsWorkspaceService>();
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndHashWithDialogCodeAction.cs (2)
59var service = _service._pickMembersService_forTestingPurposes ?? _document.Project.Solution.Services.GetRequiredService<IPickMembersService>(); 70var solution = _document.Project.Solution;
GenerateMember\GenerateConstructor\AbstractGenerateConstructorService.State.cs (8)
116if (!CodeGenerator.CanAdd(_document.Project.Solution, TypeToGenerateIn, cancellationToken)) 242var syntaxFacts = _document.Project.Solution.Services.GetRequiredLanguageService<ISyntaxFactsService>(TypeToGenerateIn.Language); 397var definition = await SymbolFinder.FindSourceDefinitionAsync(original, _document.Project.Solution, cancellationToken).ConfigureAwait(false); 582var provider = document.Project.Solution.Services.GetLanguageServices(TypeToGenerateIn.Language); 601document.Project.Solution, 617var provider = document.Project.Solution.Services.GetLanguageServices(TypeToGenerateIn.Language); 640var provider = document.Project.Solution.Services.GetLanguageServices(TypeToGenerateIn.Language); 650document.Project.Solution,
GenerateMember\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (2)
36var languageServices = _document.Project.Solution.Services.GetLanguageServices(_state.TypeToGenerateIn.Language); 46_document.Project.Solution,
GenerateMember\GenerateEnumMember\AbstractGenerateEnumMemberService.State.cs (2)
70var sourceType = await SymbolFinder.FindSourceDefinitionAsync(TypeToGenerateIn, document.Project.Solution, cancellationToken).ConfigureAwait(false) as INamedTypeSymbol; 75return CodeGenerator.CanAdd(document.Project.Solution, TypeToGenerateIn, cancellationToken);
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (3)
70var syntaxFactory = _document.Project.Solution.Services.GetLanguageServices(_state.TypeToGenerateIn.Language).GetService<SyntaxGenerator>(); 78_document.Project.Solution, 95_document.Project.Solution,
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
57var semanticFacts = document.Project.Solution.Services.GetLanguageServices(state.TypeToGenerateIn.Language).GetService<ISemanticFactsService>();
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (1)
125var languageServiceProvider = Document.Project.Solution.Services.GetLanguageServices(State.TypeToGenerateIn.Language);
GenerateMember\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (3)
60TypeToGenerateIn = await SymbolFinder.FindSourceDefinitionAsync(TypeToGenerateIn, document.Project.Solution, cancellationToken).ConfigureAwait(false) as INamedTypeSymbol; 71if (!CodeGenerator.CanAdd(document.Project.Solution, TypeToGenerateIn, cancellationToken)) 83var destinationProvider = document.Project.Solution.Services.GetLanguageServices(TypeToGenerateIn.Language);
GenerateMember\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
99var solution = _project.Solution; 137var solution = _project.Solution;
GenerateMember\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (2)
58_semanticDocument.Project.Solution, 114var syntaxFactory = _semanticDocument.Project.Solution.Services.GetLanguageServices(_state.TypeToGenerateIn.Language).GetService<SyntaxGenerator>();
GenerateMember\GenerateVariable\AbstractGenerateVariableService.cs (1)
58var canGenerateMember = CodeGenerator.CanAdd(document.Project.Solution, state.TypeToGenerateIn, cancellationToken);
GenerateMember\GenerateVariable\AbstractGenerateVariableService.State.cs (2)
159TypeToGenerateIn, _document.Project.Solution, cancellationToken).ConfigureAwait(false) as INamedTypeSymbol; 168return CanGenerateLocal() || CodeGenerator.CanAdd(_document.Project.Solution, TypeToGenerateIn, cancellationToken);
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (3)
51var services = _document.Project.Solution.Services; 84_document.Project.Solution, 95new ApplyChangesOperation(newDocument.Project.Solution),
GenerateType\AbstractGenerateTypeService.CodeAction.cs (3)
104var generateTypeOptionsService = _document.Project.Solution.Services.GetRequiredService<IGenerateTypeOptionsService>(); 105var notificationService = _document.Project.Solution.Services.GetService<INotificationService>(); 106var projectManagementService = _document.Project.Solution.Services.GetService<IProjectManagementService>();
GenerateType\AbstractGenerateTypeService.cs (2)
117if (document.Project.Solution.CanApplyChange(ApplyChangesKind.AddDocument)) 160semanticDocument.Document.GetLanguageService<ICodeGenerationService>().CanAddTo(decl, semanticDocument.Project.Solution, cancellationToken);
GenerateType\AbstractGenerateTypeService.Editor.cs (9)
74Contract.ThrowIfFalse(document.Project.Solution == generateTypeOptionsResult.Project.Solution); 278var newSolution = projectToBeUpdated.Solution.AddDocument(newDocumentId, documentName, string.Empty, folders, fullFilePath); 356var updatedSolution = projectToBeUpdated.Solution.AddDocument( 397var solution = _semanticDocument.Project.Solution; 407return new CodeActionOperation[] { new ApplyChangesOperation(codeGenResult.Project.Solution) }; 444var solution = _semanticDocument.Project.Solution; 561var solution = _semanticDocument.Project.Solution; 572return new CodeActionOperation[] { new ApplyChangesOperation(codeGenResult.Project.Solution) };
GenerateType\AbstractGenerateTypeService.State.cs (3)
300var symbol = await SymbolFinder.FindSourceDefinitionAsync(TypeToGenerateInOpt, document.Project.Solution, cancellationToken).ConfigureAwait(false); 310var documentToBeGeneratedIn = document.Project.Solution.GetDocument(sourceTreeToBeGeneratedIn); 332if (!CodeGenerator.CanAdd(document.Project.Solution, TypeToGenerateInOpt, cancellationToken))
GoToBase\AbstractGoToBaseService.cs (1)
45var solution = project.Solution;
GoToDefinition\AbstractFindDefinitionService.cs (2)
23symbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, project.Solution, cancellationToken).ConfigureAwait(false) ?? symbol; 27? NavigableItemFactory.GetItemsFromPreferredSourceLocations(project.Solution, symbol, displayTaggedParts: FindUsagesHelpers.GetDisplayParts(symbol), cancellationToken: cancellationToken)
GoToDefinition\AbstractGoToDefinitionSymbolService.cs (1)
26var services = document.Project.Solution.Services;
ImplementAbstractClass\ImplementAbstractClassData.cs (1)
63if (!CodeGenerator.CanAdd(document.Project.Solution, classType, cancellationToken))
ImplementInterface\AbstractImplementInterfaceService.CodeAction.cs (1)
210document.Project.Solution,
ImplementInterface\AbstractImplementInterfaceService.State.cs (1)
57if (!CodeGenerator.CanAdd(document.Project.Solution, classOrStructType, cancellationToken))
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
49var solution = document.Project.Solution;
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (3)
60var solution = project.Solution; 90var mappingService = document.Project.Solution.Services.GetRequiredService<ISymbolMappingService>(); 241var destinationDocument = document.Project.Solution.GetDocument(groupSyntaxTree);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
363var editor = new SyntaxEditor(root, document.Project.Solution.Services);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (3)
399var currentSolution = document.WithSyntaxRoot(trackedRoot).Project.Solution; 453var services = document.Project.Solution.Services; 504var currentSolution = document.Project.Solution;
InlineHints\AbstractInlineParameterNameHintsService.cs (1)
47var globalOptions = document.Project.Solution.Services.GetRequiredService<ILegacyGlobalOptionsWorkspaceService>();
InlineHints\AbstractInlineTypeHintsService.cs (1)
43var globalOptions = document.Project.Solution.Services.GetRequiredService<ILegacyGlobalOptionsWorkspaceService>();
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
337var solution = document.Project.Solution;
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (2)
61var calleeDocument = document.Project.Solution.GetRequiredDocument(calleeMethodNode.SyntaxTree); 304.FindReferencesAsync(symbol, document.Project.Solution, ImmutableHashSet<Document>.Empty.Add(document), cancellationToken)
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (2)
172var calleeDocument = document.Project.Solution.GetRequiredDocument(calleeMethodNode.SyntaxTree); 450.FindReferencesAsync(parameterSymbol, document.Project.Solution, ImmutableHashSet<Document>.Empty.Add(document), cancellationToken).ConfigureAwait(false);
InlineTemporary\AbstractInlineTemporaryCodeRefactoringProvider.cs (1)
38local, document.Project.Solution, options, cancellationToken).ConfigureAwait(false);
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (3)
49if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles) 235var modifiedSolution = originalDocument.Project.Solution; 261methodSymbol, document.Project.Solution, progress,
IntroduceVariable\IntroduceVariableCodeRefactoringProvider.cs (1)
31if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
InvertConditional\AbstractInvertConditionalCodeRefactoringProvider.cs (1)
49var editor = new SyntaxEditor(root, document.Project.Solution.Services);
MetadataAsSource\AbstractMetadataAsSourceService.cs (1)
44document.Project.Solution,
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (1)
38: sourceProject.Solution.Services.GetLanguageServices(LanguageName).GetRequiredService<ISyntaxTreeFactoryService>().GetDefaultParseOptionsWithLatestLanguageVersion();
MetadataAsSource\SymbolMappingServiceFactory.cs (1)
39if (document.Project.Solution.WorkspaceKind is not WorkspaceKind.MetadataAsSource)
MoveStaticMembers\AbstractMoveStaticMembersRefactoringProvider.cs (1)
26var service = document.Project.Solution.Services.GetService<IMoveStaticMembersOptionsService>();
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (6)
80var destinationDocId = _document.Project.Solution.GetDocumentIdsWithFilePath(moveOptions.FileName).Single(); 84sourceDoc.Project.Solution, 111sourceDoc.Project.Solution, 127var memberReferenceLocations = await FindMemberReferencesAsync(moveOptions.SelectedMembers, newDoc.Project.Solution, cancellationToken).ConfigureAwait(false); 129var solutionWithFixedReferences = await RefactorReferencesAsync(projectToLocations, newDoc.Project.Solution, newType, typeArgIndices, cancellationToken).ConfigureAwait(false); 185oldSolution = newTypeDoc.WithSyntaxRoot(newTypeRoot).Project.Solution;
MoveToNamespace\AbstractMoveToNamespaceService.cs (2)
227var originalSolution = document.Project.Solution; 289var solution = formattedDocument.Project.Solution;
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
44if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
NamingStyleCodeFixProvider.cs (2)
95document.Project.Solution, 110document.Project.Solution, symbol, new SymbolRenameOptions(), fixedName,
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (1)
64var solution = project.Solution;
NavigateTo\AbstractNavigateToSearchService.GeneratedDocumentSearch.cs (1)
25var solution = project.Solution;
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (1)
211var solution = document.Project.Solution;
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (2)
29var solution = document.Project.Solution; 65var solution = project.Solution;
NavigateTo\RoslynNavigateToItem.cs (1)
157var solution = firstProject.Solution;
PullMemberUp\AbstractPullMemberUpRefactoringProvider.cs (2)
37_service ??= document.Project.Solution.Services.GetService<IPullMemberUpOptionsService>(); 76document.Project.Solution,
PullMemberUp\MembersPuller.cs (2)
102var solution = document.Project.Solution; 281var solution = document.Project.Solution;
QuickInfo\CommonSemanticQuickInfoProvider.cs (3)
31var services = context.Document.Project.Solution.Services; 59var services = document.Project.Solution.Services; 81var solution = document.Project.Solution;
RemoveUnusedVariable\AbstractRemoveUnusedVariableCodeFixProvider.cs (1)
89var referencedSymbols = await SymbolFinder.FindReferencesAsync(symbol, document.Project.Solution, documentsToBeSearched, cancellationToken).ConfigureAwait(false);
Rename\SymbolicRenameInfo.cs (2)
175semanticModel, triggerToken.SpanStart, document.Project.Solution.Services, cancellationToken: cancellationToken).ConfigureAwait(false); 221var solution = document.Project.Solution;
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (2)
170var originalSolution = project.Solution; 224var editor = new SyntaxEditor(root, originalDocument.Project.Solution.Services);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
89var originalSolution = document.Project.Solution; 228var editor = new SyntaxEditor(root, originalDocument.Project.Solution.Services);
Shared\Extensions\DocumentExtensions.cs (2)
71values = await getItemsWorker(document.Project.Solution.GetRequiredDocument(linkedDocumentId)).ConfigureAwait(false); 88var solution = document.Project.Solution;
Shared\Utilities\AnnotatedSymbolMapping.cs (1)
109annotatedSolution = document.WithSyntaxRoot(root.Value).Project.Solution;
Shared\Utilities\ExtractTypeHelpers.cs (2)
86newDocument.Project.Solution, 129return Formatter.Format(syntaxGenerator.SyntaxGeneratorInternal.TypeParameterList(typeParameterNames), document.Project.Solution.Services, formattingOptions, cancellationToken).ToString();
SignatureHelp\AbstractSignatureHelpProvider.cs (1)
292var platformData = new SupportedPlatformData(document.Project.Solution, invalidProjectsForCurrentSymbol, totalProjects);
SolutionCrawler\WorkCoordinator.SemanticChangeProcessor.cs (2)
175var solution = thisDocument.Project.Solution; 222var solution = project.Solution;
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
128var passThroughOptions = document.Project.Solution.Options;
SymbolMapping\SymbolMappingResult.cs (1)
23public Solution Solution => Project.Solution;
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
39var solution = projects[0].Solution;
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (3)
75var solution = context.Document.Project.Solution; 209var editor = new SyntaxEditor(declaratorTreeRoot, fieldDocument.Project.Solution.Services); 288return Formatter.Format(newRoot, SpecializedFormattingAnnotation, document.Project.Solution.Services, options, formattingRules, cancellationToken);
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
203if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
ValueTracking\ValueTracker.cs (3)
27var operationCollector = new OperationCollector(progressCollector, document.Project.Solution); 37var solution = document.Project.Solution; 69await progressCollector.TryReportAsync(document.Project.Solution, node.GetLocation(), symbol, cancellationToken).ConfigureAwait(false);
ValueTracking\ValueTrackingService.cs (1)
37var solution = document.Project.Solution;
Microsoft.CodeAnalysis.LanguageServer.Protocol (71)
Extensions\Extensions.cs (1)
106var solution = documents.First().Project.Solution;
Features\CodeCleanup\AbstractCodeCleanupService.cs (3)
185var fixAllService = document.Project.Solution.Services.GetRequiredService<IFixAllGetFixesService>(); 246var solutionChanges = updatedDocument.Project.Solution.GetChanges(currentDocument.Project.Solution);
Features\CodeFixes\CodeFixService.cs (11)
106var buildOnlyDiagnosticsService = document.Project.Solution.Services.GetRequiredService<IBuildOnlyDiagnosticsService>(); 183var buildOnlyDiagnosticsService = document.Project.Solution.Services.GetRequiredService<IBuildOnlyDiagnosticsService>(); 207if (document.Project.Solution.WorkspaceKind != WorkspaceKind.Interactive && includeSuppressionFixes) 311var fixAllService = document.Project.Solution.Services.GetRequiredService<IFixAllGetFixesService>(); 324var workspaceFixersMap = GetFixerPerLanguageMap(document.Project.Solution.Services); 350var fixersPriorityByLanguageMap = GetFixerPriorityPerLanguageMap(document.Project.Solution.Services); 420var isInteractive = document.Project.Solution.WorkspaceKind == WorkspaceKind.Interactive; 460var extensionManager = document.Project.Solution.Services.GetService<IExtensionManager>(); 710var extensionManager = textDocument.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 918return document.Project.Solution.WorkspaceKind == WorkspaceKind.Interactive 925var extensionManager = document.Project.Solution.Services.GetService<IExtensionManager>();
Features\CodeFixes\CodeFixService.FixAllDiagnosticProvider.cs (3)
47var solution = document.Project.Solution; 64var diagnostics = await _diagnosticService.GetDiagnosticsForIdsAsync(project.Solution, project.Id, documentId: null, _diagnosticIds, _includeSuppressedDiagnostics, cancellationToken).ConfigureAwait(false); 71var diagnostics = await _diagnosticService.GetProjectDiagnosticsForIdsAsync(project.Solution, project.Id, _diagnosticIds, _includeSuppressedDiagnostics, cancellationToken).ConfigureAwait(false);
Features\Diagnostics\DefaultDiagnosticAnalyzerService.cs (4)
92Debug.Assert(textDocument.Project.Solution.Workspace == _workspace); 105Debug.Assert(document.Project.Solution.Workspace == _workspace); 134_workspace, document.Project.Solution, document.Project.Id, document.Id, diagnosticData)); 157var analyzers = GetAnalyzers(project.Solution.State.Analyzers, project);
Features\Diagnostics\DiagnosticAnalyzerService.cs (2)
80if (_map.TryGetValue(document.Project.Solution.Workspace, out var analyzer)) 108if (_map.TryGetValue(document.Project.Solution.Workspace, out var analyzer))
Features\Diagnostics\DocumentAnalysisExecutor.cs (1)
378var diagnosticSpanMappingService = textDocument.Project.Solution.Services.GetService<IWorkspaceVenusSpanMappingService>();
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (2)
376foreach (var documentId in project.Solution.GetDocumentIdsWithFilePath(path)) 416var documentIds = targetTextDocument.Project.Solution.GetDocumentIdsWithFilePath(lineSpan.Path);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.cs (6)
167Contract.ThrowIfFalse(project.Solution.Workspace == Workspace); 171project.Solution.Workspace, 172project.Solution, 194Contract.ThrowIfFalse(document.Project.Solution.Workspace == Workspace); 198document.Project.Solution.Workspace, 199document.Project.Solution,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (3)
208var projectDependencyGraph = project.Solution.GetProjectDependencyGraph(); 210foreach (var openDocumentId in project.Solution.Workspace.GetOpenDocumentIds()) 289var compilerAnalyzer = project.Solution.State.Analyzers.GetCompilerDiagnosticAnalyzer(project.Language);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs (1)
191project.Solution,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectState.cs (1)
209&& project.Solution.Services.GetService<ISolutionCrawlerOptionsService>()?.EnableDiagnosticsInSourceGeneratedFiles == true)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.cs (1)
159var hostAnalyzers = project.Solution.State.Analyzers;
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.HostStates.cs (2)
34var key = new HostAnalyzerStateSetKey(project.Language, project.Solution.State.Analyzers.HostAnalyzerReferences); 35var hostStateSets = ImmutableInterlocked.GetOrAdd(ref _hostAnalyzerStateMap, key, CreateLanguageSpecificAnalyzerMap, project.Solution.State.Analyzers);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.ProjectStates.cs (1)
86var hostAnalyzers = project.Solution.State.Analyzers;
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (1)
209var document = await project.Solution.GetTextDocumentAsync(
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs (1)
567&& project.Solution.Services.GetService<ISolutionCrawlerOptionsService>()?.EnableDiagnosticsInSourceGeneratedFiles == true)
Features\Options\BlockStructureOptionsStorage.cs (1)
12=> GetBlockStructureOptions(globalOptions, project.Language, isMetadataAsSource: project.Solution.WorkspaceKind == WorkspaceKind.MetadataAsSource);
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (3)
45var originalSolution = document.Project.Solution; 519var originalSolution = document.Project.Solution; 609var originalSolution = document.Project.Solution;
Handler\CodeActions\CodeActionHelpers.cs (2)
244document.Project.Solution.Workspace, codeFixService, document, textSpan, 249document.Project.Solution.Workspace, codeRefactoringService, document, textSpan, CodeActionRequestPriority.None, fallbackOptions, isBlocking: false,
Handler\CodeActions\CodeActionResolveHandler.cs (1)
65var solution = document.Project.Solution;
Handler\CodeLens\CodeLensResolveHandler.cs (2)
54var codeLensReferencesService = document.Project.Solution.Services.GetRequiredService<ICodeLensReferencesService>(); 55var referenceCount = await codeLensReferencesService.GetReferenceCountAsync(document.Project.Solution, document.Id, memberToResolve.Node, maxSearchResults: 99, cancellationToken).ConfigureAwait(false);
Handler\Completion\CompletionHandler.cs (2)
171var creationService = document.Project.Solution.Services.GetRequiredService<ILspCompletionResultCreationService>(); 351var completionList = await completionService.GetCompletionsAsync(document, position, completionOptions, document.Project.Solution.Options, completionTrigger, cancellationToken: cancellationToken).ConfigureAwait(false);
Handler\Diagnostics\DiagnosticSources\ProjectDiagnosticSource.cs (1)
33var projectDiagnostics = await diagnosticAnalyzerService.GetProjectDiagnosticsForIdsAsync(Project.Solution, Project.Id, cancellationToken: cancellationToken).ConfigureAwait(false);
Handler\Diagnostics\DiagnosticSources\WorkspaceDocumentDiagnosticSource.cs (1)
38Document.Project.Solution, Document.Project.Id, Document.Id, cancellationToken: cancellationToken).ConfigureAwait(false);
Handler\Formatting\AbstractFormatDocumentHandlerBase.cs (1)
44var services = document.Project.Solution.Services;
Handler\Hover\HoverHandler.cs (1)
66var hoverService = document.Project.Solution.Services.GetRequiredService<ILspHoverResultCreationService>();
Handler\InlineCompletions\InlineCompletionsHandler.cs (1)
149var formattingChanges = Formatter.GetFormattedTextChanges(root, spanToFormat, originalDocument.Project.Solution.Services, formattingOptions, cancellationToken: cancellationToken)
Handler\PullHandlers\VersionedPullCache`2.cs (3)
74var workspace = project.Solution.Workspace; 77var isFullyLoaded = await IsFullyLoadedAsync(project.Solution, cancellationToken).ConfigureAwait(false); 122_idToLastReportedResult[(project.Solution.Workspace, projectOrDocumentId)] = (newResultId, cheapVersion, expensiveVersion);
Handler\Rename\RenameHandler.cs (1)
43var oldSolution = document.Project.Solution;
Handler\SemanticTokens\SemanticTokensRefreshQueue.cs (1)
103var projectChecksum = await project.Solution.State.GetChecksumAsync(project.Id, cancellationToken).ConfigureAwait(false);
Handler\Symbols\DocumentSymbolsHandler.cs (1)
86var service = document.Project.Solution.Services.GetRequiredService<ILspSymbolInformationCreationService>();
Handler\Symbols\WorkspaceSymbolsHandler.cs (1)
93var service = project.Solution.Services.GetRequiredService<ILspSymbolInformationCreationService>();
Workspaces\LspWorkspaceManager.cs (4)
191var workspaceKind = document.Project.Solution.WorkspaceKind; 201return (workspace, document.Project.Solution, document); 215return (_lspMiscellaneousFilesWorkspace, miscDocument.Project.Solution, miscDocument); 321_logger.LogWarning($"Text for {uriInWorkspace} did not match document text {firstDocument.Id} in workspace's {firstDocument.Project.Solution.WorkspaceKind} current solution");
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (17)
Diagnostics\PullDiagnosticTests.cs (4)
255var solution = document.Project.Solution; 1306await testLspServer.TestWorkspace.ChangeDocumentAsync(csproj2Document.Id, newCsProj2Document.Project.Solution); 1381await testLspServer.TestWorkspace.ChangeDocumentAsync(csproj3Document.Id, newCsProj3Document.Project.Solution).ConfigureAwait(false); 1448await testLspServer.TestWorkspace.ChangeDocumentAsync(csproj2Document.Id, newCsProj2Document.Project.Solution);
DocumentChanges\DocumentChangesTests.LinkedDocuments.cs (1)
106return lspDocument.Project.Solution;
SpellCheck\SpellCheckTests.cs (1)
87var solution = document.Project.Solution;
Workspaces\LspWorkspaceManagerTests.cs (11)
51Assert.Equal(testLspServer.GetCurrentSolution(), closedDocument!.Project.Solution); 132Assert.Equal(testLspServer.TestWorkspace.CurrentSolution, openedDocument!.Project.Solution); 136await testLspServer.TestWorkspace.ChangeProjectAsync(newProject.Id, newProject.Solution); 143Assert.Equal(testLspServer.TestWorkspace.CurrentSolution, openedDocument.Project.Solution); 156Assert.NotEqual(testLspServer.TestWorkspace.CurrentSolution, openedDocument!.Project.Solution); 160await testLspServer.TestWorkspace.ChangeProjectAsync(newProject.Id, newProject.Solution); 167Assert.NotEqual(testLspServer.TestWorkspace.CurrentSolution, openedDocument.Project.Solution); 190Assert.Equal(testLspServer.TestWorkspace.CurrentSolution, lspDocument.Project.Solution); 404await testWorkspaceTwo.ChangeProjectAsync(newProjectWorkspaceTwo.Id, newProjectWorkspaceTwo.Solution); 454await testWorkspace.ChangeProjectAsync(newProject.Id, newProject.Solution); 481Assert.Same(testLspServer.TestWorkspace.CurrentSolution, lspDocument.Project.Solution);
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator (1)
Program.cs (1)
154return project.Solution;
Microsoft.CodeAnalysis.Remote.ServiceHub (22)
Host\RemoteWorkspace.SolutionCreator.cs (19)
90solution = solution.WithFrozenSourceGeneratedDocument(identity, sourceText).Project.Solution; 291return project.Solution; 307project = project.Solution.WithProjectName(projectId, newProjectAttributes.Name).GetProject(projectId)!; 312project = project.Solution.WithProjectAssemblyName(projectId, newProjectAttributes.AssemblyName).GetProject(projectId)!; 317project = project.Solution.WithProjectFilePath(projectId, newProjectAttributes.FilePath).GetProject(projectId)!; 322project = project.Solution.WithProjectOutputFilePath(projectId, newProjectAttributes.OutputFilePath).GetProject(projectId)!; 327project = project.Solution.WithProjectOutputRefFilePath(projectId, newProjectAttributes.OutputRefFilePath).GetProject(projectId)!; 332project = project.Solution.WithProjectCompilationOutputInfo(project.Id, newProjectAttributes.CompilationOutputInfo).GetProject(project.Id)!; 337project = project.Solution.WithProjectDefaultNamespace(projectId, newProjectAttributes.DefaultNamespace).GetProject(projectId)!; 342project = project.Solution.WithHasAllInformation(projectId, newProjectAttributes.HasAllInformation).GetProject(projectId)!; 347project = project.Solution.WithRunAnalyzers(projectId, newProjectAttributes.RunAnalyzers).GetProject(projectId)!; 352project = project.Solution.WithProjectChecksumAlgorithm(projectId, newProjectAttributes.ChecksumAlgorithm).GetProject(projectId)!; 407project = addDocuments(project.Solution, lazyDocumentsToAdd.ToImmutable()).GetProject(project.Id)!; 440project = removeDocuments(project.Solution, lazyDocumentsToRemove.ToImmutable()).GetProject(project.Id)!; 462TextDocumentKind.Document => document.Project.Solution.WithDocumentText(document.Id, sourceText).GetDocument(document.Id)!, 463TextDocumentKind.AnalyzerConfigDocument => document.Project.Solution.WithAnalyzerConfigDocumentText(document.Id, sourceText).GetAnalyzerConfigDocument(document.Id)!, 464TextDocumentKind.AdditionalDocument => document.Project.Solution.WithAdditionalDocumentText(document.Id, sourceText).GetAdditionalDocument(document.Id)!, 487document = document.Project.Solution.WithDocumentFolders(document.Id, newDocumentInfo.Folders).GetDocument(document.Id)!; 494document = document.Project.Solution.WithDocumentSourceCodeKind(document.Id, newDocumentInfo.SourceCodeKind).GetDocument(document.Id)!;
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (2)
76_performanceTracker = project.Solution.Services.GetService<IPerformanceTrackerService>(); 311foreach (var reference in _project.Solution.AnalyzerReferences.Concat(_project.AnalyzerReferences))
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (1)
112var solution = document.Project.Solution;
Microsoft.CodeAnalysis.Remote.Workspaces (1)
SolutionAssetStorage.cs (1)
58=> StoreAssetsAsync(project.Solution, project.Id, cancellationToken);
Microsoft.CodeAnalysis.TestAnalyzerReference (2)
NonSourceFileRefactoring.cs (2)
32return document.Project.Solution.WithAdditionalDocumentText(document.Id, newText); 33return document.Project.Solution.WithAnalyzerConfigDocumentText(document.Id, newText);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (2)
103Dim innerEditor = New SyntaxEditor(root, document.Project.Solution.Services) 137Dim editor = New SyntaxEditor(root, document.Project.Solution.Services)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (10)
LineCommit\CommitBufferManager.vb (1)
300Dim refProject = project.Solution.GetProject(reference.ProjectId)
LineCommit\CommitCommandHandler.vb (1)
243Dim formattingRuleService = document.Project.Solution.Services.GetService(Of IHostDependentFormattingRuleFactoryService)()
LineCommit\CommitFormatter.vb (1)
108document.Project.Solution.Services,
NavigationBar\VisualBasicEditorNavigationBarItemService.vb (1)
52Dim destinationDocument = document.Project.Solution.GetDocument(navigationLocation.documentId)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (6)
41newDocument.Project.Solution.Workspace.ApplyDocumentChanges(newDocument, cancellationToken) 43Dim solution = newDocument.Project.Solution 148document.Project.Solution, 205document.Project.Solution, 251document.Project.Solution, 280document.Project.Solution,
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures.UnitTests (9)
CodeActions\Preview\PreviewTests.vb (1)
48Dim solution = _oldDocument.Project.Solution
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.vb (1)
28Projects.Single().AddAdditionalDocument(name:="dummy.txt", text:="", filePath:="dummy.txt").Project.Solution
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (1)
36AddDocument("test.vb", SourceText.From(source, Encoding.UTF8), filePath:=Path.Combine(TempRoot.Root, "test.vb")).Project.Solution
Formatting\CodeCleanUpTests.vb (2)
527project = project.Solution.WithProjectFilePath(project.Id, $"z:\\{project.FilePath}").GetProject(project.Id) 529workspace.TryApplyChanges(project.Solution)
MoveStaticMembers\VisualBasicMoveStaticMembersTests.vb (4)
1831Return project.WithCompilationOptions(compilationOptions.WithRootNamespace("RootNs")).Solution 1865Return project.WithCompilationOptions(compilationOptions.WithRootNamespace("RootNs.TestNs")).Solution 1905Return project.WithCompilationOptions(compilationOptions.WithRootNamespace("RootNs")).Solution 1964Return project.WithCompilationOptions(compilationOptions.WithRootNamespace("RootNs")).Solution
Microsoft.CodeAnalysis.VisualBasic.Features (25)
ChangeSignature\VisualBasicChangeSignatureService.vb (2)
705convertedType = If(Await SymbolFinder.FindSourceDefinitionAsync(convertedType, document.Project.Solution, cancellationToken).ConfigureAwait(False), convertedType) 724nodeType = If(Await SymbolFinder.FindSourceDefinitionAsync(nodeType, document.Project.Solution, cancellationToken).ConfigureAwait(False), nodeType)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (13)
108Dim sourceDefinition = Await SymbolFinder.FindSourceDefinitionAsync(targetType, document.Project.Solution, cancellationToken).ConfigureAwait(False) 128Dim codeGenService = document.Project.Solution.Services.GetLanguageServices(targetType.Language).GetService(Of ICodeGenerationService) 129Dim syntaxFactService = document.Project.Solution.Services.GetLanguageServices(targetType.Language).GetService(Of ISyntaxFactsService) 133document.Project.Solution, eventHandlerName, Not syntaxFactService.IsCaseSensitive, SymbolFilter.Type, cancellationToken).ConfigureAwait(False) 158Return New GenerateEventCodeAction(document.Project.Solution, targetType, generatedEvent, codeGenService, fallbackOptions) 260Dim targetType = TryCast(Await SymbolFinder.FindSourceDefinitionAsync(semanticModel.GetSymbolInfo(node.Left, cancellationToken).Symbol, document.Project.Solution, cancellationToken).ConfigureAwait(False), INamedTypeSymbol) 270Dim codeGenService = document.Project.Solution.Services.GetLanguageServices(targetType.Language).GetService(Of ICodeGenerationService) 307Return New GenerateEventCodeAction(document.Project.Solution, targetType, generatedEvent, codeGenService, fallbackOptions) 311Return New GenerateEventCodeAction(document.Project.Solution, targetType, generatedMember, codeGenService, fallbackOptions) 351targetType = TryCast(Await SymbolFinder.FindSourceDefinitionAsync(withEventsProperty.Type, document.Project.Solution, cancellationToken).ConfigureAwait(False), INamedTypeSymbol) 355targetType = TryCast(Await SymbolFinder.FindSourceDefinitionAsync(targetType, document.Project.Solution, cancellationToken).ConfigureAwait(False), INamedTypeSymbol) 380Dim codeGenService = document.Project.Solution.Services.GetLanguageServices(originalTargetType.Language).GetService(Of ICodeGenerationService) 407document.Project.Solution, originalTargetType, generatedEvent, codeGenService, fallbackOptions)
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.AddKeywordAction.vb (1)
77Dim services = document.Project.Solution.Services
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (2)
33If document.Project.Solution.WorkspaceKind = WorkspaceKind.MiscellaneousFiles Then 185Return Simplifier.Expand(DirectCast(n, StatementSyntax), semanticModel, document.Project.Solution.Services, cancellationToken:=cancellationToken)
IntroduceVariable\VisualBasicIntroduceVariableService_IntroduceField.vb (3)
69Dim currentDocument = Await SemanticDocument.CreateAsync(document.Project.Solution.GetDocument(declNode.SyntaxTree), cancellationToken).ConfigureAwait(False) 91Dim currentDocument = document.Project.Solution.GetDocument(syntaxTree) 100updatedDocument = updatedDocument.Project.Solution.GetDocument(currentDocument.Id).WithSyntaxRoot(newRoot)
NavigationBar\VisualBasicNavigationBarItemService.vb (1)
55document.Project.Solution, type, position, semanticModel, workspaceSupportsDocumentChanges, symbolDeclarationService, cancellationToken))
QuickInfo\VisualBasicSemanticQuickInfoProvider.vb (1)
31Dim services = context.Document.Project.Solution.Services
VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (2)
103Dim innerEditor = New SyntaxEditor(root, document.Project.Solution.Services) 137Dim editor = New SyntaxEditor(root, document.Project.Solution.Services)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (2)
CodeCleanup\Providers\NormalizeModifiersOrOperatorsCodeCleanupProvider.vb (1)
37Dim newRoot = Await CleanupAsync(root, spans, options.FormattingOptions, document.Project.Solution.Services, cancellationToken).ConfigureAwait(False)
CodeCleanup\Providers\RemoveUnnecessaryLineContinuationCodeCleanupProvider.vb (1)
40Dim newRoot = Await CleanupAsync(root, spans, options.FormattingOptions, document.Project.Solution.Services, cancellationToken).ConfigureAwait(False)
Microsoft.CodeAnalysis.Workspaces (130)
AbstractMoveDeclarationNearReferenceService.cs (1)
83var editor = new SyntaxEditor(root, document.Project.Solution.Services);
AbstractMoveDeclarationNearReferenceService.State.cs (1)
91var findReferencesResult = await SymbolFinder.FindReferencesAsync(LocalSymbol, document.Project.Solution, cancellationToken).ConfigureAwait(false);
Classification\AbstractClassificationService.cs (3)
99var workspaceStatusService = document.Project.Solution.Services.GetRequiredService<IWorkspaceStatusService>(); 154var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 188AddSyntacticClassifications(document.Project.Solution.Services, root, textSpan, result, cancellationToken);
Classification\Classifier.cs (1)
31return GetClassifiedSpans(document.Project.Solution.Services, document.Project, semanticModel, textSpan, ClassificationOptions.Default, cancellationToken);
Classification\SemanticClassificationCacheUtilities.cs (1)
23var projectKey = new ProjectKey(SolutionKey.ToSolutionKey(project.Solution), project.Id, project.FilePath, project.Name, Checksum.Null);
CodeActions\CodeAction.cs (4)
222return changedDocument.Project.Solution; 322processedSolution = processedDocument.Project.Solution; 335processedSolution = processedDocument.Project.Solution; 355var globalOptions = document.Project.Solution.Services.GetService<ILegacyGlobalCleanCodeGenerationOptionsWorkspaceService>();
CodeActions\Operations\ApplyChangesOperation.cs (2)
133var originalDocument = changedProject.OldProject.Solution.GetRequiredTextDocument(documentId); 134var changedDocument = changedProject.NewProject.Solution.GetRequiredTextDocument(documentId);
CodeFixes\CodeFix.cs (1)
79return DiagnosticData.Create(Project.Solution, diagnostic, Project);
CodeFixes\FixAllOccurrences\FixAllContext.DiagnosticProvider.cs (1)
87var tasks = project.Solution.Projects.Select(async p => new
CodeFixes\FixAllOccurrences\FixAllContextHelper.cs (1)
66var projectsToFix = project.Solution.Projects
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (1)
36_differenceService = document.Project.Solution.Services.GetRequiredService<IDocumentTextDifferencingService>();
CodeFixesAndRefactorings\CommonFixAllState.cs (1)
22public Solution Solution => Project.Solution;
CodeRefactorings\FixAllOccurences\FixAllContext.cs (1)
63public Solution Solution => Project.Solution;
CodeRefactorings\FixAllOccurences\FixAllState.cs (1)
121documentsToFix = Project.Solution.Projects.SelectMany(p => p.Documents);
CodeRefactorings\SyntaxEditorBasedCodeRefactoringProvider.cs (1)
75var editor = new SyntaxEditor(root, document.Project.Solution.Services);
Diagnostics\DiagnosticAnalysisResultBuilder.cs (5)
88AddOtherDiagnostic(DiagnosticData.Create(Project.Solution, diagnostic, Project)); 95AddOtherDiagnostic(DiagnosticData.Create(Project.Solution, diagnostic, Project)); 162AddOtherDiagnostic(DiagnosticData.Create(Project.Solution, diagnostic, Project)); 168AddOtherDiagnostic(DiagnosticData.Create(Project.Solution, diagnostic, Project)); 186AddOtherDiagnostic(DiagnosticData.Create(Project.Solution, diagnostic, Project));
Diagnostics\DiagnosticData.cs (3)
201var diagnosticSpanMappingService = document?.Project.Solution.Services.GetService<IWorkspaceVenusSpanMappingService>(); 291builder.AddIfNotNull(CreateLocation(document.Project.Solution.GetDocument(location.SourceTree), location)); 331diagnosticData = Create(project.Solution, diagnostic, project);
DocumentExtensions.cs (3)
79var workspace = document.Project.Solution.Workspace; 144var semanticModelService = document.Project.Solution.Services.GetRequiredService<ISemanticModelReuseWorkspaceService>(); 200var solution = document.Project.Solution;
Editing\DocumentEditor.cs (1)
22: base(root, document.Project.Solution.Services)
Editing\SolutionEditor.cs (1)
56changedSolution = newDoc.Project.Solution;
Editing\SymbolEditor.cs (2)
54return new SymbolEditor(document.Project.Solution); 292_currentSolution = newDoc.Project.Solution;
FindSymbols\Declarations\DeclarationFinder.cs (1)
85project.Solution, reference, checksum: null, cancellationToken).ConfigureAwait(false);
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (2)
40var solution = project.Solution; 97var referencedProject = project.Solution.GetProject(projectReference.ProjectId);
FindSymbols\Declarations\DeclarationFinder_SourceDeclarations.cs (4)
87project.Solution, 96return await RehydrateAsync(project.Solution, result.Value, cancellationToken).ConfigureAwait(false); 153project.Solution, 162return await RehydrateAsync(project.Solution, result.Value, cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
345project.Solution, reference, checksum: null, cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\FindReferencesDocumentState.cs (1)
39Solution = document.Project.Solution;
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (3)
38var storageService = document.Project.Solution.Services.GetPersistentStorageService(); 128var solution = document.Project.Solution; 136var solution = document.Project.Solution;
FindSymbols\SymbolFinder.cs (1)
114return await FindSymbolAtPositionAsync(semanticModel, position, document.Project.Solution.Services, cancellationToken).ConfigureAwait(false);
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (3)
38var solution = project.Solution; 58project.Solution.Services, 59SolutionKey.ToSolutionKey(project.Solution),
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (3)
83var solution = project.Solution; 194var checksum = SymbolTreeInfo.GetMetadataChecksum(project.Solution.Services, reference, cancellationToken); 199project.Solution, reference, checksum, cancellationToken).ConfigureAwait(false);
Formatting\Formatter.cs (3)
96var services = document.Project.Solution.Services; 117var services = document.Project.Solution.Services; 134var services = document.Project.Solution.Services;
ProjectExtensions.cs (2)
37=> project.Solution.Workspace.Services.GetExtendedLanguageServices(project.Language); 86var solutionOrProjectFilePath = project.Solution?.FilePath ?? project.FilePath;
Recommendations\Recommender.cs (1)
60options ??= project.Solution.Options;
Remote\RemoteArguments.cs (1)
62: Dehydrate(document.Project.Solution, alias, cancellationToken);
Remote\RemoteHostClient.cs (1)
43return TryGetClientAsync(project.Solution.Services, cancellationToken);
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
649var newReferencedSymbols = RenameUtilities.GetSymbolsTouchingPosition(tokenOrNode.Span.Start, newDocumentSemanticModel, newDocument.Project.Solution.Services, _cancellationToken);
Rename\ConflictEngine\RenamedSpansTracker.cs (1)
224solution = document.Project.Solution;
Rename\Renamer.cs (1)
78=> RenameDocumentAsync(document, GetDocumentRenameOptions(optionSet ?? document.Project.Solution.Options), newDocumentName, newDocumentFolders, cancellationToken);
Rename\Renamer.RenameSymbolDocumentAction.cs (1)
40var solution = document.Project.Solution;
Rename\Renamer.SyncNamespaceDocumentAction.cs (1)
53return solution ?? document.Project.Solution;
Rename\RenameUtilities.cs (1)
306var definitionSymbol = await FindDefinitionSymbolAsync(symbol, document.Project.Solution, cancellationToken).ConfigureAwait(false);
Shared\Extensions\DocumentExtensions.cs (1)
49=> document.Project.Solution.WithOptions(options).GetRequiredDocument(document.Id);
Shared\Extensions\ProjectExtensions.cs (3)
17=> project.Solution.WithOptions(options).GetProject(project.Id)!; 20=> project.Solution.GetTextDocument(documentId); 32=> project.Solution.GetDocumentIdsWithFilePath(filePath).FirstOrDefault(id => id.ProjectId == project.Id);
Shared\Extensions\SyntaxGeneratorExtensions.cs (1)
353&& await SymbolFinder.FindSourceDefinitionAsync(overriddenProperty, document.Project.Solution, cancellationToken).ConfigureAwait(false) is { Language: LanguageNames.VisualBasic })
Simplification\Simplifier.cs (3)
75return Expand(node, semanticModel, document.Project.Solution.Services, expandInsideNode, expandParameter, cancellationToken); 120return Expand(token, semanticModel, document.Project.Solution.Services, expandInsideNode, cancellationToken); 257var simplificationService = document.Project.Solution.Services.GetRequiredLanguageService<ISimplificationService>(document.Project.Language);
SupportedChangesServiceExtensions.cs (1)
13=> project.Solution.Services.GetRequiredService<ISupportedChangesService>().CanApplyParseOptionChange(oldOptions, newOptions, project);
SyntaxEditorBasedCodeFixProvider.cs (1)
82var editor = new SyntaxEditor(root, document.Project.Solution.Services);
TextDocumentExtensions.cs (2)
39return textDocument.Project.Solution.WithAdditionalDocumentText(textDocument.Id, text, PreservationMode.PreserveIdentity).GetTextDocument(textDocument.Id)!; 48return textDocument.Project.Solution.WithAnalyzerConfigDocumentText(textDocument.Id, text, PreservationMode.PreserveIdentity).GetTextDocument(textDocument.Id)!;
Workspace\Host\PersistentStorage\ProjectKey.cs (1)
44=> ToProjectKey(project.Solution.State, project.State);
Workspace\Solution\Document.cs (10)
325=> this.Project.Solution.WithDocumentSourceCodeKind(this.Id, kind).GetDocument(this.Id)!; 331=> this.Project.Solution.WithDocumentText(this.Id, text, PreservationMode.PreserveIdentity).GetDocument(this.Id)!; 337=> this.Project.Solution.WithDocumentSyntaxRoot(this.Id, root, PreservationMode.PreserveIdentity).GetDocument(this.Id)!; 343=> this.Project.Solution.WithDocumentName(this.Id, name).GetDocument(this.Id)!; 349=> this.Project.Solution.WithDocumentFolders(this.Id, folders).GetDocument(this.Id)!; 359=> this.Project.Solution.WithDocumentFilePath(this.Id, filePath).GetDocument(this.Id)!; 433var filteredDocumentIds = this.Project.Solution.GetRelatedDocumentIds(this.Id); 446var solution = this.Project.Solution; 455var newSolution = this.Project.Solution.WithFrozenPartialCompilationIncludingSpecificDocument(this.Id, cancellationToken); 482InitializeCachedOptions(Project.Solution.Options);
Workspace\Solution\Project.cs (31)
24/// Represents a project that is part of a <see cref="Solution"/>. 136public IEnumerable<ProjectReference> ProjectReferences => _projectState.ProjectReferences.Where(pr => this.Solution.ContainsProject(pr.ProjectId)); 560=> this.Solution.WithProjectAssemblyName(this.Id, assemblyName).GetProject(this.Id)!; 566=> this.Solution.WithProjectDefaultNamespace(this.Id, defaultNamespace).GetProject(this.Id)!; 572=> this.Solution.WithProjectCompilationOptions(this.Id, options).GetProject(this.Id)!; 578=> this.Solution.WithProjectParseOptions(this.Id, options).GetProject(this.Id)!; 585=> this.Solution.AddProjectReference(this.Id, projectReference).GetProject(this.Id)!; 592=> this.Solution.AddProjectReferences(this.Id, projectReferences).GetProject(this.Id)!; 598=> this.Solution.RemoveProjectReference(this.Id, projectReference).GetProject(this.Id)!; 605=> this.Solution.WithProjectReferences(this.Id, projectReferences).GetProject(this.Id)!; 612=> this.Solution.AddMetadataReference(this.Id, metadataReference).GetProject(this.Id)!; 619=> this.Solution.AddMetadataReferences(this.Id, metadataReferences).GetProject(this.Id)!; 625=> this.Solution.RemoveMetadataReference(this.Id, metadataReference).GetProject(this.Id)!; 632=> this.Solution.WithProjectMetadataReferences(this.Id, metadataReferences).GetProject(this.Id)!; 639=> this.Solution.AddAnalyzerReference(this.Id, analyzerReference).GetProject(this.Id)!; 646=> this.Solution.AddAnalyzerReferences(this.Id, analyzerReferences).GetProject(this.Id)!; 652=> this.Solution.RemoveAnalyzerReference(this.Id, analyzerReference).GetProject(this.Id)!; 659=> this.Solution.WithProjectAnalyzerReferences(this.Id, analyzerReferencs).GetProject(this.Id)!; 670return this.Solution.AddDocument(id, name, syntaxRoot, folders, filePath, preservationMode: PreservationMode.PreserveIdentity).GetDocument(id)!; 679return this.Solution.AddDocument(id, name, text, folders, filePath).GetDocument(id)!; 688return this.Solution.AddDocument(id, name, text, folders, filePath).GetDocument(id)!; 697return this.Solution.AddAdditionalDocument(id, name, text, folders, filePath).GetAdditionalDocument(id)!; 706return this.Solution.AddAdditionalDocument(id, name, text, folders, filePath).GetAdditionalDocument(id)!; 715return this.Solution.AddAnalyzerConfigDocument(id, name, text, folders, filePath).GetAnalyzerConfigDocument(id)!; 725return this.Solution.RemoveDocument(documentId).GetProject(this.Id)!; 735return this.Solution.RemoveDocuments(documentIds).GetRequiredProject(this.Id); 744=> this.Solution.RemoveAdditionalDocument(documentId).GetProject(this.Id)!; 753return this.Solution.RemoveAdditionalDocuments(documentIds).GetRequiredProject(this.Id); 762=> this.Solution.RemoveAnalyzerConfigDocument(documentId).GetProject(this.Id)!; 771return this.Solution.RemoveAnalyzerConfigDocuments(documentIds).GetRequiredProject(this.Id); 793=> Solution.State.Analyzers.GetSkippedAnalyzersInfo(this, infoCache);
Workspace\Solution\SolutionState.cs (1)
1935if (!projectWithCachedGeneratorState.Solution.State.TryGetCompilationTracker(projectWithCachedGeneratorState.Id, out var tracker) ||
Workspace\Workspace.cs (2)
617oldSolution.RemoveProject(projectId).AddProject(reloadedProjectInfo).GetRequiredProject(projectId)).Solution; 1240solution = project.Solution;
Workspace\Workspace_Editor.cs (4)
757newSolution = document.WithText(this.GetOpenDocumentText(oldSolution, docId)).Project.Solution; 766var oldSolution = oldProject.Solution; 767var newSolution = reloadedProject.Solution; 775newSolution = document.WithText(this.GetOpenDocumentText(oldSolution, docId)).Project.Solution;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (14)
NetCoreTests.cs (2)
175Assert.Equal(projectRefFilePath, project.Solution.GetProject(projectRefId).FilePath); 495Assert.Equal(projectRefFilePath, project.Solution.GetProject(projectRefId).FilePath);
VisualStudioMSBuildWorkspaceTests.cs (12)
330var p2 = p1.Solution.Projects.First(p => p.Language == LanguageNames.VisualBasic); 1212Assert.Single(project.Solution.ProjectIds); // didn't really open referenced project due to invalid file path. 1241Assert.Single(project.Solution.ProjectIds); // didn't really open referenced project due to invalid file path. 1274Assert.Single(project.Solution.ProjectIds); // didn't really open referenced project due to unrecognized extension. 1312Assert.Single(project.Solution.ProjectIds); 1336Assert.Single(project.Solution.ProjectIds); 1359Assert.Single(project.Solution.ProjectIds); 2877var noEncodingSolution = noEncodingDoc.Project.Solution; 2906workspace.TryApplyChanges(project.AddAnalyzerReference(aref).Solution); 2911workspace.TryApplyChanges(workspace.CurrentSolution.GetProject(project.Id).RemoveAnalyzerReference(aref).Solution); 2932workspace.TryApplyChanges(workspace.CurrentSolution.GetProject(project.Id).RemoveProjectReference(pref).Solution); 2939workspace.TryApplyChanges(workspace.CurrentSolution.GetProject(project.Id).AddProjectReference(pref).Solution);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
WorkspaceExtensions.cs (1)
19var newSolution = oldSolution.AddDocument(id, name, initialText, folders).GetDocument(id)!.WithSourceCodeKind(sourceCodeKind).Project.Solution;
Microsoft.CodeAnalysis.Workspaces.UnitTests (57)
FindReferencesTests.cs (5)
171var references = await SymbolFinder.FindReferencesAsync(symbol, prj.Solution); 176references = await SymbolFinder.FindReferencesAsync(symbol, prj.Solution); 207var references = await SymbolFinder.FindReferencesAsync(symbol, prj.Solution); 275var references = await SymbolFinder.FindReferencesAsync(symbol, prj.Solution); 280references = await SymbolFinder.FindReferencesAsync(symbol, prj.Solution);
Formatter\FormatterTests.cs (1)
79document = document.Project.Solution.WithOptions(solutionOptions).GetRequiredDocument(document.Id);
SolutionTests\SolutionTests.cs (10)
2143.Project.Solution; 3056var doc2 = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot, PreservationMode.PreserveValue).GetDocument(doc.Id); 3059var observed2 = GetObservedSyntaxTreeRootAsync(doc2.Project.Solution, did); 3466var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { /*no top level change*/ } }")); 3511var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { } public void NewMethod() { } }")); 3572var frozenSolution = document.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution; 3680var solution = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).Solution; 4271var s2 = s1.AddProject("P1", "A1", LanguageNames.VisualBasic).Solution; 4310var newDoc = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot).GetDocument(doc.Id); 4342static (sourceText, document) => document.Project.Solution.WithDocumentText(document.Id, sourceText, PreservationMode.PreserveIdentity),
SolutionTests\SolutionWithSourceGeneratorTests.cs (22)
179var generatorDriver = project.Solution.State.GetTestAccessor().GetGeneratorDriver(project)!; 199generatorDriver = project.Solution.State.GetTestAccessor().GetGeneratorDriver(project)!; 223generatorDriver = project.Solution.State.GetTestAccessor().GetGeneratorDriver(project)!; 253project = project.Solution.WithDocumentText(documentId, SourceText.From("// Changed Source File")).Projects.Single(); 296project = project.Solution.WithAdditionalDocumentText(additionalDocumentId, SourceText.From("Hello, everyone!")).Projects.Single(); 301project = project.Solution.WithAdditionalDocumentText(additionalDocumentId, SourceText.From("Good evening, everyone!")).Projects.Single(); 355projectBeforeChange.Solution.WithAdditionalDocumentText( 391return project.Solution; 402.AddAdditionalDocument("Test.txt", "Hello, world!").Project.Solution; 573Assert.True(workspace.SetCurrentSolution(_ => project.Solution, WorkspaceChangeKind.SolutionChanged)); 582Assert.NotSame(workspace.CurrentSolution, generatedDocument.Project.Solution); 597Assert.True(workspace.SetCurrentSolution(_ => project.Solution, WorkspaceChangeKind.SolutionChanged)); 605Assert.Same(workspace.CurrentSolution, generatedDocument!.Project.Solution); 617Assert.True(workspace.SetCurrentSolution(_ => originalAdditionalFile.Project.Solution, WorkspaceChangeKind.SolutionChanged)); 642.AddAnalyzerReference(analyzerReference).Solution; 646new ProjectReference(projectIdWithGenerator)).Solution; 660var projectWithReference = generatedDocument.Project.Solution.Projects.Single(p => p.Id != projectIdWithGenerator); 675Assert.True(workspace.SetCurrentSolution(_ => project.Solution, WorkspaceChangeKind.SolutionChanged)); 704Assert.True(workspace.SetCurrentSolution(_ => project.Solution, WorkspaceChangeKind.SolutionChanged)); 765var originalDocument2 = AddEmptyProject(originalDocument1.Project.Solution, name: "Project2") 769var frozenSolution = originalDocument2.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution; 802project = project.Solution.AddDocument(documentInfo).Projects.Single()
SolutionTests\TryApplyChangesTests.cs (7)
79Assert.True(workspace.TryApplyChanges(project.WithCompilationOptions(project.CompilationOptions!.WithMainTypeName("Test")).Solution)); 92Assert.True(workspace.TryApplyChanges(project.WithCompilationOptions(project.CompilationOptions!.WithMainTypeName("Test")).Solution)); 106() => workspace.TryApplyChanges(project.WithCompilationOptions(project.CompilationOptions!.WithMainTypeName("WrongThing")).Solution)); 124project.ParseOptions!.WithFeatures(new[] { KeyValuePairUtil.Create("Feature", "") })).Solution)); 139project.WithParseOptions(project.ParseOptions!.WithFeatures(new[] { KeyValuePairUtil.Create("Feature", "ExpectedValue") })).Solution)); 154project.WithParseOptions(project.ParseOptions!.WithFeatures(new[] { KeyValuePairUtil.Create("Feature", "WrongThing") })).Solution)); 166Assert.True(workspace.TryApplyChanges(project.AddAnalyzerConfigDocument(".editorconfig", SourceText.From("")).Project.Solution));
SymbolKeyTests.cs (2)
804workspace.TryApplyChanges(document.WithText(updated).Project.Solution); 851workspace.TryApplyChanges(document.WithText(updated).Project.Solution);
WorkspaceTests\AdhocWorkspaceTests.cs (5)
456Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 489Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 523Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 554Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 584Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution));
WorkspaceTests\WorkspaceTests.cs (5)
33Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 49Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 67Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 84Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 100Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message);
Microsoft.VisualStudio.LanguageServices (88)
CallHierarchy\CallHierarchyCommandHandler.cs (3)
92semanticModel, caretPosition, document.Project.Solution.Services, cancellationToken).ConfigureAwait(false); 97var mappingService = document.Project.Solution.Services.GetService<ISymbolMappingService>(); 117var notificationService = document.Project.Solution.Services.GetService<INotificationService>();
CallHierarchy\CallHierarchyItem.cs (1)
44_workspace = project.Solution.Workspace;
CallHierarchy\CallHierarchyProvider.cs (3)
68symbol, project.Solution, this.ThreadingContext, _streamingPresenter.Value, cancellationToken).ConfigureAwait(false); 119var @overrides = await SymbolFinder.FindOverridesAsync(symbol, project.Solution, cancellationToken: cancellationToken).ConfigureAwait(false); 130var implementedInterfaceMembers = await SymbolFinder.FindImplementedInterfaceMembersAsync(symbol, project.Solution, cancellationToken: cancellationToken).ConfigureAwait(false);
CallHierarchy\Finders\AbstractCallFinder.cs (5)
120var documentTrackingService = project.Solution.Services.GetRequiredService<IDocumentTrackingService>(); 126var currentProject = project.Solution.GetProject(activeDocument.ProjectId); 134var currentDocument = project.Solution.GetDocument(activeDocument); 161loc => new CallHierarchyDetail(this.Provider, loc, project.Solution.Workspace))); 165var callingProject = project.Solution.GetProject(caller.CallingSymbol.ContainingAssembly, cancellationToken);
CallHierarchy\Finders\BaseMemberFinder.cs (1)
31var calls = await SymbolFinder.FindCallersAsync(symbol, project.Solution, documents, cancellationToken).ConfigureAwait(false);
CallHierarchy\Finders\CallToOverrideFinder.cs (2)
27var overrides = await SymbolFinder.FindOverridesAsync(symbol, project.Solution, cancellationToken: cancellationToken).ConfigureAwait(false); 32var calls = await SymbolFinder.FindCallersAsync(@override, project.Solution, documents, cancellationToken).ConfigureAwait(false);
CallHierarchy\Finders\FieldReferenceFinder.cs (1)
34var callers = await SymbolFinder.FindCallersAsync(symbol, project.Solution, documents, cancellationToken).ConfigureAwait(false);
CallHierarchy\Finders\ImplementerFinder.cs (2)
40var implementations = await SymbolFinder.FindImplementationsAsync(symbol, project.Solution, cancellationToken: cancellationToken).ConfigureAwait(false); 44var sourceLocations = implementation.DeclaringSyntaxReferences.Select(d => project.Solution.GetDocument(d.SyntaxTree)).WhereNotNull();
CallHierarchy\Finders\InterfaceImplementationCallFinder.cs (1)
34var calls = await SymbolFinder.FindCallersAsync(symbol, project.Solution, documents, cancellationToken).ConfigureAwait(false);
CallHierarchy\Finders\MethodCallFinder.cs (1)
37var callers = await SymbolFinder.FindCallersAsync(symbol, project.Solution, documents, cancellationToken).ConfigureAwait(false);
CallHierarchy\Finders\OverridingMemberFinder.cs (2)
36var overrides = await SymbolFinder.FindOverridesAsync(symbol, project.Solution, cancellationToken: cancellationToken).ConfigureAwait(false); 40var sourceLocations = @override.DeclaringSyntaxReferences.Select(d => project.Solution.GetDocument(d.SyntaxTree)).WhereNotNull();
ChangeSignature\AddParameterDialogViewModel.cs (1)
28_notificationService = document.Project.Solution.Services.GetService<INotificationService>();
ChangeSignature\ChangeSignatureDialogViewModel.cs (1)
64_notificationService = document.Project.Solution.Services.GetRequiredService<INotificationService>();
CodeCleanup\AbstractCodeCleanUpFixer.cs (5)
166return newProject.Solution; 172return FixAsync(document.Project.Solution.Workspace, ApplyFixAsync, context); 178return newDocument.Project.Solution; 210return newDoc.Project.Solution; 272solution = newProject.Solution;
DebuggerIntelliSense\AbstractDebuggerIntelliSenseContext.cs (1)
137var solution = document.Project.Solution;
Diagnostics\VisualStudioDiagnosticAnalyzerService.cs (2)
392project = project.Solution.WithRunAnalyzers(project.Id, runAnalyzers: true).GetProject(project.Id)!; 394() => _diagnosticService.GetDiagnosticsAsync(project.Solution, project.Id));
ExtractClass\VisualStudioExtractClassOptionsService.cs (1)
54var notificationService = document.Project.Solution.Services.GetRequiredService<INotificationService>();
FindReferences\Entries\DocumentSpanEntry.cs (5)
196var controlService = _excerptResult.Document.Project.Solution.Services.GetRequiredService<IContentControlService>(); 225var controlService = document.Project.Solution.Services.GetRequiredService<IContentControlService>(); 236var clonedBuffer = excerpt.Value.Content.CreateTextBufferWithRoslynContentType(document.Project.Solution.Workspace); 290var workspace = _excerptResult.Document.Project.Solution.Workspace; 307var workspace = _excerptResult.Document.Project.Solution.Workspace;
FindReferences\StreamingFindUsagesPresenter.cs (1)
286var vsWorkspace = document.Project.Solution.Workspace as VisualStudioWorkspace;
GenerateType\GenerateTypeDialogViewModel.cs (4)
440this.ProjectFolders = _projectManagementService.GetFolders(this.SelectedProject.Id, this.SelectedProject.Solution.Workspace); 728var dependencyGraph = document.Project.Solution.GetProjectDependencyGraph(); 739projectListing.AddRange(document.Project.Solution.Projects 777this.ProjectFolders = _projectManagementService.GetFolders(this.SelectedProject.Id, this.SelectedProject.Solution.Workspace);
GenerateType\VisualStudioGenerateTypeOptionsServiceFactory.cs (1)
69var defaultNamespace = projectManagementService.GetDefaultNamespace(viewModel.SelectedProject, viewModel.SelectedProject?.Solution.Workspace);
Implementation\AbstractEditorFactory.cs (1)
330var forkedSolution = projectToAddTo.Solution.AddDocument(
Implementation\VisualStudioSupportsFeatureService.cs (1)
100=> SupportsRenameWorker(document.Project.Solution.GetRelatedDocumentIds(document.Id));
InheritanceMargin\InheritanceMarginTaggerProvider.cs (1)
99if (document.Project.Solution.WorkspaceKind == WorkspaceKind.Interactive)
LanguageService\AbstractLanguageService`2.cs (1)
197if (openDocument?.Project.Solution.Workspace is MetadataAsSourceWorkspace masWorkspace)
Library\ObjectBrowser\Extensions.cs (4)
68else if (project.Solution.Workspace is VisualStudioWorkspace workspace 83foreach (var other in project.Solution.Projects) 102if (project.Solution.Workspace is not VisualStudioWorkspaceImpl) 126if (project.Solution.Workspace is not VisualStudioWorkspace workspace)
Library\VsNavInfo\NavInfoFactory.cs (1)
179if (project.Solution.Workspace is not VisualStudioWorkspace workspace)
Preview\FileChange.cs (1)
220var workspace = document.Project.Solution.Workspace;
Preview\PreviewUpdater.cs (1)
75_previewWorkspace ??= new PreviewDialogWorkspace(document.Project.Solution);
Preview\ReferenceChange.cs (2)
36var oldSolution = projectChanges.OldProject.Solution; 37var newSolution = projectChanges.NewProject.Solution;
Preview\TopLevelChange.cs (1)
88var oldLinkedDocument = oldDocument.Project.Solution.GetDocument(linkedDocumentId);
Progression\GraphBuilder.cs (2)
148var thisProject = project.Solution.GetProject(symbol.ContainingAssembly) ?? project; 199var newSymbol = await SymbolFinder.FindSourceDefinitionAsync(symbol, contextProject.Solution, cancellationToken).ConfigureAwait(false);
Progression\GraphNavigatorExtension.cs (2)
85symbol, project.Solution, this.ThreadingContext, _streamingPresenter.Value, cancellationToken).ConfigureAwait(false); 97var editorWorkspace = document.Project.Solution.Workspace;
ProjectSystem\VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs (1)
36Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs (1)
39Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (1)
49Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs (1)
39Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs (1)
41Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs (1)
37Workspace.TryApplyChanges(updatedProject.Solution);
PullMemberUp\VisualStudioPullMemberUpService.cs (1)
60document.Project.Solution,
Snippets\AbstractSnippetExpansionClient.cs (3)
767var semanticInfo = semanticModel.GetSemanticInfo(token, document.Project.Solution.Services, cancellationToken); 905foreach (var provider in GetArgumentProviders(document.Project.Solution.Workspace)) 1084var workspace = originalProject.Solution.Workspace;
TableDataSource\Suppression\VisualStudioDiagnosticListTableCommandHandler.cs (1)
209project.Solution,
TableDataSource\Suppression\VisualStudioSuppressionFixService.cs (2)
549var latestProjectDiagnostics = (await _diagnosticService.GetDiagnosticsForIdsAsync(project.Solution, project.Id, diagnosticIds: uniqueDiagnosticIds, includeSuppressedDiagnostics: true, cancellationToken: cancellationToken) 638var latestDiagnosticsFromDiagnosticService = (await _diagnosticService.GetDiagnosticsForIdsAsync(project.Solution, project.Id, diagnosticIds: uniqueDiagnosticIds, includeSuppressedDiagnostics: true, cancellationToken: cancellationToken)
TaskList\ExternalErrorDiagnosticUpdateSource.cs (1)
871foreach (var analyzersPerReference in project.Solution.State.Analyzers.CreateDiagnosticAnalyzersPerReference(project))
ValueTracking\ValueTrackingCommandHandler.cs (2)
103var service = document.Project.Solution.Services.GetRequiredService<IValueTrackingService>(); 125var solution = document.Project.Solution;
Venus\ContainedDocument.cs (1)
812var services = document.Project.Solution.Services;
Venus\ContainedLanguage.IVsContainedLanguageCodeSupport.cs (1)
51var targetDocument = thisDocument.Project.Solution.GetDocument(targetDocumentId);
Venus\ContainedLanguageCodeSupport.cs (4)
236targetDocument.Project.Solution.Services, 278var memberNodeDocument = thisDocument.Project.Solution.GetDocument(memberNode.SyntaxTree); 335var newSolution = Renamer.RenameSymbolAsync(document.Project.Solution, symbol, options, newName, cancellationToken).WaitAndGetResult_Venus(cancellationToken); 336var changedDocuments = newSolution.GetChangedDocuments(document.Project.Solution);
Workspace\VisualStudioSymbolNavigationService.cs (4)
65var solution = project.Solution; 172var editorWorkspace = openedDocument.Project.Solution.Workspace; 194var definitionItem = symbol.ToNonClassifiedDefinitionItem(project.Solution, includeHiddenLocations: true); 296if (document.Project.Solution.Workspace is VisualStudioWorkspace visualStudioWorkspace
Microsoft.VisualStudio.LanguageServices.CSharp (2)
LanguageService\CSharpHelpContextService.cs (1)
173symbol = semanticModel.GetSemanticInfo(token, document.Project.Solution.Services, cancellationToken)
Snippets\SnippetExpansionClient.cs (1)
129document.Project.Solution.Workspace.ApplyDocumentChanges(formattedDocument, cancellationToken);
Microsoft.VisualStudio.LanguageServices.Implementation (9)
CodeModel\FileCodeModel.cs (6)
172documentId = project.Solution.GetDocumentIdsWithFilePath(_incomingFilePath).FirstOrDefault(d => d.ProjectId == project.Id); 345var workspace = document.Project.Solution.Workspace; 369var workspace = document.Project.Solution.Workspace; 387var applied = workspace.TryApplyChanges(document.Project.Solution); 712_batchDocument.Project.Solution.Workspace.TryApplyChanges(newDocument.Project.Solution);
Options\AbstractOptionPreviewViewModel.cs (1)
158workspace.TryApplyChanges(document.Project.Solution);
RoslynVisualStudioWorkspace.cs (2)
99var currentProject = project.Solution.Workspace.CurrentSolution.GetProject(project.Id); 110symbolInfo.Symbol, currentProject.Solution,
Microsoft.VisualStudio.LanguageServices.UnitTests (14)
CodeModel\CSharp\CodeClassTests.vb (1)
3911Dim result = state.VisualStudioWorkspace.TryApplyChanges(document.Project.Solution)
CodeModel\VisualBasic\CodeClassTests.vb (1)
3170Dim result = state.VisualStudioWorkspace.TryApplyChanges(document.Project.Solution)
Diagnostics\ExternalDiagnosticUpdateSourceTests.vb (1)
565oldSolution:=workspace.CurrentSolution, newSolution:=document.Project.Solution, project.Id, document.Id))
GoToDefinition\GoToDefinitionApiTests.vb (1)
48symbolInfo.Symbol, document.Project.Solution,
Preview\PreviewChangesTests.vb (5)
50forkedDocument.Project.Solution, 98Dim newSolution = forkedDocument.Project.Solution 147forkedDocument.Project.Solution, 195Dim newSolution = forkedDocument.Project.Solution 285Dim updatedSolution = document1.Project.Solution _
PullMemberUp\PullMemberUpViewModelTest.vb (1)
257Dim baseTypeTree = BaseTypeTreeNodeViewModel.CreateBaseTypeTree(glyphService:=Nothing, workspaceDoc.Project.Solution, memberSymbol.ContainingType, CancellationToken.None)
Venus\DocumentService_IntegrationTests.vb (4)
197Assert.True(workspace.TryApplyChanges(newDocument.Project.Solution)) 204Assert.Throws(Of NotSupportedException)(Sub() workspace.TryApplyChanges(newDocument.Project.Solution)) 271Dim testWorkspace = DirectCast(document.Project.Solution.Workspace, TestWorkspace) 309Dim testWorkspace = DirectCast(document.Project.Solution.Workspace, TestWorkspace)
Microsoft.VisualStudio.LanguageServices.VisualBasic (5)
Help\VisualBasicHelpContextService.vb (1)
48Dim visitor = New Visitor(token.Span, Await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(False), document.Project.Solution.WorkspaceKind <> WorkspaceKind.MetadataAsSource, Me, cancellationToken)
Snippets\SnippetExpansionClient.vb (1)
140document.Project.Solution.Workspace.ApplyDocumentChanges(formattedDocument, cancellationToken)
Venus\ContainedLanguageStaticEventBinding.vb (2)
66Dim targetDocument = document.Project.Solution.GetDocument(memberSymbol.Locations.First().SourceTree) 94Dim targetDocument = document.Project.Solution.GetDocument(memberSymbol.Locations.First().SourceTree)
Venus\VisualBasicContainedLanguage.vb (1)
87Dim targetDocument = thisDocument.Project.Solution.GetDocument(targetDocumentId)
Microsoft.VisualStudio.LanguageServices.Xaml (3)
Extensions.cs (1)
39return document.Project.Solution.Projects.Single(p => p.SupportsCompilation && p.FilePath == document.Project.FilePath);
Features\InlineRename\XamlEditorInlineRenameService.cs (1)
84_renameInfo, _document.Project.Solution,
Implementation\LanguageServer\Extensions\SymbolExtensions.cs (1)
57var services = codeProject.Solution.Services;
Roslyn.VisualStudio.Next.UnitTests (41)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
57var newSolution = document.Project.Solution.WithDocumentText(document.Id, newText, PreservationMode.PreserveIdentity);
Remote\SnapshotSerializationTests.cs (14)
62var project2 = document1.Project.Solution.AddProject("Project2", "Project2.dll", LanguageNames.VisualBasic); 65solution = document2.Project.Solution.GetRequiredProject(project1.Id) 69.AddAdditionalDocument("Additional", SourceText.From("hello"), ImmutableArray.Create("test"), @".\Add").Project.Solution; 124using var scope = await validator.AssetStorage.StoreAssetsAsync(project.Solution, CancellationToken.None).ConfigureAwait(false); 149using var snapshot = await validator.AssetStorage.StoreAssetsAsync(project.Solution, CancellationToken.None).ConfigureAwait(false); 150await validator.VerifySolutionStateSerializationAsync(project.Solution, snapshot.SolutionChecksum).ConfigureAwait(false); 163using var scope = await validator.AssetStorage.StoreAssetsAsync(document.Project.Solution, CancellationToken.None).ConfigureAwait(false); 186using var scope = await validator.AssetStorage.StoreAssetsAsync(document.Project.Solution, CancellationToken.None).ConfigureAwait(false); 187await validator.VerifySolutionStateSerializationAsync(document.Project.Solution, scope.SolutionChecksum).ConfigureAwait(false); 490using var snapshot = await validator.AssetStorage.StoreAssetsAsync(project.Solution, CancellationToken.None).ConfigureAwait(false); 510using var snapshot = await validator.AssetStorage.StoreAssetsAsync(project.Solution, CancellationToken.None).ConfigureAwait(false); 523using var snapshot = await validator.AssetStorage.StoreAssetsAsync(project.Solution, CancellationToken.None).ConfigureAwait(false); 532var serializer = document.Project.Solution.Services.GetService<ISerializerService>(); 582.Solution;
Services\ServiceHubServicesTests.cs (6)
178var solution = workspace.CurrentSolution.AddProject("unknown", "unknown", NoCompilationConstants.LanguageName).Solution; 435return document.WithText(GetNewText(document, csAddition, vbAddition)).Project.Solution; 547solution = project.Solution; 552solution = current.AddDocument($"Document{i}", SourceText.From(documents[i])).Project.Solution; 558solution = current.AddAdditionalDocument($"AdditionalDocument{i}", SourceText.From(additionalDocuments[i])).Project.Solution; 564solution = current.AddProjectReference(new ProjectReference(p2pReferences[i])).Solution;
Services\SolutionAssetCacheTests.cs (1)
103workspace.SetCurrentSolution(solution => solution.AddProject("Project", "Assembly", LanguageNames.CSharp).Solution, WorkspaceChangeKind.ProjectAdded);
Services\SolutionServiceTests.cs (19)
220s = s.AddProject("newProject", "newProject", LanguageNames.CSharp).Solution; 233return document.Project.Solution; 490.Solution; 501var frozenSolution1 = solution.WithFrozenSourceGeneratedDocument(documentIdentity, frozenText1).Project.Solution; 510var frozenSolution2 = solution.WithFrozenSourceGeneratedDocument(documentIdentity, frozenText2).Project.Solution; 531solution = project2.Solution; 565solution = project2.Solution; 605var project3 = project2.Solution.AddProject("P3", "P3", LanguageNames.CSharp); 607solution = project3.Solution.AddProjectReference(project3.Id, new(project3.Solution.Projects.Single(p => p.Name == "P2").Id)); 638var project3 = project2.Solution.AddProject("P3", "P3", LanguageNames.CSharp); 640solution = project3.Solution.AddProjectReference(project3.Id, new(project3.Solution.Projects.Single(p => p.Name == "P2").Id)); 679var project3 = project2.Solution.AddProject("P3", "P3", LanguageNames.CSharp); 681solution = project3.Solution.AddProjectReference(project3.Id, new(project2.Id)) 717var project3 = project2.Solution.AddProject("P3", "P3", LanguageNames.CSharp); 719solution = project3.Solution.AddProjectReference(project3.Id, new(project2.Id)) 756solution = project2.Solution; 792solution = project1.Solution;