146 references to Workspace
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
66Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
66Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
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 (14)
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (1)
26var languageServices = _document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(_state.TypeToGenerateIn.Language);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
57var semanticFacts = document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(state.TypeToGenerateIn.Language).GetService<ISemanticFactsService>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (10)
31=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddEventAsync(context, destination, @event, cancellationToken); 38=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddFieldAsync(context, destination, field, cancellationToken); 45=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMethodAsync(context, destination, method, cancellationToken); 52=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddPropertyAsync(context, destination, property, cancellationToken); 59=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 66=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 73=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceAsync(context, destination, @namespace, cancellationToken); 80=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceOrTypeAsync(context, destination, namespaceOrType, cancellationToken); 87=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMembersAsync(context, destination, members, cancellationToken); 93=> GetCodeGenerationService(solution.Workspace.Services, destination.Language).CanAddTo(destination, solution, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
98var workspace = document.Project.Solution.Workspace;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (1)
38=> project.Solution.Workspace.Services.GetExtendedLanguageServices(project.Language);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (2)
148var factory = document.Project.Solution.Workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 173var workspace = document.Project.Solution.Workspace;
EventHookup\EventHookupCommandHandler_TypeCharCommand.cs (1)
50if (document != null && document.Project.Solution.Workspace.CanApplyChange(ApplyChangesKind.ChangeDocument))
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (1)
127using var workspace = (EditorTestWorkspace)project.Solution.Workspace;
Microsoft.CodeAnalysis.EditorFeatures (22)
AddImports\AbstractAddImportsPasteCommandHandler.cs (1)
166document.Project.Solution.Workspace.TryApplyChanges(updatedDocument.Project.Solution);
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (1)
286if (args.NewSolution.Workspace != _workspace)
CodeDefinitionWindow\DefinitionContextTracker.cs (1)
146var workspace = document.Project.Solution.Workspace;
EncapsulateField\AbstractEncapsulateFieldCommandHandler.cs (2)
67var workspace = initialDocument.Project.Solution.Workspace; 108var workspace = solution.Workspace;
Extensibility\NavigationBar\AbstractEditorNavigationBarItemService.cs (1)
48var workspace = document.Project.Solution.Workspace;
ExternalAccess\VSTypeScript\VSTypeScriptNavigationBarItemService.cs (1)
59var workspace = document.Project.Solution.Workspace;
ExtractInterface\AbstractExtractInterfaceCommandHandler.cs (1)
79if (!document.Project.Solution.Workspace.TryApplyChanges(result.UpdatedSolution))
GoToDefinition\AbstractGoToCommandHandler`2.cs (1)
191document.Project.Solution.Workspace,
GoToDefinition\GoToDefinitionHelpers.cs (1)
45threadingContext, solution.Workspace, title, definitions, cancellationToken).ConfigureAwait(false);
InlineRename\InlineRenameService.cs (2)
108document.Project.Solution.Workspace, 128var workspace = document.Project.Solution.Workspace;
Navigation\AbstractDefinitionLocationService.cs (2)
33var workspace = solution.Workspace; 168_threadingContext, solution.Workspace, title, definitions, cancellationToken).ConfigureAwait(false);
NavigationBar\NavigationBarController.cs (1)
252workspace: d.Project.Solution.Workspace,
Preview\AbstractPreviewFactoryService.cs (1)
82var ignoreUnchangeableDocuments = oldSolution.Workspace.IgnoreUnchangeableDocumentsWhenApplyingChanges;
RenameTracking\RenameTrackingCancellationCommandHandler.cs (1)
43RenameTrackingDismisser.DismissVisibleRenameTracking(document.Project.Solution.Workspace, document.Id);
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
129var workspace = document.Project.Solution.Workspace;
Shared\Preview\PreviewWorkspace.cs (1)
27: base(solution.Workspace.Services.HostServices, WorkspaceKind.Preview)
Shared\Tagging\EventSources\TaggerEventSources.ParseOptionChangedEventSource.cs (1)
32var workspace = e.NewSolution.Workspace;
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 (2)
Completion\AbstractCompletionProviderTests.cs (1)
660document.Project.Solution.Workspace.TryApplyChanges(newDoc.Project.Solution);
Diagnostics\GenerateType\TestGenerateTypeOptionsService.cs (1)
55DefaultNamespace ??= projectManagementService.GetDefaultNamespace(Project, Project?.Solution.Workspace);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (4)
InlineDiagnostics\AbstractDiagnosticsTaggerProvider.SingleDiagnosticKindPullTaggerProvider.cs (1)
107var workspace = project.Solution.Workspace;
Peek\PeekableItemFactory.cs (1)
92solution.Workspace, project.Id, symbolKey, peekResultFactory, _metadataAsSourceFileService, _globalOptions, _threadingContext));
Peek\PeekableItemSource.cs (1)
127var workspace = project.Solution.Workspace;
Suggestions\SuggestedActionsSource_Async.cs (1)
211var workspace = document.Project.Solution.Workspace;
Microsoft.CodeAnalysis.ExternalAccess.FSharp (1)
Internal\Editor\FSharpNavigationBarItemService.cs (1)
69var workspace = document.Project.Solution.Workspace;
Microsoft.CodeAnalysis.ExternalAccess.Xaml (1)
Internal\LocationService.cs (1)
64var declarationFile = await _metadataAsSourceFileService.GetGeneratedFileAsync(project.Solution.Workspace, project, symbol, signaturesOnly: true, options: options, cancellationToken: cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.Features (4)
Diagnostics\CodeAnalysisDiagnosticAnalyzerService.cs (1)
93Contract.ThrowIfFalse(solution.Workspace == _workspace);
DocumentSpanExtensions.cs (1)
17var workspace = solution.Workspace;
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (1)
26var languageServices = _document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(_state.TypeToGenerateIn.Language);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
57var semanticFacts = document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(state.TypeToGenerateIn.Language).GetService<ISemanticFactsService>();
Microsoft.CodeAnalysis.LanguageServer.Protocol (9)
Extensions\Extensions.cs (1)
160var documentIdInCurrentContext = solution.Workspace.GetDocumentIdInCurrentContext(documents.First().Id);
Features\Diagnostics\DiagnosticAnalyzerService.cs (5)
90var analyzer = CreateIncrementalAnalyzer(document.Project.Solution.Workspace); 102var analyzer = CreateIncrementalAnalyzer(project.Solution.Workspace); 109var analyzer = CreateIncrementalAnalyzer(project.Solution.Workspace); 118var analyzer = CreateIncrementalAnalyzer(project.Solution.Workspace); 129return service.CreateIncrementalAnalyzer(project.Solution.Workspace).GetAnalyzersForTestingPurposesOnlyAsync(project, cancellationToken);
Handler\CodeActions\CodeActionHelpers.cs (2)
399document.Project.Solution.Workspace, codeFixService, document, textSpan, 404document.Project.Solution.Workspace, codeRefactoringService, document, textSpan, priority: null,
Handler\PullHandlers\VersionedPullCache.cs (1)
83(project.Solution.Workspace, projectOrDocumentId),
Microsoft.CodeAnalysis.Workspaces (23)
CodeActions\CodeAction.cs (1)
464originalSolution ??= changedSolution.Workspace.CurrentSolution;
Editing\SymbolEditor.cs (1)
196.Select(n => SyntaxGenerator.GetGenerator(OriginalSolution.Workspace, n.Language).GetDeclaration(n))
Shared\Extensions\ISolutionExtensions.cs (1)
81: solution.Workspace;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (10)
31=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddEventAsync(context, destination, @event, cancellationToken); 38=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddFieldAsync(context, destination, field, cancellationToken); 45=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMethodAsync(context, destination, method, cancellationToken); 52=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddPropertyAsync(context, destination, property, cancellationToken); 59=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 66=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 73=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceAsync(context, destination, @namespace, cancellationToken); 80=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceOrTypeAsync(context, destination, namespaceOrType, cancellationToken); 87=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMembersAsync(context, destination, members, cancellationToken); 93=> GetCodeGenerationService(solution.Workspace.Services, destination.Language).CanAddTo(destination, solution, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
98var workspace = document.Project.Solution.Workspace;
Workspace\Solution\SolutionState.cs (1)
215/// This implicitly also changes the value of <see cref="Solution.Workspace"/> for this solution,
Workspace\Workspace.cs (8)
1534if (newSolution.Workspace != this) 2343solution.Workspace.GetProjectName(projectId))); 2359solution.Workspace.GetProjectName(projectId))); 2481solution.Workspace.GetDocumentName(documentId))); 2497solution.Workspace.GetDocumentName(documentId))); 2513solution.Workspace.GetDocumentName(documentId))); 2542solution.Workspace.GetAdditionalDocumentName(documentId))); 2558solution.Workspace.GetAnalyzerConfigDocumentName(documentId)));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
VisualStudioMSBuildWorkspaceTests.cs (2)
2849var workspace = sol.GetObjectReference(static s => s.Workspace); 2918Assert.True(noEncodingSolution.Workspace.TryApplyChanges(noEncodingSolution));
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
SolutionTests\SolutionTests.cs (1)
3974var options = solution.Workspace.Services
WorkspaceTests\AdhocWorkspaceTests.cs (2)
396: base(solution.Workspace.Services.HostServices, solution.Workspace.Kind)
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
90Assert.True(proj.Solution.Workspace.TryApplyChanges(proj.Solution));
Microsoft.ML.InternalCodeAnalyzer (1)
NameFixProvider.cs (1)
113var optionSet = originalSolution.Workspace.Options;
Microsoft.VisualStudio.LanguageServices (22)
CallHierarchy\CallHierarchyItem.cs (1)
40_workspace = project.Solution.Workspace;
CallHierarchy\Finders\AbstractCallFinder.cs (1)
161loc => new CallHierarchyDetail(this.Provider, loc, project.Solution.Workspace)));
DebuggerIntelliSense\DebuggerIntellisenseWorkspace.cs (1)
15: base(solution.Workspace.Services.HostServices, WorkspaceKind.Debugger)
FindReferences\Entries\DocumentSpanEntry.cs (1)
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 (2)
439this.ProjectFolders = _projectManagementService.GetFolders(this.SelectedProject.Id, this.SelectedProject.Solution.Workspace); 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);
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 (3)
68else if (project.Solution.Workspace is VisualStudioWorkspace workspace 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\PreviewEngine.cs (1)
114var changedDocuments = projectChanges.SelectMany(p => p.GetChangedDocuments(onlyGetDocumentsWithTextChanges: true, _oldSolution.Workspace.IgnoreUnchangeableDocumentsWhenApplyingChanges));
Progression\GraphNodeIdCreation.cs (1)
408if (solution.Workspace is VisualStudioWorkspace)
Snippets\SnippetExpansionClient.cs (2)
904foreach (var provider in GetArgumentProviders(document.Project.Solution.Workspace)) 1085var workspace = originalProject.Solution.Workspace;
ValueTracking\ValueTrackedTreeItemViewModel.cs (1)
67solution.Workspace,
Workspace\VisualStudioSymbolNavigationService.cs (2)
71solution.Workspace, targetDocument.Id, sourceLocation.SourceSpan.Start, cancellationToken).ConfigureAwait(false); 290if (document.Project.Solution.Workspace is VisualStudioWorkspace visualStudioWorkspace
Microsoft.VisualStudio.LanguageServices.CSharp (1)
Snippets\CSharpSnippetExpansionLanguageHelper.cs (1)
102await document.Project.Solution.Workspace.ApplyDocumentChangesAsync(
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (17)
PersistentStorage\AbstractPersistentStorageTests.cs (17)
492var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 513var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 624var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 648var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 667var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 672var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 688var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 693var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 709var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 730var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 751var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 775var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 799var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 804var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 823var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 828var storage = await GetStorageFromKeyAsync(solution.Workspace.Services, SolutionKey.ToSolutionKey(solution)); 1013_storageService = (AbstractPersistentStorageService)solution.Workspace.Services.SolutionServices.GetPersistentStorageService();
Microsoft.VisualStudio.LanguageServices.UnitTests (2)
Venus\DocumentService_IntegrationTests.vb (2)
270Dim testWorkspace = DirectCast(document.Project.Solution.Workspace, EditorTestWorkspace) 308Dim testWorkspace = DirectCast(document.Project.Solution.Workspace, EditorTestWorkspace)
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
Snippets\VisualBasicSnippetExpansionLanguageHelper.vb (1)
71Await document.Project.Solution.Workspace.ApplyDocumentChangesAsync(Me.ThreadingContext, formattedDocument, cancellationToken).configureawait(True)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Implementation\LanguageServer\Handler\Definitions\GoToDefinitionHandler.cs (1)
176var workspace = solution.Workspace;