87 references to Id
Microsoft.CodeAnalysis.Features (1)
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
275if (!pendingSolution.ContainsDocument(documentInfo.Id))
Microsoft.CodeAnalysis.Features.UnitTests (4)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (4)
326solution = solution.WithDocumentText(documentInfo.Id, CreateText("class UpdatedC2 {}")); 327var document2 = solution.GetDocument(documentInfo.Id); 367var document1 = solution.GetDocument(documentInfo.Id); 4015var document = project.Solution.AddDocument(documentInfo).GetDocument(documentInfo.Id);
Microsoft.CodeAnalysis.LanguageServer (2)
FileBasedPrograms\FileBasedProgramsProjectSystem.cs (2)
112var docId = projectInfo.AdditionalDocuments.Single().Id; 116var id = projectInfo.Documents.Single().Id;
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Workspaces\LspMiscellaneousFilesWorkspaceProvider.cs (2)
79var docId = projectInfo.AdditionalDocuments.Single().Id; 83var id = projectInfo.Documents.Single().Id;
Microsoft.CodeAnalysis.Workspaces (22)
Workspace\AdhocWorkspace.cs (1)
143return 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)) 461if (_documentsAddedInBatch.Any(d => d.Id == documentId)) 572documentIds: documentsAddedInBatch.Select(d => d.Id)); 579var textContainer = getContainer(documentInfo.Id); 582documentsToOpen.Add((documentInfo.Id, textContainer));
Workspace\Solution\SolutionCompilationState.cs (3)
625if (oldDocumentStates.TryGetState(newDocumentInfo.Id, out var oldDocumentState)) 641var newDocumentIdSet = newDocumentInfos.Select(static d => d.Id).ToSet(); 1771documentInfos.GroupBy(d => d.Id.ProjectId).Select(g =>
Workspace\Solution\TextDocumentStates.cs (2)
75: this([.. infos.Select(info => info.Id)], 76infos.ToImmutableSortedDictionary(info => info.Id, stateConstructor, DocumentIdComparer.Instance),
Workspace\Workspace.cs (5)
1072WorkspaceChangeKind.DocumentAdded, documentId: documentInfo.Id); 1087foreach (var projectId in data.documentInfos.Select(i => i.Id.ProjectId).Distinct()) 1097var documentId = newDocumentInfo.Id; 1393var documentId = documentInfo.Id; 1431var documentId = documentInfo.Id;
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildWorkspace.cs (2)
455var project = this.CurrentSolution.GetRequiredProject(info.Id.ProjectId); 485this.SaveDocumentText(info.Id, fullPath, text, text.Encoding ?? Encoding.UTF8);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (7)
Workspaces\TestWorkspace`1.cs (7)
374var hostProject = this.GetTestProject(info.Id.ProjectId); 379info.Id, info.FilePath, info.Folders, ExportProvider, 400var hostProject = this.GetTestProject(info.Id.ProjectId); 403var hostDocument = CreateDocument(text.ToString(), info.Name, id: info.Id, exportProvider: ExportProvider); 424var hostProject = this.GetTestProject(info.Id.ProjectId); 427var hostDocument = CreateDocument(text.ToString(), info.Name, id: info.Id, filePath: info.FilePath, folders: info.Folders, exportProvider: ExportProvider); 533var documentId = documentInfo.Id;
Microsoft.CodeAnalysis.Workspaces.UnitTests (33)
SolutionTests\DocumentInfoTests.cs (3)
43Assert.Equal(id, info.Id); 62Assert.Equal(id, info.Id); 109SolutionTestHelpers.TestProperty(instance, (old, value) => old.WithId(value), opt => opt.Id, documentId, defaultThrows: true);
SolutionTests\SolutionTests.cs (12)
2645var document1 = project.GetDocument(documentInfo1.Id); 2646var document2 = project.GetDocument(documentInfo2.Id); 2671var document1 = project1.GetDocument(documentInfo1.Id); 2672var document2 = project2.GetDocument(documentInfo2.Id); 2719solution = solution.RemoveDocuments(ImmutableArray.Create(documentInfo1.Id, documentInfo2.Id)); 2743solution = solution.RemoveDocuments(ImmutableArray.Create(documentInfo1.Id, documentInfo2.Id)); 2764Assert.Throws<ArgumentException>(() => solution.GetProject(projectId2).RemoveDocuments(ImmutableArray.Create(documentInfo1.Id))); 2783Assert.Throws<ArgumentException>(() => solution.GetProject(projectId2).RemoveAdditionalDocuments(ImmutableArray.Create(documentInfo1.Id))); 2802Assert.Throws<ArgumentException>(() => solution.GetProject(projectId2).RemoveAnalyzerConfigDocuments(ImmutableArray.Create(documentInfo1.Id))); 5491var doc = solution.GetDocument(docInfo.Id);
WorkspaceTests\AdhocWorkspaceTests.cs (17)
62Assert.Equal(ws.CurrentSolution.GetDocument(info.Id), doc); 226var doc = ws.CurrentSolution.GetDocument(docInfo.Id); 229ws.OpenDocument(docInfo.Id); 231doc = ws.CurrentSolution.GetDocument(docInfo.Id); 237ws.CloseDocument(docInfo.Id); 239doc = ws.CurrentSolution.GetDocument(docInfo.Id); 260var doc = ws.CurrentSolution.GetAdditionalDocument(docInfo.Id); 263ws.OpenAdditionalDocument(docInfo.Id); 265doc = ws.CurrentSolution.GetAdditionalDocument(docInfo.Id); 271ws.CloseAdditionalDocument(docInfo.Id); 273doc = ws.CurrentSolution.GetAdditionalDocument(docInfo.Id); 299var doc = ws.CurrentSolution.GetAnalyzerConfigDocument(docInfo.Id); 302ws.OpenAnalyzerConfigDocument(docInfo.Id); 304doc = ws.CurrentSolution.GetAnalyzerConfigDocument(docInfo.Id); 310ws.CloseAnalyzerConfigDocument(docInfo.Id); 312doc = ws.CurrentSolution.GetAnalyzerConfigDocument(docInfo.Id); 333var doc = ws.CurrentSolution.GetDocument(docInfo.Id);
WorkspaceTests\WorkspaceTests.cs (1)
182return this.CurrentSolution.GetDocument(documentInfo.Id);
Microsoft.VisualStudio.LanguageServices (13)
ProjectSystem\MiscellaneousFilesWorkspace.cs (1)
284OnDocumentOpened(projectInfo.Documents.Single().Id, sourceTextContainer);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs (1)
22: base(workspace, docInfo.Id.ProjectId)
ProjectSystem\VisualStudioWorkspaceImpl.cs (11)
780GetProjectData(info.Id.ProjectId, out _, out var project); 794AddDocumentToFolder(project, info.Id, [AppCodeFolderName], info.Name, documentKind, initialText, info.FilePath); 798AddDocumentToFolder(project, info.Id, folders, info.Name, documentKind, initialText, info.FilePath); 802AddDocumentToProject(project, info.Id, info.Name, documentKind, initialText, info.FilePath); 810undoManager?.Add(new RemoveAdditionalDocumentUndoUnit(this, info.Id)); 814undoManager?.Add(new RemoveAnalyzerConfigDocumentUndoUnit(this, info.Id)); 818undoManager?.Add(new RemoveDocumentUndoUnit(this, info.Id)); 938if (PathUtilities.GetDirectoryName(CurrentSolution.GetProject(documentInfo.Id.ProjectId)?.FilePath) == solutionDirectory) 969documentInfo.Id, 1283GetProjectData(updatedInfo.Id.ProjectId, out var _, out var dteProject); 1349if (document.Id != updatedInfo.Id)
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Client\RemoteLanguageServiceWorkspace.cs (1)
341return CurrentSolution.GetRequiredDocument(docInfo.Id);