141 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)
24var languageServices = _document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(_state.TypeToGenerateIn.Language);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
51var semanticFacts = document.Project.Solution.Workspace.Services
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (10)
30=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddEventAsync(context, destination, @event, cancellationToken); 37=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddFieldAsync(context, destination, field, cancellationToken); 44=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMethodAsync(context, destination, method, cancellationToken); 51=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddPropertyAsync(context, destination, property, cancellationToken); 58=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 65=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 72=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceAsync(context, destination, @namespace, cancellationToken); 79=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceOrTypeAsync(context, destination, namespaceOrType, cancellationToken); 86=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMembersAsync(context, destination, members, cancellationToken); 92=> GetCodeGenerationService(solution.Workspace.Services, destination.Language).CanAddTo(destination, solution, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
93var workspace = document.Project.Solution.Workspace;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (1)
37=> project.Solution.Workspace.Services.GetExtendedLanguageServices(project.Language);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
EventHookup\EventHookupCommandHandler_TabKeyCommand.cs (2)
147var factory = document.Project.Solution.Workspace.Services.GetRequiredService<IBackgroundWorkIndicatorFactory>(); 172var 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)
126using var workspace = (EditorTestWorkspace)project.Solution.Workspace;
Microsoft.CodeAnalysis.EditorFeatures (25)
AddImports\AbstractAddImportsPasteCommandHandler.cs (1)
165document.Project.Solution.Workspace.TryApplyChanges(updatedDocument.Project.Solution);
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (1)
291if (args.NewSolution.Workspace != workspace)
CodeDefinitionWindow\DefinitionContextTracker.cs (1)
146var workspace = document.Project.Solution.Workspace;
EncapsulateField\AbstractEncapsulateFieldCommandHandler.cs (2)
65var workspace = initialDocument.Project.Solution.Workspace; 106var workspace = solution.Workspace;
Extensibility\NavigationBar\AbstractEditorNavigationBarItemService.cs (1)
47var 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)
107document.Project.Solution.Workspace, 127var 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)
251workspace: d.Project.Solution.Workspace,
Peek\PeekableItemFactory.cs (1)
90solution.Workspace, project.Id, symbolKey, peekResultFactory, _metadataAsSourceFileService, _globalOptions, _threadingContext));
Peek\PeekableItemSource.cs (1)
126var workspace = project.Solution.Workspace;
Preview\AbstractPreviewFactoryService.cs (1)
82var ignoreUnchangeableDocuments = oldSolution.Workspace.IgnoreUnchangeableDocumentsWhenApplyingChanges;
RenameTracking\RenameTrackingCancellationCommandHandler.cs (1)
41RenameTrackingDismisser.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)
41var 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 &&
Suggestions\SuggestedActionsSource_Async.cs (1)
210var workspace = document.Project.Solution.Workspace;
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.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)
92Contract.ThrowIfFalse(project.Solution.Workspace == _workspace);
DocumentSpanExtensions.cs (1)
17var workspace = solution.Workspace;
src\Analyzers\Core\CodeFixes\GenerateEnumMember\AbstractGenerateEnumMemberService.CodeAction.cs (1)
24var languageServices = _document.Project.Solution.Workspace.Services.GetExtendedLanguageServices(_state.TypeToGenerateIn.Language);
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
51var semanticFacts = document.Project.Solution.Workspace.Services
Microsoft.CodeAnalysis.LanguageServer.Protocol (5)
Extensions\Extensions.cs (1)
173var documentIdInCurrentContext = solution.Workspace.GetDocumentIdInCurrentContext(documents.First().Id);
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),
Workspaces\LspWorkspaceManager.cs (1)
275return (miscDocument.Project.Solution.Workspace, miscDocument.Project.Solution, miscDocument);
Microsoft.CodeAnalysis.Workspaces (23)
CodeActions\CodeAction.cs (1)
463originalSolution ??= 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)
30=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddEventAsync(context, destination, @event, cancellationToken); 37=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddFieldAsync(context, destination, field, cancellationToken); 44=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMethodAsync(context, destination, method, cancellationToken); 51=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddPropertyAsync(context, destination, property, cancellationToken); 58=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 65=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamedTypeAsync(context, destination, namedType, cancellationToken); 72=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceAsync(context, destination, @namespace, cancellationToken); 79=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddNamespaceOrTypeAsync(context, destination, namespaceOrType, cancellationToken); 86=> GetCodeGenerationService(context.Solution.Workspace.Services, destination.Language).AddMembersAsync(context, destination, members, cancellationToken); 92=> GetCodeGenerationService(solution.Workspace.Services, destination.Language).CanAddTo(destination, solution, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
93var workspace = document.Project.Solution.Workspace;
Workspace\Solution\SolutionState.cs (1)
225/// This implicitly also changes the value of <see cref="Solution.Workspace"/> for this solution,
Workspace\Workspace.cs (8)
1558if (newSolution.Workspace != this) 2367solution.Workspace.GetProjectName(projectId))); 2383solution.Workspace.GetProjectName(projectId))); 2505solution.Workspace.GetDocumentName(documentId))); 2521solution.Workspace.GetDocumentName(documentId))); 2537solution.Workspace.GetDocumentName(documentId))); 2566solution.Workspace.GetAdditionalDocumentName(documentId))); 2582solution.Workspace.GetAnalyzerConfigDocumentName(documentId)));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
VisualStudioMSBuildWorkspaceTests.cs (2)
2829var workspace = sol.GetObjectReference(static s => s.Workspace); 2898Assert.True(noEncodingSolution.Workspace.TryApplyChanges(noEncodingSolution));
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
SolutionTests\SolutionTests.cs (1)
3972var 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)
13: 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)
279var 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)
222var 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;