1 write to Solution
Microsoft.CodeAnalysis.Workspaces (1)
Workspace\Solution\Project.cs (1)
39Solution = solution;
1079 references to Solution
AnalyzerRunner (2)
CodeRefactoringRunner.cs (2)
95document.Project.Solution, CodeAnalysisProgress.None, cancellationToken).ConfigureAwait(false); 103var 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.Analyzers.Extra (3)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (3)
281return (proj.Solution, cl, proj.GetDocument(cl.SyntaxTree)!); 470var solEditor = new SolutionEditor(doc.Project.Solution); 580var solEditor = new SolutionEditor(targetDoc.Project.Solution);
Microsoft.Analyzers.Extra.Tests (2)
Resources\RoslynTestUtils.cs (2)
66Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Analyzers.Local.Tests (2)
Resources\RoslynTestUtils.cs (2)
66Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.AspNetCore.App.Analyzers.Test (3)
TestDiagnosticAnalyzer.cs (3)
32var doc = project.Solution.GetDocument(project.Documents.First().Id); 49var doc = project.Solution.GetDocument(project.Documents.First().Id); 71var document = project.Solution.GetDocument(project.Documents.First().Id);
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Helpers\CodeFixVerifier.Helper.cs (1)
82root = Formatter.Format(root, Formatter.Annotation, simplifiedDoc.Project.Solution.Workspace);
Verifiers\CodeFixVerifier.cs (1)
109document = document.WithSyntaxRoot(Formatter.Format(document.GetSyntaxRootAsync().Result, Formatter.Annotation, document.Project.Solution.Workspace));
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Helpers\CodeFixVerifier.Helper.cs (1)
82root = Formatter.Format(root, Formatter.Annotation, simplifiedDoc.Project.Solution.Workspace);
Verifiers\CodeFixVerifier.cs (1)
109document = document.WithSyntaxRoot(Formatter.Format(document.GetSyntaxRootAsync().Result, Formatter.Annotation, document.Project.Solution.Workspace));
Microsoft.CodeAnalysis.CodeStyle.Fixes (54)
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
89var solution = invocationDocument.Project.Solution; 218method, invocationDocument.Project.Solution, cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (1)
72var otherDocument = document.Project.Solution.GetDocument(syntaxTree);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (2)
453document.Project.Solution, 499document.Project.Solution,
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (1)
42_document.Project.Solution,
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (2)
26var languageServices = _document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(_state.TypeToGenerateIn.Language); 36_document.Project.Solution,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (3)
67var syntaxFactory = _document.Project.Solution.Services.GetLanguageServices(_state.TypeToGenerateIn.Language).GetService<SyntaxGenerator>(); 75_document.Project.Solution, 91_document.Project.Solution,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
57var semanticFacts = document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(state.TypeToGenerateIn.Language).GetService<ISemanticFactsService>();
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
90var solution = _project.Solution; 128var solution = _project.Solution;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
47var canGenerateMember = CodeGenerator.CanAdd(document.Project.Solution, state.TypeToGenerateIn, cancellationToken);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
60if (!CodeGenerator.CanAdd(document.Project.Solution, classType, cancellationToken))
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.State.cs (1)
55if (!CodeGenerator.CanAdd(document.Project.Solution, classOrStructType, cancellationToken))
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
96this.Document.Project.Solution,
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
164var solution = document.Project.Solution; 198return newDocument.Project.Solution;
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\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], cancellationToken).ConfigureAwait(false); 151return document.Project.Solution;
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (3)
27var service = context.Document.Project.Solution.Services.GetRequiredService<ISupportedChangesService>(); 63var newSolution = await renameActionSet.UpdateSolutionAsync(documentWithInvalidFolders.Project.Solution, cancellationToken).ConfigureAwait(false); 64Debug.Assert(newSolution != document.Project.Solution);
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
45fixAllContext.Project.Solution,
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (1)
107document.Project.Solution, symbol, new SymbolRenameOptions(), fixedName,
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
67var solutionServices = document.Project.Solution.Services;
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
303var editor = new SyntaxEditor(root, document.Project.Solution.Services); 924var referencedSymbols = await SymbolFinder.FindReferencesAsync(local, document.Project.Solution, cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (3)
43type, document.Project.Solution, cancellationToken); 50c => UnsealDeclarationsAsync(document.Project.Solution, definition.DeclaringSyntaxReferences, c), 66var editor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
44var solution = project.Solution;
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (1)
56var nestedEditor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
73var solutionServices = document.Project.Solution.Services;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
75var editor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (3)
98var workspace = document.Project.Solution.Workspace; 163var semanticModelService = document.Project.Solution.Services.GetRequiredService<ISemanticModelReuseWorkspaceService>(); 219var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (2)
38=> project.Solution.Workspace.Services.GetExtendedLanguageServices(project.Language); 91var solutionOrProjectFilePath = project.Solution?.FilePath ?? project.FilePath;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\TextDocumentExtensions.cs (2)
51return textDocument.Project.Solution.WithAdditionalDocumentText(textDocument.Id, text, PreservationMode.PreserveIdentity).GetTextDocument(textDocument.Id)!; 60return textDocument.Project.Solution.WithAnalyzerConfigDocumentText(textDocument.Id, text, PreservationMode.PreserveIdentity).GetTextDocument(textDocument.Id)!;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (4)
108return document.Project.Solution; 124var editor = new SyntaxEditor(root, document.Project.Solution.Services); 128return newDocument.Project.Solution; 131return document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
84var editor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
91var findReferencesResult = await SymbolFinder.FindReferencesAsync(LocalSymbol, document.Project.Solution, cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
13=> project.Solution.Services.GetRequiredService<ISupportedChangesService>().CanApplyParseOptionChange(oldOptions, newOptions, project);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (20)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
91var solutionEditor = new SolutionEditor(document.Project.Solution);
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
106var editor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (3)
35var syntaxEditor = new SyntaxEditor(root, document.Project.Solution.Services); 54localFunctionSymbol, document.Project.Solution, documentImmutableSet, cancellationToken).ConfigureAwait(false); 126capture, document.Project.Solution, documentImmutableSet, cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
49var editor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
63var editor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
43return project.Solution.WithProjectCompilationOptions(project.Id, compilationOptions.WithAllowUnsafe(true));
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (2)
95return project.Solution.WithProjectParseOptions(project.Id, parseOptions.WithLanguageVersion(parsedNewVersion)); 100return project.Solution;
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
42var services = document.Project.Solution.Services;
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
74var subEditor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
65var editor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
109document.Project.Solution.Services, currentRoot,
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
102var solutionEditor = new SolutionEditor(document.Project.Solution); 118var solution = document.Project.Solution;
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (2)
67var solutionEditor = new SolutionEditor(document.Project.Solution); 82var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
44var editor = new SyntaxEditor(memberDeclaration, document.Project.Solution.Services);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
41var solution = project.Solution;
Microsoft.CodeAnalysis.CSharp.EditorFeatures (7)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (3)
148var factory = document.Project.Solution.Workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 173var workspace = document.Project.Solution.Workspace; 223var newSolution = document.Project.Solution.WithDocumentText(formattedDocument.Id, newText);
EventHookup\EventHookupCommandHandler_TypeCharCommand.cs (1)
50if (document != null && document.Project.Solution.Workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
Formatting\CSharpFormattingInteractionService.cs (1)
89return Task.FromResult(Formatter.GetFormattedTextChanges(parsedDocument.Root, [formattingSpan], document.Project.Solution.Services, options, cancellationToken).ToImmutableArray());
StringCopyPaste\StringCopyPasteCommandHandler.cs (1)
216var copyPasteService = documentBeforePaste.Project.Solution.Services.GetRequiredService<IStringCopyPasteService>();
StringCopyPaste\StringCopyPasteCommandHandler_CutCopy.cs (1)
58var copyPasteService = document.Project.Solution.Services.GetService<IStringCopyPasteService>();
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (16)
CodeActions\ApplyChangesOperationTests.cs (1)
36var codeAction = new TestCodeAction(_changeSolution(context.Document.Project.Solution));
CodeActions\MoveType\MoveTypeTests.MoveScope.cs (2)
928Assert.NotEqual(documentToModify.Project.Solution, modifiedSolution); 932Assert.Equal(documentToModify.Project.Solution, modifiedSolution);
CodeActions\PreviewExceptionTests.cs (1)
114extensionManager = document.Project.Solution.Services.GetService<IExtensionManager>() as EditorLayerExtensionManager.ExtensionManager;
CodeActions\PreviewTests.cs (1)
70var solution = _oldDocument.Project.Solution;
Completion\CompletionProviders\OverrideCompletionProviderTests.cs (2)
3192await workspace.ChangeSolutionAsync(updatedP1.Solution); 3246await workspace.ChangeSolutionAsync(updatedProject.Solution);
Completion\CompletionServiceTests.cs (1)
210Assert.True(workspace.SetCurrentSolution(_ => project.Solution, WorkspaceChangeKind.SolutionChanged));
Formatting\CodeCleanupTests.cs (2)
804project = project.Solution.WithProjectFilePath(project.Id, @$"z:\\{project.FilePath}").GetProject(project.Id); 806workspace.TryApplyChanges(project.Solution);
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (2)
127using var workspace = (EditorTestWorkspace)project.Solution.Workspace; 266var compilationFactory = project.Solution.Services.GetRequiredLanguageService<ICompilationFactoryService>(LanguageNames.CSharp);
Workspaces\WorkspaceTests_EditorFeatures.cs (4)
1322workspace.TryApplyChanges(doc.Project.Solution); 1329workspace.TryApplyChanges(project.RemoveAdditionalDocument(doc.Id).Solution); 1350workspace.TryApplyChanges(doc.Project.Solution); 1357workspace.TryApplyChanges(project.RemoveAnalyzerConfigDocument(doc.Id).Solution);
Microsoft.CodeAnalysis.CSharp.Features (37)
ChangeSignature\CSharpChangeSignatureService.cs (1)
873convertedType = SymbolFinder.FindSourceDefinition(convertedType, document.Project.Solution, cancellationToken)
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
71var solution = project.Solution;
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
218var editor = new SyntaxEditor(scope, document.Project.Solution.Services);
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (2)
44if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles 70document.Project.Solution, allDocumentIds, containerSpan, cancellationToken).ConfigureAwait(false);
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (1)
121var editor = new SyntaxEditor(root, document.Project.Solution.Services);
Completion\CompletionProviders\SnippetCompletionProvider.cs (3)
83var solution = document.Project.Solution; 143completionContext, document.Project.Solution.Services, semanticModel, isPreProcessorContext: true); 159completionContext, document.Project.Solution.Services, semanticModel, isPreProcessorContext: false);
ConvertPrimaryToRegularConstructor\ConvertPrimaryToRegularConstructorCodeRefactoringProvider.cs (1)
92var solution = document.Project.Solution;
EncapsulateField\CSharpEncapsulateFieldService.cs (1)
107document.Project.Solution,
Formatting\CSharpAccessibilityModifiersNewDocumentFormattingProvider.cs (1)
42var editor = new SyntaxEditor(root, document.Project.Solution.Services);
ImplementInterface\AbstractChangeImplementationCodeRefactoringProvider.cs (1)
212var solution = project.Solution;
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
43var solution = project.Solution;
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (2)
41var currentSolution = document.WithSyntaxRoot(trackedRoot).Project.Solution; 81var solution = project.Solution;
NavigationBar\CSharpNavigationBarItemService.cs (1)
53return GetMembersInTypes(document.Project.Solution, tree, typesInFile, cancellationToken);
QuickInfo\CSharpDiagnosticAnalyzerQuickInfoProvider.cs (1)
134var hostAnalyzers = document.Project.Solution.SolutionState.Analyzers;
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (1)
272var editor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
91var solutionEditor = new SolutionEditor(document.Project.Solution);
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
106var editor = new SyntaxEditor(currentRoot, document.Project.Solution.Services);
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (3)
35var syntaxEditor = new SyntaxEditor(root, document.Project.Solution.Services); 54localFunctionSymbol, document.Project.Solution, documentImmutableSet, cancellationToken).ConfigureAwait(false); 126capture, document.Project.Solution, documentImmutableSet, cancellationToken).ConfigureAwait(false);
src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
49var editor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
63var editor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Analyzers\CSharp\CodeFixes\UpdateProjectToAllowUnsafe\CSharpUpdateProjectToAllowUnsafeCodeFixProvider.cs (1)
43return project.Solution.WithProjectCompilationOptions(project.Id, compilationOptions.WithAllowUnsafe(true));
src\Analyzers\CSharp\CodeFixes\UpgradeProject\CSharpUpgradeProjectCodeFixProvider.cs (2)
95return project.Solution.WithProjectParseOptions(project.Id, parseOptions.WithLanguageVersion(parsedNewVersion)); 100return project.Solution;
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (1)
42var services = document.Project.Solution.Services;
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
74var subEditor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
65var editor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
109document.Project.Solution.Services, currentRoot,
src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (2)
102var solutionEditor = new SolutionEditor(document.Project.Solution); 118var solution = document.Project.Solution;
src\Analyzers\CSharp\CodeFixes\UseSystemThreadingLock\CSharpUseSystemThreadingLockCodeFixProvider.cs (2)
67var solutionEditor = new SolutionEditor(document.Project.Solution); 82var solution = document.Project.Solution;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
45AddDocument("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;
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
44var editor = new SyntaxEditor(memberDeclaration, document.Project.Solution.Services);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (1)
41var solution = project.Solution;
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 (56)
AddImports\AbstractAddImportsPasteCommandHandler.cs (2)
137var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 166document.Project.Solution.Workspace.TryApplyChanges(updatedDocument.Project.Solution);
ChangeSignature\AbstractChangeSignatureCommandHandler.cs (1)
92HandleResult(result, document.Project.Solution, workspace, context);
CodeDefinitionWindow\DefinitionContextTracker.cs (3)
145var workspace = document.Project.Solution.Workspace; 155var text = await item.Document.GetTextAsync(document.Project.Solution, cancellationToken).ConfigureAwait(false); 174var definitionItem = symbol.ToNonClassifiedDefinitionItem(document.Project.Solution, includeHiddenLocations: false);
CommentSelection\AbstractCommentSelectionBase.cs (1)
154var formattedChanges = Formatter.GetFormattedTextChanges(newRoot, formattingSpans, document.Project.Solution.Services, formattingOptions, rules: default, cancellationToken);
EditAndContinue\ActiveStatementTrackingService.cs (2)
170var compileTimeSolution = _compileTimeSolutionProvider.GetCompileTimeSolution(designTimeDocument.Project.Solution); 354var solution = document.Project.Solution;
EditAndContinue\PdbMatchingSourceTextProvider.cs (1)
78var oldSolutionVersion = oldDocument.Project.Solution.WorkspaceVersion;
EncapsulateField\AbstractEncapsulateFieldCommandHandler.cs (2)
67var workspace = initialDocument.Project.Solution.Workspace; 107var solution = document.Project.Solution;
Extensibility\NavigationBar\AbstractEditorNavigationBarItemService.cs (1)
48var workspace = document.Project.Solution.Workspace;
ExternalAccess\IntelliCode\IntentProcessor.cs (2)
93newSolution = await newSolution.WithMergedLinkedFileChangesAsync(originalDocument.Project.Solution, cancellationToken: cancellationToken).ConfigureAwait(false); 99var docChanges = await GetTextChangesForDocumentAsync(newSolution, currentDocument.Project.Solution, changedDocumentId, cancellationToken).ConfigureAwait(false);
ExternalAccess\VSTypeScript\VSTypeScriptNavigationBarItemService.cs (1)
59var workspace = document.Project.Solution.Workspace;
ExtractInterface\AbstractExtractInterfaceCommandHandler.cs (1)
79if (!document.Project.Solution.Workspace.TryApplyChanges(result.UpdatedSolution))
ExtractMethod\ExtractMethodCommandHandler.cs (2)
116var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 223var notificationService = document.Project.Solution.Services.GetService<INotificationService>();
Formatting\FormatCommandHandler.cs (1)
85var ruleFactory = document.Project.Solution.Services.GetRequiredService<IHostDependentFormattingRuleFactoryService>();
Formatting\FormatCommandHandler.Paste.cs (1)
65var solution = document.Project.Solution;
GoToDefinition\AbstractGoToCommandHandler`2.cs (2)
191document.Project.Solution.Workspace, 262var service = document.Project.Solution.Services.GetRequiredService<IWorkspaceStatusService>();
GoToDefinition\GoToDefinitionCommandHandler.cs (2)
107var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 145var notificationService = document.Project.Solution.Services.GetRequiredService<INotificationService>();
InlineRename\AbstractEditorInlineRenameService.SymbolRenameInfo.cs (3)
135var solution = this.Document.Project.Solution; 157this.Document.Project.Solution.CanApplyChange(ApplyChangesKind.ChangeDocumentInfo)) 167var symbolSourceDocument = this.Document.Project.Solution.GetDocument(RenameSymbol.Locations.Single().SourceTree);
InlineRename\InlineRenameService.cs (2)
108document.Project.Solution.Workspace, 128var workspace = document.Project.Solution.Workspace;
InlineRename\InlineRenameSession.cs (1)
187_baseSolution = 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)
169document.Project, document.Project.Services, sourceText, triggerLocation.Position, roslynTrigger, options, document.Project.Solution.Options, _roles); 394document, triggerLocation, options, document.Project.Solution.Options, roslynTrigger, _roles, cancellationToken).ConfigureAwait(false); 536var supportedPlatforms = SymbolCompletionItem.GetSupportedPlatforms(roslynItem, document.Project.Solution);
Intents\DeleteParameterIntentProvider.cs (1)
62var changedDocuments = changeSignatureResult.UpdatedSolution.GetChangedDocuments(priorDocument.Project.Solution).ToImmutableArray();
Interactive\InteractiveSession.cs (2)
247solution = initProject.Solution.AddDocument( 254solution = newSubmissionProject.Solution.AddDocument(
Navigation\AbstractDefinitionLocationService.cs (2)
32var solution = document.Project.Solution; 131var solution = project.Solution;
NavigationBar\NavigationBarController.cs (1)
251workspace: d.Project.Solution.Workspace,
Preview\AbstractPreviewFactoryService.cs (6)
289using var rightWorkspace = new ReferenceCountedDisposable<PreviewWorkspace>(new PreviewWorkspace(document.Project.Solution)); 371using var leftWorkspace = new ReferenceCountedDisposable<PreviewWorkspace>(new PreviewWorkspace(document.Project.Solution)); 486var leftSolution = oldDocument.Project.Solution; 493var rightSolution = newDocument.Project.Solution; 553using var leftWorkspace = new ReferenceCountedDisposable<PreviewWorkspace>(new PreviewWorkspace(oldDocument.Project.Solution)); 556using var rightWorkspace = new ReferenceCountedDisposable<PreviewWorkspace>(new PreviewWorkspace(newDocument.Project.Solution));
RenameTracking\RenameTrackingCancellationCommandHandler.cs (1)
43RenameTrackingDismisser.DismissVisibleRenameTracking(document.Project.Solution.Workspace, document.Id);
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCodeAction.cs (1)
94_document.Project.Solution.Services.GetService<INotificationService>()
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (2)
129var workspace = document.Project.Solution.Workspace; 198var solution = document.Project.Solution;
RenameTracking\RenameTrackingTaggerProvider.TrackingSession.cs (2)
224var sourceSymbol = SymbolFinder.FindSourceDefinition(symbol, document.Project.Solution, _cancellationToken) ?? symbol; 238var sourceSymbol = SymbolFinder.FindSourceDefinition(symbol, document.Project.Solution, _cancellationToken) ?? symbol;
SpellCheck\RoslynSpellCheckFixerProvider.cs (1)
109var workspace = document.Project.Solution.Workspace;
Structure\AbstractStructureTaggerProvider.cs (1)
74if (openDocument.Project.Solution.Workspace is MetadataAsSourceWorkspace masWorkspace &&
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (9)
Completion\AbstractCompletionProviderTests.cs (3)
659document.Project.Solution.Workspace.TryApplyChanges(newDoc.Project.Solution); 1286var isTextualTriggerCharacterResult = service.ShouldTriggerCompletion(document.Project, document.Project.Services, text, position + 1, trigger, options, document.Project.Solution.Options, GetRoles(document));
Diagnostics\GenerateType\GenerateTypeTestState.cs (2)
67return (TestGenerateTypeOptionsService)InvocationDocument.Project.Solution.Services.GetRequiredService<IGenerateTypeOptionsService>(); 75return (TestProjectManagementService)InvocationDocument.Project.Solution.Services.GetService<IProjectManagementService>();
Diagnostics\GenerateType\TestGenerateTypeOptionsService.cs (1)
55DefaultNamespace ??= projectManagementService.GetDefaultNamespace(Project, Project?.Solution.Workspace);
ExtractInterface\ExtractInterfaceTestState.cs (1)
73return (TestExtractInterfaceOptionsService)ExtractFromDocument.Project.Solution.Services.GetService<IExtractInterfaceOptionsService>();
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
429.Solution; 441.Solution;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (29)
CodeFixes\CodeFixServiceTests.cs (6)
405extensionManager = (EditorLayerExtensionManager.ExtensionManager)document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 891var solution = await codeAction.GetChangedSolutionInternalAsync(txtDocument.Project.Solution, CodeAnalysisProgress.None); 949return document.Project.Solution.WithAdditionalDocumentText(document.Id, newText); 1078var appliedChanges = workspace.TryApplyChanges(sourceDocument.Project.Solution); 1089sourceDocument.Project.Solution, sourceDocument.Project.Id, sourceDocument.Id, diagnosticIds: null, shouldIncludeAnalyzer: null, getDocuments: null, 1154sourceDocument.Project.Solution, sourceDocument.Project.Id, sourceDocument.Id, CancellationToken.None);
CodeRefactorings\CodeRefactoringServiceTest.cs (5)
108var extensionManager = (EditorLayerExtensionManager.ExtensionManager)document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 180var solution = await codeAction.GetChangedSolutionInternalAsync(project.Solution, CodeAnalysisProgress.None); 219var solution = await codeAction.GetChangedSolutionInternalAsync(project.Solution, CodeAnalysisProgress.None); 248return document.Project.Solution.WithAdditionalDocumentText(document.Id, newText); 249return document.Project.Solution.WithAnalyzerConfigDocumentText(document.Id, newText);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (5)
177var applied = workspace.TryApplyChanges(document.Project.Solution); 405var incrementalAnalyzer = service.CreateIncrementalAnalyzer(project.Solution.Workspace); 445var applied = workspace.TryApplyChanges(project.Solution); 749workspace.TryApplyChanges(project.Solution); 859Assert.True(workspace.TryApplyChanges(workspace.CurrentSolution.Projects.Single().AddAnalyzerReference(new TestGeneratorReference(generator)).Solution));
Diagnostics\DiagnosticDataTests.cs (3)
265secondDocument = firstDocument.Project.Solution.AddProject("TestProject2", "TestProject2", LanguageNames.CSharp) 273firstDocument = secondDocument.Project.Solution.GetRequiredDocument(firstDocument.Id); 297firstDocument = firstDocument.Project.Solution
LinkedFiles\LinkedFileDiffMergingEditorTests.cs (2)
103var linkedDocument = document.Project.Solution.Projects.Single(p => p != document.Project).Documents.Single(); 107var newSolution = document.Project.Solution
Preview\PreviewWorkspaceTests.cs (6)
56Assert.True(previewWorkspace.TryApplyChanges(project.Solution)); 70Assert.True(previewWorkspace.TryApplyChanges(project.Solution)); 74.AddDocument("document", "").Project.Solution; 80var changedSolution = previewWorkspace.CurrentSolution.Projects.First().Documents.First().WithText(SourceText.From(text)).Project.Solution; 86.RemoveDocument(previewWorkspace.CurrentSolution.Projects.First().DocumentIds[0]).Solution; 102Assert.True(previewWorkspace.TryApplyChanges(document.Project.Solution));
TextEditor\OpenDocumentTests.cs (2)
64Assert.Same(workspace.CurrentSolution, newDocumentWithChanges.Project.Solution); 70Assert.NotSame(workspace.CurrentSolution, originalDocumentWithChanges.Project.Solution);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (11)
InlineDiagnostics\AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs (1)
107var workspace = project.Solution.Workspace;
NavigableSymbols\NavigableSymbolService.NavigableSymbolSource.cs (1)
49var indicatorFactory = document.Project.Solution.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>();
Peek\PeekableItemFactory.cs (1)
62var solution = project.Solution;
Peek\PeekableItemSource.cs (3)
75var services = document.Project.Solution.Services; 127var workspace = project.Solution.Workspace; 136var text = await document.GetTextAsync(project.Solution, cancellationToken).ConfigureAwait(false);
QuickInfo\ContentControlService.cs (1)
70var 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\SuggestedActionsSource_Async.cs (1)
211var workspace = document.Project.Solution.Workspace;
Suggestions\SuggestedActionWithNestedFlavors.cs (1)
52originalDocument.Project.Solution,
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (2)
Diagnostics\DiagnosticServiceTests.vb (1)
1423Dim descriptorsMap = project.Solution.SolutionState.Analyzers.GetDiagnosticDescriptorsPerReference(diagnosticService.AnalyzerInfoCache, project)
FindReferences\FindReferencesTests.vb (1)
386Function(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 (3)
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);
GoToDefinition\OmniSharpFindDefinitionService.cs (1)
25document.Project.Solution,
Microsoft.CodeAnalysis.ExternalAccess.Razor (22)
Cohost\Handlers\CodeActions.cs (2)
25var solution = document.Project.Solution; 46var solution = document.Project.Solution;
Cohost\Handlers\Completion.cs (3)
41var globalOptions = document.Project.Solution.Services.ExportProvider.GetService<IGlobalOptionService>(); 63var globalOptions = document.Project.Solution.Services.ExportProvider.GetService<IGlobalOptionService>(); 79var xmlSnippetParser = document.Project.Solution.Services.ExportProvider.GetService<XmlSnippetParser>();
Cohost\Handlers\Diagnostics.cs (2)
20var globalOptionsService = document.Project.Solution.Services.ExportProvider.GetService<IGlobalOptionService>(); 21var diagnosticAnalyzerService = document.Project.Solution.Services.ExportProvider.GetService<IDiagnosticAnalyzerService>();
Cohost\Handlers\DocumentHighlights.cs (2)
19var globalOptions = document.Project.Solution.Services.ExportProvider.GetService<IGlobalOptionService>(); 20var highlightingService = document.Project.Solution.Services.ExportProvider.GetService<IHighlightingService>();
Cohost\Handlers\FindAllReferences.cs (2)
22var globalOptions = document.Project.Solution.Services.ExportProvider.GetService<IGlobalOptionService>(); 23var metadataAsSourceFileService = document.Project.Solution.Services.ExportProvider.GetService<IMetadataAsSourceFileService>();
Cohost\Handlers\FoldingRanges.cs (1)
19var globalOptions = document.Project.Solution.Services.ExportProvider.GetService<IGlobalOptionService>();
Cohost\Handlers\GoToDefinition.cs (2)
20var globalOptions = document.Project.Solution.Services.ExportProvider.GetService<IGlobalOptionService>(); 21var metadataAsSourceFileService = document.Project.Solution.Services.ExportProvider.GetService<IMetadataAsSourceFileService>();
Cohost\Handlers\GoToImplementation.cs (1)
20var globalOptions = document.Project.Solution.Services.ExportProvider.GetService<IGlobalOptionService>();
Cohost\Handlers\Hover.cs (1)
23var globalOptions = document.Project.Solution.Services.ExportProvider.GetService<IGlobalOptionService>();
Cohost\Handlers\OnAutoInsert.cs (2)
22var globalOptions = document.Project.Solution.Services.ExportProvider.GetService<IGlobalOptionService>(); 23var services = document.Project.Solution.Services.ExportProvider.GetExports<IBraceCompletionService, LanguageMetadata>().Where(s => s.Metadata.Language == LanguageNames.CSharp).SelectAsArray(s => s.Value);
Cohost\Handlers\SignatureHelp.cs (1)
18var signatureHelpService = document.Project.Solution.Services.ExportProvider.GetService<SignatureHelpService>();
RazorClassifierAccessor.cs (1)
20document.Project.Solution.Services, document.Project, semanticModel, textSpan, options.UnderlyingObject, cancellationToken);
RazorCSharpFormattingInteractionService.cs (1)
50var formattingOptions = GetFormattingOptions(document.Project.Solution.Services, indentationOptions);
RazorSpanMappingServiceWrapper.cs (1)
36var diffService = newDocument.Project.Solution.Services.GetRequiredService<IDocumentTextDifferencingService>();
Microsoft.CodeAnalysis.ExternalAccess.Xaml (4)
Internal\DescriptionService.cs (1)
66var services = project.Solution.Services;
Internal\LocationService.cs (3)
49var items = NavigableItemFactory.GetItemsFromPreferredSourceLocations(project.Solution, symbol, displayTaggedParts: null, cancellationToken); 54var document = await item.Document.GetRequiredDocumentAsync(project.Solution, cancellationToken).ConfigureAwait(false); 64var declarationFile = await _metadataAsSourceFileService.GetGeneratedFileAsync(project.Solution.Workspace, project, symbol, signaturesOnly: true, options: options, cancellationToken: cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Features (236)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (2)
50var services = _document.Project.Solution.Services; 69return Task.FromResult<Solution?>(constructorDocument.WithSyntaxRoot(newRoot).Project.Solution);
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.cs (1)
186priorDocument.Project.Solution, CodeAnalysisProgress.None, postProcessChanges: true, cancellationToken).ConfigureAwait(false);
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
118var editor = new SyntaxEditor(syntaxRoot, document.Project.Solution.Services);
AddImport\AbstractAddImportCodeFixProvider.cs (1)
59var services = document.Project.Solution.Services;
AddImport\AbstractAddImportFeatureService.cs (7)
73document.Project.Solution, 145var projectToAssembly = new ConcurrentDictionary<Project, AsyncLazy<IAssemblySymbol>>(concurrencyLevel: 2, capacity: project.Solution.ProjectIds.Count); 146var referenceToCompilation = new ConcurrentDictionary<PortableExecutableReference, Compilation>(concurrencyLevel: 2, capacity: project.Solution.Projects.Sum(p => p.MetadataReferences.Count)); 167=> project.Solution.WorkspaceKind is WorkspaceKind.Host or WorkspaceKind.RemoteWorkspace; 326var solution = project.Solution; 456var solution = project.Solution; 546document.Project.Solution,
AddImport\CodeActions\AssemblyReferenceCodeAction.cs (2)
46var operation = new ApplyChangesOperation(newProject.Solution); 101return new ApplyChangesOperation(newProject.Solution);
AddImport\CodeActions\InstallPackageAndAddImportCodeAction.cs (2)
59this.OriginalDocument.Project.Solution, cancellationToken).ConfigureAwait(false)); 75return 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)
46var applyOperation = new ApplyChangesOperation(projectWithAddedReference.Solution);
AddImport\CodeActions\SymbolReference.SymbolReferenceCodeAction.cs (1)
58return updatedProject ?? new ApplyChangesOperation(updatedDocument.Project.Solution);
AddImport\SearchScopes\MetadataSymbolsSearchScope.cs (1)
38var service = _assemblyProject.Solution.Services.GetRequiredService<ISymbolTreeInfoCacheService>();
AddImport\SearchScopes\SourceSymbolsProjectSearchScope.cs (1)
32var service = _project.Solution.Services.GetRequiredService<ISymbolTreeInfoCacheService>();
AddMissingReference\AddMissingReferenceCodeAction.cs (2)
31var dependencyGraph = project.Solution.GetProjectDependencyGraph(); 52var candidateProject = project.Solution.GetRequiredProject(candidateProjectId);
AddPackage\AbstractAddPackageCodeFixProvider.cs (1)
34var workspaceServices = document.Project.Solution.Services;
AddPackage\InstallPackageDirectlyCodeActionOperation.cs (1)
52_document.Project.Solution, packageName, versionOpt).ToList();
ChangeSignature\AbstractChangeSignatureService.cs (2)
110symbol = SymbolFinder.FindSourceDefinition(symbol, document.Project.Solution, cancellationToken) ?? symbol; 161var solution = document.Project.Solution;
ChangeSignature\ChangeSignatureAnalyzedContext.cs (1)
19public Solution Solution => Document.Project.Solution;
CodeFixes\Configuration\ConfigurationUpdater.cs (8)
258return currentProject.Solution; 267return _project.Solution; 270var solution = editorConfigDocument.Project.Solution; 294if (_project.Solution?.FilePath == null) 304var currentSolution = _project.Solution; 305foreach (var projectId in _project.Solution.ProjectIds) 314currentSolution = addedAnalyzerConfigDocument.Project.Solution; 336var newSolution = project.Solution.AddAnalyzerConfigDocuments([documentInfo]);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.AbstractGlobalSuppressMessageCodeAction.cs (1)
37new ApplyChangesOperation(changedSuppressionDocument.Project.Solution),
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.GlobalSuppressMessageFixAllCodeAction.cs (2)
73var currentSolution = triggerDocument.Project.Solution; 102var currentSolution = triggerProject.Solution;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningCodeAction.cs (1)
87=> Formatter.Format(node, _document.Project.Solution.Services, _options, cancellationToken);
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Attribute.cs (2)
67return _project.Solution; 72return editor.GetChangedDocument().Project.Solution;
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (1)
221=> Formatter.Format(node, _document.Project.Solution.Services, _options, cancellationToken);
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (5)
46var solution = document.Project.Solution; 82var solution = document.Project.Solution; 170var services = document.Project.Solution.Services; 220document.Project.Solution, progressTracker, cancellationToken).ConfigureAwait(false); 224newSolution = document.Project.Solution;
CodeRefactorings\CodeRefactoringService.cs (2)
76if (document.Project.Solution.WorkspaceKind == WorkspaceKind.Interactive) 213var extensionManager = textDocument.Project.Solution.Services.GetRequiredService<IExtensionManager>();
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (2)
58return document.Project.Solution; 71return modifiedSolution ?? document.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (3)
64var solutionWithNewDocument = documentWithMovedType.Project.Solution; 158var solutionWithNewDocument = projectToBeUpdated.Solution.AddDocument( 248return updatedDocument.Project.Solution;
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeNamespaceScopeEditor.cs (1)
86return changedDocument.Project.Solution;
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (4)
134var solution = document.Project.Solution; 193var solution = document.Project.Solution; 346var solution = document.Project.Solution; 552symbol, document.Project.Solution, progress, documents: null,
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
40var solution = _state.Document.Project.Solution;
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (1)
171var solution = document.Project.Solution;
Completion\CompletionOptions.cs (1)
79var solution = document.Project.Solution;
Completion\CompletionProvider.cs (1)
58=> ShouldTriggerCompletion(document.Project.Services, await document.GetValueTextAsync(cancellationToken).ConfigureAwait(false), caretPosition, trigger, options, document.Project.Solution.Options);
Completion\CompletionService.cs (2)
215var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 247var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>();
Completion\CompletionService.ProviderManager.cs (1)
98if (project is null || project.Solution.WorkspaceKind == WorkspaceKind.Interactive)
Completion\CompletionService_GetCompletions.cs (3)
48var passThroughOptions = options ?? document.Project.Solution.Options; 155var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 329var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>();
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 (1)
159document.Project.Solution,
Completion\Providers\AbstractPreprocessorCompletionProvider.cs (1)
22var solution = originatingDocument.Project.Solution;
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (2)
215var relatedDocumentIds = document.Project.Solution.GetRelatedDocumentIds(document.Id); 230var relatedDocument = document.Project.Solution.GetRequiredDocument(documentId);
Completion\Providers\AbstractSymbolCompletionProvider.cs (2)
263supportedPlatformData = new SupportedPlatformData(completionContext.Document.Project.Solution, invalidProjects.ToImmutable(), totalProjects); 412var solution = document.Project.Solution;
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionProvider.cs (1)
216document.Project.Solution.Services.GetRequiredService<IDocumentSupportsFeatureService>().SupportsRefactorings(document);
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
76var solution = currentProject.Solution;
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (5)
61=> project.Solution.Services.GetRequiredService<IImportCompletionCacheService<ExtensionMethodImportCompletionCacheEntry, object>>(); 83await SymbolTreeInfo.GetInfoForMetadataReferenceAsync(project.Solution, peReference, checksum: null, cancellationToken).ConfigureAwait(false); 144var graph = project.Solution.GetProjectDependencyGraph(); 146return [.. relevantProjectIds.Select(project.Solution.GetRequiredProject).Where(p => p.SupportsCompilation)]; 208_originatingDocument.Project.Solution, peReference, checksum: null, cancellationToken).ConfigureAwait(false);
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
147document.Project.Solution.Services,
Completion\Providers\SymbolCompletionItem.cs (6)
150var linkedDoc = document.Project.Solution.GetRequiredDocument(id); 201var supportedPlatforms = GetSupportedPlatforms(item, document.Project.Solution); 205var services = document.Project.Solution.Services; 216return document.Project.Solution.GetRequiredDocument(contextId); 361var supportedPlatforms = GetSupportedPlatforms(item, document.Project.Solution); 365return await CommonCompletionUtilities.CreateDescriptionAsync(document.Project.Solution.Services, semanticModel, position, symbols, options, supportedPlatforms, cancellationToken).ConfigureAwait(false);
ConvertAutoPropertyToFullProperty\AbstractConvertAutoPropertyToFullPropertyCodeRefactoringProvider.cs (1)
94var editor = new SyntaxEditor(root, document.Project.Solution.Services);
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
419var services = document.Project.Solution.Services;
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (1)
151var editor = new SyntaxEditor(converter.ForEachInfo.SemanticModel.SyntaxTree.GetRoot(cancellationToken), document.Project.Solution.Services);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (5)
193var hostServices = document.Project.Solution.Services 223var solution = document.Project.Solution; 438var solution = startingProject.Solution; 524var solution = startingDocument.Project.Solution; 586var currentSolution = startingDocument.Project.Solution;
DesignerAttribute\DesignerAttributeDiscoveryService.cs (2)
64var solutionServices = project.Solution.Services; 65var solutionKey = SolutionKey.ToSolutionKey(project.Solution);
DocumentHighlighting\AbstractDocumentHighlightsService.cs (4)
39var solution = document.Project.Solution; 73var solution = document.Project.Solution; 126symbol, document.Project.Solution, progress, 166var solution = startingDocument.Project.Solution;
DocumentSpanExtensions.cs (1)
16var solution = documentSpan.Document.Project.Solution;
EditAndContinue\DebuggingSession.cs (1)
812var newSolution = newProject.Solution;
EditAndContinue\EditSession.cs (2)
470var generatorDiagnostics = await project.Solution.CompilationState.GetSourceGeneratorDiagnosticsAsync(project.State, cancellationToken).ConfigureAwait(false); 487return await project.Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(project.State, cancellationToken).ConfigureAwait(false);
EditAndContinue\Remote\RemoteDebuggingSessionProxy.cs (1)
189document.Project.Solution,
EmbeddedLanguages\Classification\AbstractEmbeddedLanguageClassificationService.cs (1)
48project.Solution.Services, project, semanticModel, textSpans, options, result, cancellationToken);
EncapsulateField\AbstractEncapsulateFieldService.cs (5)
117var solution = document.Project.Solution; 145var currentSolution = document.Project.Solution; 181var solution = document.Project.Solution; 221document, document.Project.Solution, field, generatedProperty, cancellationToken).ConfigureAwait(false); 226return documentWithProperty.Project.Solution;
ExternalAccess\UnitTesting\API\UnitTestingSearchHelpers.cs (4)
31var client = await RemoteHostClient.TryGetClientAsync(project.Solution.Services, cancellationToken).ConfigureAwait(false); 42return await location.Value.Value.TryRehydrateAsync(project.Solution, cancellationToken).ConfigureAwait(false); 54var client = await RemoteHostClient.TryGetClientAsync(project.Solution.Services, cancellationToken).ConfigureAwait(false); 67result.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)
29var solution = context.Document.Project.Solution;
ExtractInterface\AbstractExtractInterfaceService.cs (2)
140var solution = refactoringResult.DocumentToExtractFrom.Project.Solution; 269var service = document.Project.Solution.Services.GetRequiredService<IExtractInterfaceOptionsService>();
ExtractMethod\MethodExtractor.cs (2)
128if (!codeGenService.CanAddTo(destination, document.Project.Solution, cancellationToken)) 155var services = document.Project.Solution.Services;
FindUsages\AbstractFindUsagesService_FindImplementations.cs (2)
44var solution = project.Solution; 76var solution = project.Solution;
FindUsages\AbstractFindUsagesService_FindReferences.cs (5)
31document.Project.Solution, definitionTrackingContext.GetDefinitions(), cancellationToken).ConfigureAwait(false); 132var solution = project.Solution; 165project.Solution, symbol, context, searchOptions, classificationOptions); 167symbol, project.Solution, progress, documents: null, searchOptions, cancellationToken); 222var solution = document.Project.Solution;
FindUsages\FindUsagesHelpers.cs (1)
43var mappingService = document.Project.Solution.Services.GetService<ISymbolMappingService>();
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (1)
152document.Project.Solution,
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (1)
112priorDocument.Project.Solution, codeAction, progressTracker, cancellationToken).ConfigureAwait(false);
GenerateOverrides\GenerateOverridesWithDialogCodeAction.cs (2)
40var services = _document.Project.Solution.Services; 74_document.Project.Solution,
GenerateType\AbstractGenerateTypeService.CodeAction.cs (3)
102var generateTypeOptionsService = _document.Project.Solution.Services.GetRequiredService<IGenerateTypeOptionsService>(); 103var notificationService = _document.Project.Solution.Services.GetService<INotificationService>(); 104var projectManagementService = _document.Project.Solution.Services.GetService<IProjectManagementService>();
GenerateType\AbstractGenerateTypeService.Editor.cs (3)
70Contract.ThrowIfFalse(document.Project.Solution == generateTypeOptionsResult.Project.Solution); 273var newSolution = projectToBeUpdated.Solution.AddDocument(newDocumentId, documentName, string.Empty, folders, fullFilePath); 350var updatedSolution = projectToBeUpdated.Solution.AddDocument(
GoToBase\AbstractGoToBaseService.cs (1)
43var solution = project.Solution;
GoToDefinition\AbstractGoToDefinitionSymbolService.cs (1)
26var services = document.Project.Solution.Services;
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
36var solution = document.Project.Solution;
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (3)
58var solution = project.Solution; 88var mappingService = document.Project.Solution.Services.GetRequiredService<ISymbolMappingService>(); 247var destinationDocument = document.Project.Solution.GetDocument(groupSyntaxTree);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
362var editor = new SyntaxEditor(root, document.Project.Solution.Services);
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (3)
377var currentSolution = document.WithSyntaxRoot(trackedRoot).Project.Solution; 435var solutionWithAssignmentAdded = documentWithMemberAdded.Project.Solution; 480var services = document.Project.Solution.Services;
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (1)
339var solution = document.Project.Solution;
InlineMethod\AbstractInlineMethodRefactoringProvider.InlineContext.cs (2)
54var calleeDocument = document.Project.Solution.GetRequiredDocument(calleeMethodNode.SyntaxTree); 297.FindReferencesAsync(symbol, document.Project.Solution, ImmutableHashSet<Document>.Empty.Add(document), cancellationToken)
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (2)
164var calleeDocument = document.Project.Solution.GetRequiredDocument(calleeMethodNode.SyntaxTree); 442.FindReferencesAsync(parameterSymbol, document.Project.Solution, ImmutableHashSet<Document>.Empty.Add(document), cancellationToken).ConfigureAwait(false);
InlineTemporary\AbstractInlineTemporaryCodeRefactoringProvider.cs (1)
40local, document.Project.Solution, options, cancellationToken).ConfigureAwait(false);
IntroduceParameter\AbstractIntroduceParameterCodeRefactoringProvider.cs (2)
241var modifiedSolution = originalDocument.Project.Solution; 276methodSymbol, document.Project.Solution, progress,
InvertConditional\AbstractInvertConditionalCodeRefactoringProvider.cs (1)
49var editor = new SyntaxEditor(root, document.Project.Solution.Services);
MetadataAsSource\AbstractMetadataAsSourceService.cs (1)
35document.Project.Solution,
MetadataAsSource\MetadataAsSourceGeneratedFileInfo.cs (1)
37: sourceProject.Solution.Services.GetLanguageServices(LanguageName).GetRequiredService<ISyntaxTreeFactoryService>().GetDefaultParseOptionsWithLatestLanguageVersion();
MetadataAsSource\SymbolMappingServiceFactory.cs (1)
34if (document.Project.Solution.WorkspaceKind is not WorkspaceKind.MetadataAsSource)
MoveToNamespace\AbstractMoveToNamespaceService.cs (1)
211var originalSolution = document.Project.Solution;
NameTupleElement\AbstractNameTupleElementCodeRefactoringProvider.cs (1)
43if (document.Project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles)
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (1)
58var linkedDocument = document.Project.Solution.GetRequiredDocument(linkedDocumentId);
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (1)
27var solution = document.Project.Solution;
NavigateTo\RoslynNavigateToItem.cs (1)
148var solution = firstProject.Solution;
Navigation\INavigableItem.cs (1)
61document.Project.Solution.TryGetWorkspace());
PullMemberUp\MembersPuller.cs (2)
95var solution = document.Project.Solution; 270var solution = document.Project.Solution;
RelatedDocuments\AbstractRelatedDocumentsService.cs (1)
70var 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 (3)
162var originalSolution = project.Solution; 216return originalDocument.Project.Solution; 220var editor = new SyntaxEditor(root, originalDocument.Project.Solution.Services);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (2)
84var originalSolution = document.Project.Solution; 220var editor = new SyntaxEditor(root, originalDocument.Project.Solution.Services);
SemanticSearch\SemanticSearchUtilities.cs (1)
79=> GetQueryDocumentId(document.Project.Solution) == document.Id;
Shared\Extensions\DocumentExtensions.cs (2)
66values = await getItemsWorker(document.Project.Solution.GetRequiredDocument(linkedDocumentId)).ConfigureAwait(false); 83var solution = document.Project.Solution;
Shared\Utilities\ExtractTypeHelpers.cs (1)
127return 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.ToImmutableAndClear(), totalProjects);
SignatureHelp\SignatureHelpService.cs (1)
67var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>();
SpellCheck\AbstractSpellCheckCodeFixProvider.cs (1)
128var passThroughOptions = document.Project.Solution.Options;
src\Analyzers\Core\CodeFixes\AddParameter\AddParameterService.cs (2)
89var solution = invocationDocument.Project.Solution; 218method, invocationDocument.Project.Solution, cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\ConvertToAsync\AbstractConvertToAsyncCodeFixProvider.cs (1)
72var otherDocument = document.Project.Solution.GetDocument(syntaxTree);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (2)
453document.Project.Solution, 499document.Project.Solution,
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\GenerateDefaultConstructorsCodeAction.cs (1)
42_document.Project.Solution,
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (2)
26var languageServices = _document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(_state.TypeToGenerateIn.Language); 36_document.Project.Solution,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (3)
67var syntaxFactory = _document.Project.Solution.Services.GetLanguageServices(_state.TypeToGenerateIn.Language).GetService<SyntaxGenerator>(); 75_document.Project.Solution, 91_document.Project.Solution,
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
57var semanticFacts = document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(state.TypeToGenerateIn.Language).GetService<ISemanticFactsService>();
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (2)
90var solution = _project.Solution; 128var solution = _project.Solution;
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
47var canGenerateMember = CodeGenerator.CanAdd(document.Project.Solution, state.TypeToGenerateIn, cancellationToken);
src\Analyzers\Core\CodeFixes\ImplementAbstractClass\ImplementAbstractClassData.cs (1)
60if (!CodeGenerator.CanAdd(document.Project.Solution, classType, cancellationToken))
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceService.State.cs (1)
55if (!CodeGenerator.CanAdd(document.Project.Solution, classOrStructType, cancellationToken))
src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
96this.Document.Project.Solution,
src\Analyzers\Core\CodeFixes\MakeMethodAsynchronous\AbstractMakeMethodAsynchronousCodeFixProvider.cs (2)
164var solution = document.Project.Solution; 198return newDocument.Project.Solution;
src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (3)
77var solution = document.Project.Solution; 110var newSolution = newDocument.Project.Solution; 151return document.Project.Solution;
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (3)
27var service = context.Document.Project.Solution.Services.GetRequiredService<ISupportedChangesService>(); 63var newSolution = await renameActionSet.UpdateSolutionAsync(documentWithInvalidFolders.Project.Solution, cancellationToken).ConfigureAwait(false); 64Debug.Assert(newSolution != document.Project.Solution);
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.CustomFixAllProvider.cs (1)
45fixAllContext.Project.Solution,
src\Analyzers\Core\CodeFixes\NamingStyle\NamingStyleCodeFixProvider.cs (2)
92document.Project.Solution, 107document.Project.Solution, symbol, new SymbolRenameOptions(), fixedName,
src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (1)
67var solutionServices = document.Project.Solution.Services;
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (2)
303var editor = new SyntaxEditor(root, document.Project.Solution.Services); 924var referencedSymbols = await SymbolFinder.FindReferencesAsync(local, document.Project.Solution, cancellationToken).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (2)
43type, document.Project.Solution, cancellationToken); 50c => UnsealDeclarationsAsync(document.Project.Solution, definition.DeclaringSyntaxReferences, c),
src\Analyzers\Core\CodeFixes\UpgradeProject\AbstractUpgradeProjectCodeFixProvider.cs (1)
44var solution = project.Solution;
src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (1)
56var nestedEditor = new SyntaxEditor(root, document.Project.Solution.Services);
SymbolMapping\SymbolMappingResult.cs (1)
23public Solution Solution => Project.Solution;
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
40var solution = projects[0].Solution;
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
69var solution = context.Document.Project.Solution;
ValueTracking\ValueTracker.cs (3)
26var operationCollector = new OperationCollector(progressCollector, document.Project.Solution); 36var solution = document.Project.Solution; 68await progressCollector.TryReportAsync(document.Project.Solution, node.GetLocation(), symbol, cancellationToken).ConfigureAwait(false);
ValueTracking\ValueTrackingService.cs (1)
36var solution = document.Project.Solution;
Microsoft.CodeAnalysis.Features.Test.Utilities (5)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
477var newSolution = oldProject.Solution;
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (3)
110solution = project.Solution; 140solution = document.Project.Solution; 144return document.Project.Solution;
EditAndContinue\Extensions.cs (1)
71=> project.Solution.AddTestDocument(project.Id, source, path, out id);
Microsoft.CodeAnalysis.Features.UnitTests (10)
EditAndContinue\ActiveStatementsMapTests.cs (3)
118.AddDocument("doc", SourceText.From(source, Encoding.UTF8), filePath: "a.cs").Project.Solution; 173.AddDocument("doc", SourceText.From(source, Encoding.UTF8), filePath: "a.cs").Project.Solution; 224.AddDocument("doc", SourceText.From(source, Encoding.UTF8), filePath: "a.cs").Project.Solution;
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (4)
236solution = document.Project.Solution; 573solution = project.Solution; 767solution = project.Solution; 1142solution = project.Solution;
EditAndContinue\EditSessionActiveStatementsTests.cs (2)
76solution = project.Solution; 180solution = dummyProject.Solution.AddDocument(DocumentId.CreateNewId(dummyProject.Id, NoCompilationConstants.LanguageName), "a.dummy", "");
EditAndContinue\EmitSolutionUpdateResultsTests.cs (1)
75var solution = document.Project.Solution;
Microsoft.CodeAnalysis.LanguageServer (1)
LanguageServer\Handler\DebugConfiguration\WorkspaceDebugConfigurationHandler.cs (1)
50return new ProjectDebugConfiguration(project.FilePath!, project.OutputFilePath!, GetProjectName(project), targetsDotnetCore, isExe, project.Solution.FilePath);
Microsoft.CodeAnalysis.LanguageServer.Protocol (62)
Extensions\Extensions.cs (1)
158var solution = documents.First().Project.Solution;
Extensions\ProtocolConversions.cs (1)
819IsMiscellaneous = project.Solution.WorkspaceKind == WorkspaceKind.MiscellaneousFiles,
Extensions\ProtocolConversions.Diagnostics.cs (1)
119var informationService = project.Solution.Services.GetRequiredService<IDiagnosticProjectInformationService>();
ExternalAccess\Razor\FormatNewFileHandler.cs (1)
88root = Formatter.Format(root, project.Solution.Services, syntaxFormattingOptions, cancellationToken);
Features\CodeCleanup\AbstractCodeCleanupService.cs (3)
188var fixAllService = document.Project.Solution.Services.GetRequiredService<IFixAllGetFixesService>(); 253var solutionChanges = updatedDocument.Project.Solution.GetChanges(currentDocument.Project.Solution);
Features\CodeFixes\CodeFixService.cs (9)
231if (document.Project.Solution.WorkspaceKind != WorkspaceKind.Interactive && includeSuppressionFixes) 358var fixAllService = document.Project.Solution.Services.GetRequiredService<IFixAllGetFixesService>(); 371var workspaceFixersMap = GetFixerPerLanguageMap(document.Project.Solution.Services); 397var fixersPriorityByLanguageMap = GetFixerPriorityPerLanguageMap(document.Project.Solution.Services); 464var isInteractive = document.Project.Solution.WorkspaceKind == WorkspaceKind.Interactive; 507var extensionManager = document.Project.Solution.Services.GetService<IExtensionManager>(); 766var extensionManager = textDocument.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 971return document.Project.Solution.WorkspaceKind == WorkspaceKind.Interactive 978var extensionManager = document.Project.Solution.Services.GetService<IExtensionManager>();
Features\CodeFixes\CodeFixService.FixAllDiagnosticProvider.cs (3)
49var solution = document.Project.Solution; 71project.Solution, project.Id, documentId: null, _diagnosticIds, shouldIncludeAnalyzer: null, includeLocalDocumentDiagnostics: true, includeNonLocalDocumentDiagnostics: false, cancellationToken).ConfigureAwait(false)); 79project.Solution, project.Id, _diagnosticIds, shouldIncludeAnalyzer: null, includeNonLocalDocumentDiagnostics: false, cancellationToken).ConfigureAwait(false));
Features\Diagnostics\DiagnosticAnalyzerService.cs (2)
85var analyzer = CreateIncrementalAnalyzer(document.Project.Solution.Workspace); 105var analyzer = CreateIncrementalAnalyzer(project.Solution.Workspace);
Features\Diagnostics\DocumentAnalysisExecutor.cs (1)
401var diagnosticSpanMappingService = textDocument.Project.Solution.Services.GetService<IWorkspaceVenusSpanMappingService>();
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (2)
389foreach (var documentId in project.Solution.GetDocumentIdsWithFilePath(path)) 429var documentIds = targetTextDocument.Project.Solution.GetDocumentIdsWithFilePath(lineSpan.Path);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (1)
64var compilerAnalyzer = project.Solution.SolutionState.Analyzers.GetCompilerDiagnosticAnalyzer(project.Language);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.InProcOrRemoteHostAnalyzerRunner.cs (3)
96var options = project.Solution.Services.GetRequiredService<IWorkspaceConfigurationService>().Options; 101project.Solution, 231project.Solution,
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectState.cs (1)
212&& project.Solution.Services.GetService<ISolutionCrawlerOptionsService>()?.EnableDiagnosticsInSourceGeneratedFiles == true)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.HostStates.cs (3)
35var key = new HostAnalyzerStateSetKey(project.Language, project.State.HasSdkCodeStyleAnalyzers, project.Solution.SolutionState.Analyzers.HostAnalyzerReferences); 39var hostStateSets = ImmutableInterlocked.GetOrAdd(ref _hostAnalyzerStateMap, key, CreateLanguageSpecificAnalyzerMap, (project.Solution.SolutionState.Analyzers, referenceIdsToRedirect)); 88return GetFeaturesAnalyzerReferenceIds(project.Solution.SolutionState.Analyzers);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.ProjectStates.cs (1)
82var hostAnalyzers = project.Solution.SolutionState.Analyzers;
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnostics.cs (1)
164var document = await project.Solution.GetTextDocumentAsync(
Features\EditAndContinue\EditAndContinueDiagnosticSource_OpenDocument.cs (1)
27var designTimeSolution = designTimeDocument.Project.Solution;
Features\Options\BlockStructureOptionsStorage.cs (1)
12=> GetBlockStructureOptions(globalOptions, project.Language, isMetadataAsSource: project.Solution.WorkspaceKind == WorkspaceKind.MetadataAsSource);
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (3)
43var originalSolution = document.Project.Solution; 511var originalSolution = document.Project.Solution; 600var originalSolution = document.Project.Solution;
Handler\CodeActions\CodeActionFixAllResolveHandler.cs (1)
61var operations = await fixAllCodeAction.GetOperationsAsync(document.Project.Solution, CodeAnalysisProgress.None, cancellationToken).ConfigureAwait(false);
Handler\CodeActions\CodeActionHelpers.cs (2)
399document.Project.Solution.Workspace, codeFixService, document, textSpan, 404document.Project.Solution.Workspace, codeRefactoringService, document, textSpan, priority: null,
Handler\CodeActions\CodeActionResolveHandler.cs (1)
77var solution = document.Project.Solution;
Handler\CodeLens\CodeLensResolveHandler.cs (2)
67var codeLensReferencesService = document.Project.Solution.Services.GetRequiredService<ICodeLensReferencesService>(); 68var referenceCount = await codeLensReferencesService.GetReferenceCountAsync(document.Project.Solution, document.Id, memberToResolve.Node, maxSearchResults: 99, cancellationToken).ConfigureAwait(false);
Handler\Completion\CompletionHandler.cs (2)
93&& !completionService.ShouldTriggerCompletion(project, project.Services, documentText, position, completionTrigger, completionOptions, project.Solution.Options, roles: null)) 176var completionList = await completionService.GetCompletionsAsync(document, position, completionOptions, document.Project.Solution.Options, completionTrigger, cancellationToken: cancellationToken).ConfigureAwait(false);
Handler\Definitions\AbstractGoToDefinitionHandler.cs (2)
68await definition.Document.GetRequiredDocumentAsync(document.Project.Solution, cancellationToken).ConfigureAwait(false), 79var symbol = await SymbolFinder.FindSymbolAtPositionAsync(semanticModel, position, document.Project.Solution.Services, includeType: true, cancellationToken).ConfigureAwait(false);
Handler\Diagnostics\DiagnosticSources\AbstractWorkspaceDocumentDiagnosticSource.cs (1)
79Document.Project.Solution, Document.Project.Id, documentId: null,
Handler\Diagnostics\DiagnosticSources\NonLocalDocumentDiagnosticSource.cs (1)
29Document.Project.Solution, Document.Project.Id, Document.Id,
Handler\Formatting\AbstractFormatDocumentHandlerBase.cs (1)
43var services = document.Project.Solution.Services;
Handler\InlineCompletions\InlineCompletionsHandler.cs (1)
193var formattingChanges = Formatter.GetFormattedTextChanges(root, spanToFormat, originalDocument.Project.Solution.Services, formattingOptions, cancellationToken: cancellationToken)
Handler\PullHandlers\VersionedPullCache.cs (3)
78var workspace = project.Solution.Workspace; 81var isFullyLoaded = await IsFullyLoadedAsync(project.Solution, cancellationToken).ConfigureAwait(false); 84var cacheEntry = _idToLastReportedResult.GetOrAdd((project.Solution.Workspace, projectOrDocumentId), (_) => new CacheItem(uniqueKey));
Handler\Rename\RenameHandler.cs (1)
36var oldSolution = document.Project.Solution;
Handler\SemanticTokens\SemanticTokensRefreshQueue.cs (1)
44var projectChecksum = await project.Solution.CompilationState.GetChecksumAsync(project.Id, cancellationToken).ConfigureAwait(false);
Handler\SourceGenerators\SourceGeneratedDocumentCache.cs (2)
23var executionVersion = state.Document.Project.Solution.GetSourceGeneratorExecutionVersion(state.Document.Project.Id); 45var unfrozenDocument = await state.Document.Project.Solution.WithoutFrozenSourceGeneratedDocuments().GetDocumentAsync(state.Document.Id, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false);
Workspaces\LspWorkspaceManager.cs (2)
291var workspaceKind = document.Project.Solution.WorkspaceKind; 304return (workspace, document.Project.Solution, document);
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (6)
Workspaces\LspWorkspaceManagerTests.cs (6)
447await testWorkspaceTwo.ChangeProjectAsync(newProjectWorkspaceTwo.Id, newProjectWorkspaceTwo.Solution); 503await testWorkspace.ChangeProjectAsync(newProject.Id, newProject.Solution); 709Assert.Same(testLspServer.TestWorkspace.CurrentSolution, sourceGeneratedDocument.Project.Solution); 726Assert.NotSame(testLspServer.TestWorkspace.CurrentSolution, sourceGeneratedDocument.Project.Solution); 742Assert.Same(testLspServer.TestWorkspace.CurrentSolution, sourceGeneratedDocument.Project.Solution); 750Assert.NotSame(testLspServer.TestWorkspace.CurrentSolution, sourceGeneratedDocument.Project.Solution);
Microsoft.CodeAnalysis.Remote.ServiceHub (12)
Host\RemoteWorkspace.SolutionCreator.cs (8)
425return project.Solution; 500project = addDocuments(project.Solution, lazyDocumentsToAdd.ToImmutable()).GetProject(project.Id)!; 517project = removeDocuments(project.Solution, lazyDocumentsToRemove.ToImmutable()).GetProject(project.Id)!; 561TextDocumentKind.Document => document.Project.Solution.WithDocumentTextLoader(document.Id, loader, mode).GetRequiredDocument(document.Id), 562TextDocumentKind.AnalyzerConfigDocument => document.Project.Solution.WithAnalyzerConfigDocumentTextLoader(document.Id, loader, mode).GetRequiredAnalyzerConfigDocument(document.Id), 563TextDocumentKind.AdditionalDocument => document.Project.Solution.WithAdditionalDocumentTextLoader(document.Id, loader, mode).GetRequiredAdditionalDocument(document.Id), 587document = document.Project.Solution.WithDocumentFolders(document.Id, newDocumentInfo.Folders).GetDocument(document.Id)!; 594document = document.Project.Solution.WithDocumentSourceCodeKind(document.Id, newDocumentInfo.SourceCodeKind).GetDocument(document.Id)!;
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (2)
106_performanceTracker = project.Solution.Services.GetService<IPerformanceTrackerService>(); 559foreach (var reference in _project.Solution.AnalyzerReferences)
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (1)
125var solution = document.Project.Solution;
Services\SemanticClassification\RemoteSemanticClassificationService.cs (1)
39solution = document.Project.Solution;
Microsoft.CodeAnalysis.Remote.Workspaces (1)
SolutionAssetStorage.cs (1)
58=> StoreAssetsAsync(project.Solution.CompilationState, project.Id, cancellationToken);
Microsoft.CodeAnalysis.TestAnalyzerReference (2)
NonSourceFileRefactoring.cs (2)
30return document.Project.Solution.WithAdditionalDocumentText(document.Id, newText); 31return document.Project.Solution.WithAnalyzerConfigDocumentText(document.Id, newText);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (3)
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (2)
102Dim innerEditor = New SyntaxEditor(root, document.Project.Solution.Services) 136Dim editor = New SyntaxEditor(root, document.Project.Solution.Services)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\InitializeParameter\VisualBasicInitializeParameterService.vb (1)
55Return Task.FromResult(document.Project.Solution)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (7)
LineCommit\CommitBufferManager.vb (1)
311Dim refProject = project.Solution.GetProject(reference.ProjectId)
LineCommit\CommitCommandHandler.vb (1)
243Dim formattingRuleService = document.Project.Solution.Services.GetService(Of IHostDependentFormattingRuleFactoryService)()
NavigationBar\VisualBasicEditorNavigationBarItemService.vb (1)
48Dim destinationDocument = document.Project.Solution.GetDocument(navigationLocation.documentId)
NavigationBar\VisualBasicEditorNavigationBarItemService_CodeGeneration.vb (4)
146document.Project.Solution, 201document.Project.Solution, 245document.Project.Solution, 272document.Project.Solution,
Microsoft.CodeAnalysis.VisualBasic.Features (21)
ChangeSignature\VisualBasicChangeSignatureService.vb (2)
705convertedType = If(SymbolFinder.FindSourceDefinition(convertedType, document.Project.Solution, cancellationToken), convertedType) 724nodeType = If(SymbolFinder.FindSourceDefinition(nodeType, document.Project.Solution, cancellationToken), nodeType)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (13)
108Dim sourceDefinition = SymbolFinder.FindSourceDefinition(targetType, document.Project.Solution, cancellationToken) 127Dim codeGenService = document.Project.Solution.Services.GetLanguageServices(targetType.Language).GetService(Of ICodeGenerationService) 128Dim syntaxFactService = document.Project.Solution.Services.GetLanguageServices(targetType.Language).GetService(Of ISyntaxFactsService) 132document.Project.Solution, eventHandlerName, Not syntaxFactService.IsCaseSensitive, SymbolFilter.Type, cancellationToken).ConfigureAwait(False) 157Return New GenerateEventCodeAction(document.Project.Solution, targetType, generatedEvent, codeGenService) 259Dim targetType = TryCast(SymbolFinder.FindSourceDefinition(semanticModel.GetSymbolInfo(node.Left, cancellationToken).Symbol, document.Project.Solution, cancellationToken), INamedTypeSymbol) 269Dim codeGenService = document.Project.Solution.Services.GetLanguageServices(targetType.Language).GetService(Of ICodeGenerationService) 306Return New GenerateEventCodeAction(document.Project.Solution, targetType, generatedEvent, codeGenService) 310Return New GenerateEventCodeAction(document.Project.Solution, targetType, generatedMember, codeGenService) 350targetType = TryCast(SymbolFinder.FindSourceDefinition(withEventsProperty.Type, document.Project.Solution, cancellationToken), INamedTypeSymbol) 354targetType = TryCast(SymbolFinder.FindSourceDefinition(targetType, document.Project.Solution, cancellationToken), INamedTypeSymbol) 379Dim codeGenService = document.Project.Solution.Services.GetLanguageServices(originalTargetType.Language).GetService(Of ICodeGenerationService) 406document.Project.Solution, originalTargetType, generatedEvent, codeGenService)
CodeFixes\OverloadBase\OverloadBaseCodeFixProvider.AddKeywordAction.vb (1)
75Dim 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)
NavigationBar\VisualBasicNavigationBarItemService.vb (1)
55document.Project.Solution, type, position, semanticModel, workspaceSupportsDocumentChanges, symbolDeclarationService, cancellationToken))
src\Analyzers\VisualBasic\CodeFixes\RemoveUnnecessaryCast\VisualBasicRemoveUnnecessaryCastCodeFixProvider.vb (2)
102Dim innerEditor = New SyntaxEditor(root, document.Project.Solution.Services) 136Dim editor = New SyntaxEditor(root, document.Project.Solution.Services)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
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)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\InitializeParameter\VisualBasicInitializeParameterService.vb (1)
55Return Task.FromResult(document.Project.Solution)
Microsoft.CodeAnalysis.Workspaces (157)
Classification\AbstractClassificationService.cs (3)
83var workspaceStatusService = document.Project.Solution.Services.GetRequiredService<IWorkspaceStatusService>(); 191var extensionManager = document.Project.Solution.Services.GetRequiredService<IExtensionManager>(); 205AddSyntacticClassifications(document.Project.Solution.Services, root, textSpans, result, cancellationToken);
Classification\Classifier.cs (1)
35return 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 (2)
332return changedDocument?.Project.Solution; 354return changedDocument?.Project.Solution;
CodeActions\CodeAction_Cleanup.cs (1)
112document.Project.Solution,
CodeActions\Operations\ApplyChangesOperation.cs (2)
127var originalDocument = changedProject.OldProject.Solution.GetRequiredTextDocument(documentId); 128var changedDocument = changedProject.NewProject.Solution.GetRequiredTextDocument(documentId);
CodeFixes\CodeFix.cs (1)
79return DiagnosticData.Create(Project.Solution, diagnostic, Project);
CodeFixes\FixAllOccurrences\FixAllContext.DiagnosticProvider.cs (1)
86source: project.Solution.Projects,
CodeFixes\FixAllOccurrences\FixAllContextHelper.cs (1)
67var 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)
116documentsToFix = Project.Solution.Projects.SelectMany(p => p.Documents);
CodeRefactorings\SyntaxEditorBasedCodeRefactoringProvider.cs (1)
71var editor = new SyntaxEditor(root, document.Project.Solution.Services);
Diagnostics\DiagnosticData.cs (3)
176var diagnosticSpanMappingService = document?.Project.Solution.Services.GetService<IWorkspaceVenusSpanMappingService>(); 266builder.Add(CreateLocation(document.Project.Solution.GetDocument(location.SourceTree), location)); 317diagnosticData = Create(project.Solution, diagnostic, project);
Editing\DocumentEditor.cs (1)
19: base(root, document.Project.Solution.Services)
Editing\SymbolEditor.cs (2)
51return new SymbolEditor(document.Project.Solution); 292ChangedSolution = newDoc.Project.Solution;
FindSymbols\Declarations\DeclarationFinder.cs (1)
83project.Solution, reference, checksum: null, cancellationToken).ConfigureAwait(false);
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (2)
40var solution = project.Solution; 99var referencedProject = project.Solution.GetProject(projectReference.ProjectId);
FindSymbols\Declarations\DeclarationFinder_SourceDeclarations.cs (4)
85project.Solution, 94return await RehydrateAsync(project.Solution, result.Value, cancellationToken).ConfigureAwait(false); 151project.Solution, 160return await RehydrateAsync(project.Solution, result.Value, cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
345project.Solution, reference, checksum: null, cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\DependentTypeFinder_ProjectIndex.cs (2)
56var solutionKey = SolutionKey.ToSolutionKey(project.Solution); 59var sourceGeneratorDocumentStates = await project.Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(project.State, cancellationToken).ConfigureAwait(false);
FindSymbols\FindReferences\FindReferencesDocumentState.cs (1)
29public Solution Solution => this.Document.Project.Solution;
FindSymbols\Shared\AbstractSyntaxIndex_Persistence.cs (1)
147SolutionKey.ToSolutionKey(document.Project.Solution),
FindSymbols\SymbolFinder.cs (1)
132return await FindSymbolAtPositionAsync(semanticModel, position, document.Project.Solution.Services, cancellationToken).ConfigureAwait(false);
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (3)
36var solution = project.Solution; 56project.Solution.Services, 57SolutionKey.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);
FindSymbols\SyntaxTree\SyntaxTreeIndex.cs (3)
39=> GetRequiredIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 45=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 51=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, loadOnly, cancellationToken);
FindSymbols\TopLevelSyntaxTree\TopLevelSyntaxTreeIndex.cs (3)
47=> GetRequiredIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 53=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, cancellationToken); 59=> GetIndexAsync(SolutionKey.ToSolutionKey(document.Project.Solution), document.Project.State, (DocumentState)document.State, loadOnly, cancellationToken);
Formatting\Formatter.cs (3)
95var services = document.Project.Solution.Services; 116var services = document.Project.Solution.Services; 133var services = document.Project.Solution.Services;
Recommendations\Recommender.cs (1)
60options ??= project.Solution.Options;
Remote\RemoteArguments.cs (1)
56: Dehydrate(document.Project.Solution, alias, cancellationToken);
Remote\RemoteHostClient.cs (1)
38return TryGetClientAsync(project.Solution.Services, cancellationToken);
Remote\RemoteServiceConnection.cs (4)
82=> TryInvokeAsync(project.Solution.CompilationState, project.Id, invocation, cancellationToken); 88=> TryInvokeAsync(project.Solution.CompilationState, project.Id, invocation, cancellationToken); 132=> TryInvokeAsync(project.Solution.CompilationState, project.Id, invocation, cancellationToken); 138=> TryInvokeAsync(project.Solution.CompilationState, project.Id, invocation, cancellationToken);
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
654var newReferencedSymbols = RenameUtilities.GetSymbolsTouchingPosition(tokenOrNode.Span.Start, newDocumentSemanticModel, newDocument.Project.Solution.Services, _cancellationToken);
Rename\ConflictEngine\RenamedSpansTracker.cs (1)
217solution = document.Project.Solution;
Rename\Renamer.cs (1)
76=> RenameDocumentAsync(document, GetDocumentRenameOptions(optionSet ?? document.Project.Solution.Options), newDocumentName, newDocumentFolders, cancellationToken);
Rename\Renamer.RenameSymbolDocumentAction.cs (1)
38var solution = document.Project.Solution;
Rename\Renamer.SyncNamespaceDocumentAction.cs (1)
48return solution ?? document.Project.Solution;
Rename\RenameUtilities.cs (1)
306var definitionSymbol = await FindDefinitionSymbolAsync(symbol, document.Project.Solution, cancellationToken).ConfigureAwait(false);
Shared\Extensions\DocumentExtensions.cs (1)
26=> 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)
80&& SymbolFinder.FindSourceDefinition(overriddenProperty, document.Project.Solution, cancellationToken) 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); 258var simplificationService = document.Project.Solution.Services.GetRequiredLanguageService<ISimplificationService>(document.Project.Language);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\ForkingSyntaxEditorBasedCodeFixProvider.cs (1)
73var solutionServices = document.Project.Solution.Services;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\SyntaxEditorBasedCodeFixProvider.cs (1)
75var editor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (3)
98var workspace = document.Project.Solution.Workspace; 163var semanticModelService = document.Project.Solution.Services.GetRequiredService<ISemanticModelReuseWorkspaceService>(); 219var solution = document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (2)
40=> project.Solution.Services.GetExtendedLanguageServices(project.Language); 91var solutionOrProjectFilePath = project.Solution?.FilePath ?? project.FilePath;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\TextDocumentExtensions.cs (2)
51return textDocument.Project.Solution.WithAdditionalDocumentText(textDocument.Id, text, PreservationMode.PreserveIdentity).GetTextDocument(textDocument.Id)!; 60return textDocument.Project.Solution.WithAnalyzerConfigDocumentText(textDocument.Id, text, PreservationMode.PreserveIdentity).GetTextDocument(textDocument.Id)!;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (4)
108return document.Project.Solution; 124var editor = new SyntaxEditor(root, document.Project.Solution.Services); 128return newDocument.Project.Solution; 131return document.Project.Solution;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.cs (1)
84var editor = new SyntaxEditor(root, document.Project.Solution.Services);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
91var findReferencesResult = await SymbolFinder.FindReferencesAsync(LocalSymbol, document.Project.Solution, cancellationToken).ConfigureAwait(false);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Workspace\Host\SupportedChangesServiceExtensions.cs (1)
13=> project.Solution.Services.GetRequiredService<ISupportedChangesService>().CanApplyParseOptionChange(oldOptions, newOptions, project);
Workspace\Host\PersistentStorage\ProjectKey.cs (1)
35=> ToProjectKey(project.Solution.SolutionState, project.State);
Workspace\Solution\Document.cs (11)
333this.Project.Solution.OnSemanticModelObtained(this.Id, semanticModel); 386=> this.Project.Solution.WithDocumentSourceCodeKind(this.Id, kind).GetRequiredDocument(Id); 392=> this.Project.Solution.WithDocumentText(this.Id, text, PreservationMode.PreserveIdentity).GetRequiredDocument(Id); 398=> this.Project.Solution.WithDocumentSyntaxRoot(this.Id, root, PreservationMode.PreserveIdentity).GetRequiredDocument(Id); 404=> this.Project.Solution.WithDocumentName(this.Id, name).GetRequiredDocument(Id); 410=> this.Project.Solution.WithDocumentFolders(this.Id, folders).GetRequiredDocument(Id); 416=> this.Project.Solution.WithDocumentFilePath(this.Id, filePath).GetRequiredDocument(Id); 505var filteredDocumentIds = this.Project.Solution.GetRelatedDocumentIds(this.Id); 538var solution = this.Project.Solution; 547var newSolution = this.Project.Solution.WithFrozenPartialCompilationIncludingSpecificDocument(this.Id, cancellationToken); 574InitializeCachedOptions(Project.Solution.Options);
Workspace\Solution\Project.cs (49)
24/// Represents a project that is part of a <see cref="Solution"/>. 134public IEnumerable<ProjectReference> ProjectReferences => State.ProjectReferences.Where(pr => this.Solution.ContainsProject(pr.ProjectId)); 230=> Solution.GetDocumentId(syntaxTree, this.Id); 236=> Solution.GetDocument(syntaxTree, this.Id); 287var generatedDocumentStates = await Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(this.State, cancellationToken).ConfigureAwait(false); 319var generatedDocumentStates = await Solution.CompilationState.GetSourceGeneratedDocumentStatesAsync(State, cancellationToken).ConfigureAwait(false); 355var documentState = Solution.CompilationState.TryGetSourceGeneratedDocumentStateForAlreadyGeneratedId(documentId); 364return Solution.CompilationState.GetSourceGeneratorDiagnosticsAsync(this.State, cancellationToken); 369return Solution.CompilationState.GetSourceGeneratorRunResultAsync(this.State, cancellationToken); 483=> Solution.CompilationState.TryGetCompilation(this.Id, out compilation); 494=> Solution.CompilationState.GetCompilationAsync(State, cancellationToken); 501=> Solution.CompilationState.HasSuccessfullyLoadedAsync(State, cancellationToken); 531=> Solution.CompilationState.GetDependentVersionAsync(this.Id, cancellationToken); 538=> Solution.CompilationState.GetDependentSemanticVersionAsync(this.Id, cancellationToken); 573=> Solution.CompilationState.GetDependentChecksumAsync(this.Id, cancellationToken); 579=> this.Solution.WithProjectAssemblyName(this.Id, assemblyName).GetRequiredProject(Id); 585=> this.Solution.WithProjectDefaultNamespace(this.Id, defaultNamespace).GetRequiredProject(Id); 588=> Solution.WithProjectOutputFilePath(Id, path).GetRequiredProject(Id); 591=> Solution.WithProjectOutputRefFilePath(Id, path).GetRequiredProject(Id); 594=> Solution.WithProjectCompilationOutputInfo(Id, info).GetRequiredProject(Id); 600=> this.Solution.WithProjectCompilationOptions(this.Id, options).GetRequiredProject(Id); 606=> this.Solution.WithProjectParseOptions(this.Id, options).GetRequiredProject(Id); 613=> this.Solution.AddProjectReference(this.Id, projectReference).GetRequiredProject(Id); 620=> this.Solution.AddProjectReferences(this.Id, projectReferences).GetRequiredProject(Id); 626=> this.Solution.RemoveProjectReference(this.Id, projectReference).GetRequiredProject(Id); 633=> this.Solution.WithProjectReferences(this.Id, projectReferences).GetRequiredProject(Id); 640=> this.Solution.AddMetadataReference(this.Id, metadataReference).GetRequiredProject(Id); 647=> this.Solution.AddMetadataReferences(this.Id, metadataReferences).GetRequiredProject(Id); 653=> this.Solution.RemoveMetadataReference(this.Id, metadataReference).GetRequiredProject(Id); 660=> this.Solution.WithProjectMetadataReferences(this.Id, metadataReferences).GetRequiredProject(Id); 667=> this.Solution.AddAnalyzerReference(this.Id, analyzerReference).GetRequiredProject(Id); 674=> this.Solution.AddAnalyzerReferences(this.Id, analyzerReferences).GetRequiredProject(Id); 680=> this.Solution.RemoveAnalyzerReference(this.Id, analyzerReference).GetRequiredProject(Id); 687=> this.Solution.WithProjectAnalyzerReferences(this.Id, analyzerReferencs).GetRequiredProject(Id); 694=> Solution.WithProjectAttributes(attributes).GetRequiredProject(Id); 705return this.Solution.AddDocument(id, name, syntaxRoot, folders, filePath, preservationMode: PreservationMode.PreserveIdentity).GetDocument(id)!; 714return this.Solution.AddDocument(id, name, text, folders, filePath).GetDocument(id)!; 723return this.Solution.AddDocument(id, name, text, folders, filePath).GetDocument(id)!; 732return this.Solution.AddAdditionalDocument(id, name, text, folders, filePath).GetAdditionalDocument(id)!; 741return this.Solution.AddAdditionalDocument(id, name, text, folders, filePath).GetAdditionalDocument(id)!; 750return this.Solution.AddAnalyzerConfigDocument(id, name, text, folders, filePath).GetAnalyzerConfigDocument(id)!; 760return this.Solution.RemoveDocument(documentId).GetRequiredProject(Id); 770return this.Solution.RemoveDocuments(documentIds).GetRequiredProject(this.Id); 779=> this.Solution.RemoveAdditionalDocument(documentId).GetRequiredProject(Id); 788return this.Solution.RemoveAdditionalDocuments(documentIds).GetRequiredProject(this.Id); 797=> this.Solution.RemoveAnalyzerConfigDocument(documentId).GetRequiredProject(Id); 806return this.Solution.RemoveAnalyzerConfigDocuments(documentIds).GetRequiredProject(this.Id); 828=> Solution.FallbackAnalyzerOptions.GetValueOrDefault(Language, StructuredAnalyzerConfigOptions.Empty); 834=> Solution.SolutionState.Analyzers.GetSkippedAnalyzersInfo(this, infoCache);
Workspace\Solution\SolutionCompilationState.cs (1)
1768if (!projectWithCachedGeneratorState.Solution.CompilationState.TryGetCompilationTracker(projectWithCachedGeneratorState.Id, out var tracker) ||
Workspace\Workspace.cs (2)
834oldSolution.RemoveProject(projectId).AddProject(reloadedProjectInfo).GetRequiredProject(projectId)).Solution; 1491solution = project.Solution;
Workspace\Workspace_Editor.cs (4)
872newSolution = document.WithText(this.GetOpenDocumentText(oldSolution, docId)).Project.Solution; 881var oldSolution = oldProject.Solution; 882var newSolution = reloadedProject.Solution; 890newSolution = document.WithText(this.GetOpenDocumentText(oldSolution, docId)).Project.Solution;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (15)
NetCoreTests.cs (2)
176Assert.Equal(projectRefFilePath, project.Solution.GetProject(projectRefId).FilePath); 520Assert.Equal(projectRefFilePath, project.Solution.GetProject(projectRefId).FilePath);
VisualStudioMSBuildWorkspaceTests.cs (13)
345var p2 = p1.Solution.Projects.First(p => p.Language == LanguageNames.VisualBasic); 1224Assert.Single(project.Solution.ProjectIds); // didn't really open referenced project due to invalid file path. 1253Assert.Single(project.Solution.ProjectIds); // didn't really open referenced project due to invalid file path. 1286Assert.Single(project.Solution.ProjectIds); // didn't really open referenced project due to unrecognized extension. 1324Assert.Single(project.Solution.ProjectIds); 1348Assert.Single(project.Solution.ProjectIds); 1371Assert.Single(project.Solution.ProjectIds); 2473Assert.NotNull(project.Solution.GetProjectsByName("CSharpProject").SingleOrDefault()); 2911var noEncodingSolution = noEncodingDoc.Project.Solution; 2940workspace.TryApplyChanges(project.AddAnalyzerReference(aref).Solution); 2945workspace.TryApplyChanges(workspace.CurrentSolution.GetProject(project.Id).RemoveAnalyzerReference(aref).Solution); 2966workspace.TryApplyChanges(workspace.CurrentSolution.GetProject(project.Id).RemoveProjectReference(pref).Solution); 2973workspace.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 (92)
FindReferencesTests.cs (5)
188var references = await SymbolFinder.FindReferencesAsync(symbol, prj.Solution); 193references = await SymbolFinder.FindReferencesAsync(symbol, prj.Solution); 224var references = await SymbolFinder.FindReferencesAsync(symbol, prj.Solution); 292var references = await SymbolFinder.FindReferencesAsync(symbol, prj.Solution); 297references = await SymbolFinder.FindReferencesAsync(symbol, prj.Solution);
Formatter\FormatterTests.cs (1)
78document = document.Project.Solution.WithOptions(solutionOptions).GetRequiredDocument(document.Id);
SolutionTests\SolutionTests.cs (42)
2790.Project.Solution; 3697var doc2 = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot, PreservationMode.PreserveValue).GetDocument(doc.Id); 3700var observed2 = GetObservedSyntaxTreeRootAsync(doc2.Project.Solution, did); 4147var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { /*no top level change*/ } }")); 4192var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { } public void NewMethod() { } }")); 4257var frozenSolution = document.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution; 4369var solution = workspace.CurrentSolution.AddProject("TestProject", "TestProject", LanguageNames.CSharp).Solution; 4428currentSolution = document1.Project.Solution; 4432currentSolution = document2.Project.Solution; 4454var frozenDoc2 = frozenDoc1.Project.Solution.GetRequiredDocument(document2.Id); 4469var frozenDoc1 = frozenDoc2.Project.Solution.GetRequiredDocument(document1.Id); 5295.AddProject("CS2", "CS2", LanguageNames.CSharp).Solution 5296.AddProject("NC1", "NC1", NoCompilationConstants.LanguageName).Solution; 5435var s2 = s1.AddProject("P1", "A1", LanguageNames.VisualBasic).Solution; 5474var newDoc = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot).GetDocument(doc.Id); 5506static (sourceText, document) => document.Project.Solution.WithDocumentText(document.Id, sourceText, PreservationMode.PreserveIdentity), 5581.AddAdditionalDocument("File.cs", text: "", filePath: FilePath).Project.Solution; 5600.AddDocument("File.cs", "", filePath: "File.cs").Project.Solution 5602.AddDocument("file.cs", "", filePath: "file.cs").Project.Solution; 5617var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5636var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5650var project2 = project1.Solution.AddProject("CSharpProject2", "CSharpProject2", LanguageNames.CSharp); 5651project1 = project2.Solution.GetProject(project1.Id).AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project; 5652project2 = project1.Solution.GetProject(project2.Id).AddDocument("Doc2", SourceText.From("class Doc2 { }")).Project; 5653project1 = project2.Solution.GetProject(project1.Id); 5658var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5678var project2 = project1.Solution.AddProject("CSharpProject2", "CSharpProject2", LanguageNames.CSharp); 5679project1 = project2.Solution.GetProject(project1.Id).AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project; 5680project2 = project1.Solution.GetProject(project2.Id).AddDocument("Doc2", SourceText.From("class Doc2 { }")).Project; 5683project1 = project2.Solution.GetProject(project1.Id); 5688var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5708var project2 = project1.Solution.AddProject("CSharpProject2", "CSharpProject2", LanguageNames.CSharp); 5709project1 = project2.Solution.GetProject(project1.Id).AddDocument("Doc1", SourceText.From("class Doc1 { }")).Project; 5710project2 = project1.Solution.GetProject(project2.Id).AddDocument("Doc2", SourceText.From("class Doc2 { }")).Project; 5713project1 = project2.Solution.GetProject(project1.Id); 5718var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5748var frozenSolution = project1.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5786? project1.Solution.WithFrozenPartialCompilations(CancellationToken.None) 5787: project1.Solution; 5821var frozenSolution = project.Solution.WithFrozenPartialCompilations(CancellationToken.None); 5848var project2 = project1.Solution 5855_ => project2.Solution,
SolutionTests\SolutionWithSourceGeneratorTests.cs (31)
189var generatorDriver = project.Solution.CompilationState.GetTestAccessor().GetGeneratorDriver(project)!; 209generatorDriver = project.Solution.CompilationState.GetTestAccessor().GetGeneratorDriver(project)!; 233generatorDriver = project.Solution.CompilationState.GetTestAccessor().GetGeneratorDriver(project)!; 263project = project.Solution.WithDocumentText(documentId, SourceText.From("// Changed Source File")).Projects.Single(); 306project = project.Solution.WithAdditionalDocumentText(additionalDocumentId, SourceText.From("Hello, everyone!")).Projects.Single(); 311project = project.Solution.WithAdditionalDocumentText(additionalDocumentId, SourceText.From("Good evening, everyone!")).Projects.Single(); 373projectBeforeChange.Solution.WithAdditionalDocumentText( 410return project.Solution; 421.AddAdditionalDocument("Test.txt", "Hello, world!").Project.Solution; 592Assert.True(workspace.SetCurrentSolution(_ => project.Solution, WorkspaceChangeKind.SolutionChanged)); 601Assert.NotSame(workspace.CurrentSolution, generatedDocument.Project.Solution); 616Assert.True(workspace.SetCurrentSolution(_ => project.Solution, WorkspaceChangeKind.SolutionChanged)); 624Assert.Same(workspace.CurrentSolution, generatedDocument!.Project.Solution); 636Assert.True(workspace.SetCurrentSolution(_ => originalAdditionalFile.Project.Solution, WorkspaceChangeKind.SolutionChanged)); 661.AddAnalyzerReference(analyzerReference).Solution; 665new ProjectReference(projectIdWithGenerator)).Solution; 694Assert.True(workspace.SetCurrentSolution(_ => project.Solution, WorkspaceChangeKind.SolutionChanged)); 723Assert.True(workspace.SetCurrentSolution(_ => project.Solution, WorkspaceChangeKind.SolutionChanged)); 814var originalDocument2 = AddEmptyProject(originalDocument1.Project.Solution, name: "Project2") 818var frozenSolution = originalDocument2.WithFrozenPartialSemantics(CancellationToken.None).Project.Solution; 853project = project.Solution.AddDocument(documentInfo).Projects.Single() 887var frozenWithSingleDocument = project.Solution.WithFrozenSourceGeneratedDocument( 904var solution = AddEmptyProject(workspace.CurrentSolution).AddAnalyzerReference(analyzerReference).Solution; 907solution = project2.Solution; 934var frozenSolution = project.Solution.WithFrozenSourceGeneratedDocument( 936Assert.Same(project.Solution, frozenSolution.Project.Solution); 950var checksum0 = await project0.Solution.SolutionState.GetChecksumAsync(CancellationToken.None); 953var checksum1 = await project1.Solution.SolutionState.GetChecksumAsync(CancellationToken.None); 959var checksum2 = await project2.Solution.SolutionState.GetChecksumAsync(CancellationToken.None); 969var checksum3 = await project3.Solution.SolutionState.GetChecksumAsync(CancellationToken.None);
SolutionTests\TryApplyChangesTests.cs (4)
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)); 166Assert.True(workspace.TryApplyChanges(project.AddAnalyzerConfigDocument(".editorconfig", SourceText.From("")).Project.Solution));
SymbolKeyTests.cs (2)
875workspace.TryApplyChanges(document.WithText(updated).Project.Solution); 922workspace.TryApplyChanges(document.WithText(updated).Project.Solution);
WorkspaceTests\AdhocWorkspaceTests.cs (3)
432Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 499Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution)); 530Assert.True(ws.TryApplyChanges(changedDoc.Project.Solution));
WorkspaceTests\WorkspaceTests.cs (4)
30Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 46Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 81Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message); 97Assert.Throws<NotSupportedException>(() => ws.TryApplyChanges(changedDoc.Project.Solution)).Message);
Microsoft.Gen.ComplianceReports.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.ContextualOptions.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.Logging.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.MetadataExtractor.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.Metrics.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.MetricsReports.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Interop.ComInterfaceGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
140ct => ApplyActionAndEnableUnsafe(doc.Project.Solution, doc.Id, fix.ApplyFix, ct),
Microsoft.Interop.LibraryImportGenerator (4)
Analyzers\AddDisableRuntimeMarshallingAttributeFixer.cs (1)
68return editor.GetChangedDocument().Project.Solution;
Analyzers\ConvertToLibraryImportFixer.cs (1)
275methodSymbol, document.Project.Solution, cancellationToken).ConfigureAwait(false);
Analyzers\CustomMarshallerAttributeFixer.cs (1)
169SymbolEditor editor = SymbolEditor.Create(doc.Project.Solution);
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
140ct => ApplyActionAndEnableUnsafe(doc.Project.Solution, doc.Id, fix.ApplyFix, ct),
Microsoft.ML.CodeAnalyzer.Tests (1)
Code\BestFriendTest.cs (1)
72solution = projectA.Solution;
Microsoft.ML.InternalCodeAnalyzer (2)
NameFixProvider.cs (2)
112var originalSolution = document.Project.Solution; 114var newSolution = await Renamer.RenameSymbolAsync(document.Project.Solution, typeSymbol, newName, optionSet, cancellationToken).ConfigureAwait(false);
Microsoft.VisualStudio.LanguageServices (70)
CallHierarchy\CallHierarchyCommandHandler.cs (3)
90semanticModel, caretPosition, document.Project.Solution.Services, cancellationToken).ConfigureAwait(false); 95var mappingService = document.Project.Solution.Services.GetService<ISymbolMappingService>(); 115var notificationService = document.Project.Solution.Services.GetService<INotificationService>();
CallHierarchy\CallHierarchyItem.cs (1)
40_workspace = project.Solution.Workspace;
CallHierarchy\CallHierarchyProvider.cs (3)
67symbol, 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();
DebuggerIntelliSense\AbstractDebuggerIntelliSenseContext.cs (1)
135var solution = document.Project.Solution;
ExtractClass\VisualStudioExtractClassOptionsService.cs (1)
50var solution = document.Project.Solution;
ExtractInterface\VisualStudioExtractInterfaceOptionsService.cs (1)
45var solution = document.Project.Solution;
FindReferences\Entries\DocumentSpanEntry.cs (2)
183var controlService = document.Project.Solution.Services.GetRequiredService<IContentControlService>(); 194var clonedBuffer = excerpt.Value.Content.CreateTextBufferWithRoslynContentType(document.Project.Solution.Workspace);
FindReferences\StreamingFindUsagesPresenter.cs (1)
280var vsWorkspace = document.Project.Solution.Workspace as VisualStudioWorkspace;
GenerateType\GenerateTypeDialogViewModel.cs (4)
439this.ProjectFolders = _projectManagementService.GetFolders(this.SelectedProject.Id, this.SelectedProject.Solution.Workspace); 727var 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)
67var defaultNamespace = projectManagementService.GetDefaultNamespace(viewModel.SelectedProject, viewModel.SelectedProject?.Solution.Workspace);
Implementation\AbstractEditorFactory.cs (1)
331var forkedSolution = projectToAddTo.Solution.AddDocument(
Implementation\VisualStudioSupportsFeatureService.cs (1)
97=> SupportsRenameWorker(document.Project.Solution.GetRelatedDocumentIds(document.Id));
InheritanceMargin\InheritanceMarginTaggerProvider.cs (1)
79if (document.Project.Solution.WorkspaceKind == WorkspaceKind.Interactive)
LanguageServer\Handler\Diagnostics\VisualStudioDiagnosticProjectInformationService.cs (1)
21if (project.Solution.Workspace is VisualStudioWorkspace workspace)
LanguageService\AbstractLanguageService`2.cs (1)
159if (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)
178if (project.Solution.Workspace is not VisualStudioWorkspace workspace)
Preview\FileChange.cs (1)
223var workspace = document.Project.Solution.Workspace;
Preview\PreviewUpdater.cs (1)
73_previewWorkspace ??= new PreviewDialogWorkspace(document.Project.Solution);
Preview\ReferenceChange.cs (2)
31var oldSolution = projectChanges.OldProject.Solution; 32var newSolution = projectChanges.NewProject.Solution;
Preview\TopLevelChange.cs (1)
89var oldLinkedDocument = oldDocument.Project.Solution.GetDocument(linkedDocumentId);
Progression\GraphBuilder.cs (2)
162var thisProject = project.Solution.GetProject(symbol.ContainingAssembly) ?? project; 213var newSymbol = SymbolFinder.FindSourceDefinition(symbol, contextProject.Solution, cancellationToken);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs (1)
36Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractRemoveDocumentUndoUnit.cs (1)
39Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.AddMetadataReferenceUndoUnit.cs (1)
51Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.AddProjectReferenceUndoUnit.cs (1)
37Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.RemoveMetadataReferenceUndoUnit.cs (1)
40Workspace.TryApplyChanges(updatedProject.Solution);
ProjectSystem\VisualStudioWorkspaceImpl.RemoveProjectReferenceUndoUnit.cs (1)
37Workspace.TryApplyChanges(updatedProject.Solution);
PullMemberUp\VisualStudioPullMemberUpService.cs (1)
60document.Project.Solution,
Snippets\SnippetExpansionClient.cs (3)
772var semanticInfo = semanticModel.GetSemanticInfo(token, document.Project.Solution.Services, cancellationToken); 904foreach (var provider in GetArgumentProviders(document.Project.Solution.Workspace)) 1085var workspace = originalProject.Solution.Workspace;
ValueTracking\ValueTrackingCommandHandler.cs (1)
124var solution = document.Project.Solution;
Venus\ContainedDocument.cs (1)
807var services = document.Project.Solution.Services;
Venus\ContainedLanguage.IVsContainedLanguageCodeSupport.cs (1)
51var targetDocument = thisDocument.Project.Solution.GetDocument(targetDocumentId);
Venus\ContainedLanguageCodeSupport.cs (4)
232targetDocument.Project.Solution.Services, 273var memberNodeDocument = thisDocument.Project.Solution.GetDocument(memberNode.SyntaxTree); 330var newSolution = Renamer.RenameSymbolAsync(document.Project.Solution, symbol, options, newName, cancellationToken).WaitAndGetResult_Venus(cancellationToken); 331var changedDocuments = newSolution.GetChangedDocuments(document.Project.Solution);
Workspace\VisualStudioSymbolNavigationService.cs (3)
56var solution = project.Solution; 182var definitionItem = symbol.ToNonClassifiedDefinitionItem(project.Solution, includeHiddenLocations: true); 284if (document.Project.Solution.Workspace is VisualStudioWorkspace visualStudioWorkspace
Microsoft.VisualStudio.LanguageServices.CSharp (2)
LanguageService\CSharpHelpContextService.cs (1)
170symbol = semanticModel.GetSemanticInfo(token, document.Project.Solution.Services, cancellationToken)
Snippets\CSharpSnippetExpansionLanguageHelper.cs (1)
102await document.Project.Solution.Workspace.ApplyDocumentChangesAsync(
Microsoft.VisualStudio.LanguageServices.UnitTests (11)
GoToDefinition\GoToDefinitionApiTests.vb (1)
47symbolInfo.Symbol, document.Project.Solution,
Preview\PreviewChangesTests.vb (5)
49forkedDocument.Project.Solution, 97Dim newSolution = forkedDocument.Project.Solution 144forkedDocument.Project.Solution, 192Dim newSolution = forkedDocument.Project.Solution 281Dim 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)
198Assert.True(workspace.TryApplyChanges(newDocument.Project.Solution)) 205Assert.Throws(Of NotSupportedException)(Sub() workspace.TryApplyChanges(newDocument.Project.Solution)) 273Dim testWorkspace = DirectCast(document.Project.Solution.Workspace, EditorTestWorkspace) 311Dim testWorkspace = DirectCast(document.Project.Solution.Workspace, EditorTestWorkspace)
Microsoft.VisualStudio.LanguageServices.VisualBasic (4)
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\VisualBasicSnippetExpansionLanguageHelper.vb (1)
71Await document.Project.Solution.Workspace.ApplyDocumentChangesAsync(Me.ThreadingContext, formattedDocument, cancellationToken).configureawait(True)
Venus\ContainedLanguageStaticEventBinding.vb (2)
65Dim targetDocument = document.Project.Solution.GetDocument(memberSymbol.Locations.First().SourceTree) 93Dim targetDocument = document.Project.Solution.GetDocument(memberSymbol.Locations.First().SourceTree)
Microsoft.VisualStudio.LanguageServices.Xaml (4)
Extensions.cs (1)
34return document.Project.Solution.Projects.Single(p => p.SupportsCompilation && p.FilePath == document.Project.FilePath);
Features\InlineRename\XamlEditorInlineRenameService.cs (1)
90_renameInfo, _document.Project.Solution,
Implementation\LanguageServer\Extensions\SymbolExtensions.cs (1)
54var services = codeProject.Solution.Services;
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (1)
61var solution = document.Project.Solution;
Roslyn.VisualStudio.Next.UnitTests (38)
Remote\RemoteHostClientServiceFactoryTests.cs (1)
52var newSolution = document.Project.Solution.WithDocumentText(document.Id, newText, PreservationMode.PreserveIdentity);
Remote\SnapshotSerializationTests.cs (2)
53var project2 = document1.Project.Solution.AddProject("Project2", "Project2.dll", LanguageNames.VisualBasic); 56solution = document2.Project.Solution.GetRequiredProject(project1.Id)
Services\ServiceHubServicesTests.cs (5)
1621return document.WithText(GetNewText(document, csAddition, vbAddition)).Project.Solution; 1732solution = project.Solution; 1737solution = current.AddDocument($"Document{i}", SourceText.From(documents[i])).Project.Solution; 1743solution = current.AddAdditionalDocument($"AdditionalDocument{i}", SourceText.From(additionalDocuments[i])).Project.Solution; 1749solution = current.AddProjectReference(new ProjectReference(p2pReferences[i])).Solution;
Services\SolutionAssetCacheTests.cs (1)
108workspace.SetCurrentSolution(solution => solution.AddProject("Project", "Assembly", LanguageNames.CSharp).Solution, WorkspaceChangeKind.ProjectAdded);
Services\SolutionServiceTests.cs (29)
222solution = solution.AddProject("CS" + i, "CS" + i, LanguageNames.CSharp).Solution; 225.AddProject("VB1", "VB1", LanguageNames.VisualBasic).Solution; 308s = s.AddProject("newProject", "newProject", LanguageNames.CSharp).Solution; 321return document.Project.Solution; 512.Solution; 523var frozenSolution1 = solution.WithFrozenSourceGeneratedDocument(documentIdentity, DateTime.Now, frozenText1).Project.Solution; 532var frozenSolution2 = solution.WithFrozenSourceGeneratedDocument(documentIdentity, DateTime.Now, frozenText2).Project.Solution; 553solution = project2.Solution; 594solution = project2.Solution; 634var project3 = project2.Solution.AddProject("P3", "P3", LanguageNames.CSharp); 636solution = project3.Solution.AddProjectReference(project3.Id, new(project3.Solution.Projects.Single(p => p.Name == "P2").Id)); 667var project3 = project2.Solution.AddProject("P3", "P3", LanguageNames.CSharp); 669solution = project3.Solution.AddProjectReference(project3.Id, new(project3.Solution.Projects.Single(p => p.Name == "P2").Id)); 708var project3 = project2.Solution.AddProject("P3", "P3", LanguageNames.CSharp); 710solution = project3.Solution.AddProjectReference(project3.Id, new(project2.Id)) 748var project3 = project2.Solution.AddProject("P3", "P3", LanguageNames.CSharp); 750solution = project3.Solution.AddProjectReference(project3.Id, new(project2.Id)) 789solution = project2.Solution; 822solution = project2.Solution; 835solution = solution.GetProject(project1.Id).AddDocument("X.cs", SourceText.From("// X")).Project.Solution; 836solution = solution.GetProject(project2.Id).AddDocument("Y.vb", SourceText.From("' Y")).Project.Solution; 877solution = project2.Solution; 890solution = solution.GetProject(project1.Id).AddDocument("X.cs", SourceText.From("// X")).Project.Solution; 891solution = solution.GetProject(project2.Id).AddDocument("Y.cs", SourceText.From("// Y")).Project.Solution; 892solution = solution.GetProject(project1.Id).AddProjectReference(new ProjectReference(project2.Id)).Solution; 926solution = project1.Solution; 946solution = project2.Solution;