87 references to Id
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (7)
Workspaces\TestWorkspace.cs (7)
337var hostProject = this.GetTestProject(info.Id.ProjectId); 340info.Id, info.FilePath, info.Folders, ExportProvider, 362var hostProject = this.GetTestProject(info.Id.ProjectId); 363var hostDocument = new TestHostDocument(text.ToString(), info.Name, id: info.Id, exportProvider: ExportProvider); 384var hostProject = this.GetTestProject(info.Id.ProjectId); 385var hostDocument = new TestHostDocument(text.ToString(), info.Name, id: info.Id, filePath: info.FilePath, folders: info.Folders, exportProvider: ExportProvider); 773var documentId = documentInfo.Id;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (12)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (4)
726solution = solution.WithDocumentText(documentInfo.Id, CreateText("class UpdatedC2 {}")); 727var document2 = solution.GetDocument(documentInfo.Id); 767var document1 = solution.GetDocument(documentInfo.Id); 3722var document = project.Solution.AddDocument(documentInfo).GetDocument(documentInfo.Id);
SolutionCrawler\WorkCoordinatorTests.cs (8)
573var document = w.CurrentSolution.GetDocument(info.Id); 629var document = workspace.CurrentSolution.GetDocument(info.Id); 655var document = workspace.CurrentSolution.GetDocument(info.Id); 673service.Reanalyze(workspace, worker, projectIds: null, documentIds: SpecializedCollections.SingletonEnumerable(info.Id), highPriority: false); 743worker = await ExecuteOperation(workspace, w => w.ChangeAdditionalDocument(ncfile.Id, SourceText.From("//"))); 749worker = await ExecuteOperation(workspace, w => w.OnAdditionalDocumentRemoved(ncfile.Id)); 785worker = await ExecuteOperation(workspace, w => w.ChangeAnalyzerConfigDocument(analyzerConfigFile.Id, SourceText.From("//"))); 790worker = await ExecuteOperation(workspace, w => w.OnAnalyzerConfigDocumentRemoved(analyzerConfigFile.Id));
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Workspaces\LspMiscellaneousFilesWorkspace.cs (1)
70var id = projectInfo.Documents.Single().Id;
Microsoft.CodeAnalysis.Workspaces (20)
Workspace\AdhocWorkspace.cs (1)
148return this.CurrentSolution.GetDocument(documentInfo.Id);
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (11)
173_sourceTextContainersToDocumentIds = _sourceTextContainersToDocumentIds.Add(textContainer, documentInfo.Id); 183_project._projectSystemProjectFactory.AddDocumentToDocumentsNotFromFiles_NoLock(documentInfo.Id); 185w.OnDocumentOpened(documentInfo.Id, textContainer); 201var documentId = documentInfo.Id; 301if (_documentsAddedInBatch[i].Id == documentId) 362if (_documentsAddedInBatch[i].Id == documentId) 406if (!_documentsAddedInBatch.Any(d => d.Id == documentId)) 459if (_documentsAddedInBatch.Any(d => d.Id == documentId)) 544documentIds: _documentsAddedInBatch.Select(d => d.Id)); 551if (_sourceTextContainersToDocumentIds.TryGetKey(documentInfo.Id, out var textContainer)) 553documentsToOpen.Add((documentInfo.Id, textContainer));
Workspace\Solution\SolutionState.cs (1)
1089var documentInfosByProjectId = documentInfos.ToLookup(d => d.Id.ProjectId);
Workspace\Solution\TextDocumentStates.cs (2)
52: this(infos.Select(info => info.Id).ToImmutableList(), 53infos.ToImmutableSortedDictionary(info => info.Id, stateConstructor, DocumentIdComparer.Instance))
Workspace\Workspace.cs (5)
821WorkspaceChangeKind.DocumentAdded, documentId: documentInfo.Id); 836foreach (var projectId in data.documentInfos.Select(i => i.Id.ProjectId).Distinct()) 846var documentId = newDocumentInfo.Id; 1114var documentId = documentInfo.Id; 1152var documentId = documentInfo.Id;
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildWorkspace.cs (2)
435var project = this.CurrentSolution.GetProject(info.Id.ProjectId); 466this.SaveDocumentText(info.Id, fullPath, text, text.Encoding ?? Encoding.UTF8);
Microsoft.CodeAnalysis.Workspaces.UnitTests (33)
SolutionTests\DocumentInfoTests.cs (3)
45Assert.Equal(id, info.Id); 64Assert.Equal(id, info.Id); 111SolutionTestHelpers.TestProperty(instance, (old, value) => old.WithId(value), opt => opt.Id, documentId, defaultThrows: true);
SolutionTests\SolutionTests.cs (12)
1974var document1 = project.GetDocument(documentInfo1.Id); 1975var document2 = project.GetDocument(documentInfo2.Id); 2000var document1 = project1.GetDocument(documentInfo1.Id); 2001var document2 = project2.GetDocument(documentInfo2.Id); 2048solution = solution.RemoveDocuments(ImmutableArray.Create(documentInfo1.Id, documentInfo2.Id)); 2072solution = solution.RemoveDocuments(ImmutableArray.Create(documentInfo1.Id, documentInfo2.Id)); 2093Assert.Throws<ArgumentException>(() => solution.GetProject(projectId2).RemoveDocuments(ImmutableArray.Create(documentInfo1.Id))); 2112Assert.Throws<ArgumentException>(() => solution.GetProject(projectId2).RemoveAdditionalDocuments(ImmutableArray.Create(documentInfo1.Id))); 2131Assert.Throws<ArgumentException>(() => solution.GetProject(projectId2).RemoveAnalyzerConfigDocuments(ImmutableArray.Create(documentInfo1.Id))); 4304var doc = solution.GetDocument(docInfo.Id);
WorkspaceTests\AdhocWorkspaceTests.cs (17)
65Assert.Equal(ws.CurrentSolution.GetDocument(info.Id), doc); 229var doc = ws.CurrentSolution.GetDocument(docInfo.Id); 232ws.OpenDocument(docInfo.Id); 234doc = ws.CurrentSolution.GetDocument(docInfo.Id); 240ws.CloseDocument(docInfo.Id); 242doc = ws.CurrentSolution.GetDocument(docInfo.Id); 263var doc = ws.CurrentSolution.GetAdditionalDocument(docInfo.Id); 266ws.OpenAdditionalDocument(docInfo.Id); 268doc = ws.CurrentSolution.GetAdditionalDocument(docInfo.Id); 274ws.CloseAdditionalDocument(docInfo.Id); 276doc = ws.CurrentSolution.GetAdditionalDocument(docInfo.Id); 303var doc = ws.CurrentSolution.GetAnalyzerConfigDocument(docInfo.Id); 306ws.OpenAnalyzerConfigDocument(docInfo.Id); 308doc = ws.CurrentSolution.GetAnalyzerConfigDocument(docInfo.Id); 314ws.CloseAnalyzerConfigDocument(docInfo.Id); 316doc = ws.CurrentSolution.GetAnalyzerConfigDocument(docInfo.Id); 357var doc = ws.CurrentSolution.GetDocument(docInfo.Id);
WorkspaceTests\WorkspaceTests.cs (1)
185return this.CurrentSolution.GetDocument(documentInfo.Id);
Microsoft.VisualStudio.LanguageServices (11)
ProjectSystem\MiscellaneousFilesWorkspace.cs (1)
279OnDocumentOpened(projectInfo.Documents.Single().Id, sourceTextContainer);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs (1)
22: base(workspace, docInfo.Id.ProjectId)
ProjectSystem\VisualStudioWorkspaceImpl.cs (9)
777GetProjectData(info.Id.ProjectId, out _, out var project); 791AddDocumentToFolder(project, info.Id, SpecializedCollections.SingletonEnumerable(AppCodeFolderName), info.Name, documentKind, initialText, info.FilePath); 795AddDocumentToFolder(project, info.Id, folders, info.Name, documentKind, initialText, info.FilePath); 799AddDocumentToProject(project, info.Id, info.Name, documentKind, initialText, info.FilePath); 807undoManager?.Add(new RemoveAdditionalDocumentUndoUnit(this, info.Id)); 811undoManager?.Add(new RemoveAnalyzerConfigDocumentUndoUnit(this, info.Id)); 815undoManager?.Add(new RemoveDocumentUndoUnit(this, info.Id)); 1173GetProjectData(updatedInfo.Id.ProjectId, out var _, out var dteProject); 1239if (document.Id != updatedInfo.Id)
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Client\RemoteLanguageServiceWorkspace.cs (1)
357return CurrentSolution.GetRequiredDocument(docInfo.Id);