85 references to Id
Microsoft.CodeAnalysis.Features (2)
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (1)
231
var updatedDocuments = temporaryProjectInfo.Documents.Select(d => d.
Id
== temporaryDocumentId ? d.WithTextLoader(newLoader) : d);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
263
if (!metadataWorkspace.CurrentSolution.ContainsDocument(documentInfo.
Id
))
Microsoft.CodeAnalysis.Features.UnitTests (4)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (4)
908
solution = solution.WithDocumentText(documentInfo.
Id
, CreateText("class UpdatedC2 {}"));
909
var document2 = solution.GetDocument(documentInfo.
Id
);
949
var document1 = solution.GetDocument(documentInfo.
Id
);
4860
var document = project.Solution.AddDocument(documentInfo).GetDocument(documentInfo.
Id
);
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Workspaces\LspMiscellaneousFilesWorkspaceProvider.cs (2)
66
var docId = projectInfo.AdditionalDocuments.Single().
Id
;
70
var id = projectInfo.Documents.Single().
Id
;
Microsoft.CodeAnalysis.Workspaces (21)
Workspace\AdhocWorkspace.cs (1)
143
return this.CurrentSolution.GetDocument(documentInfo.
Id
);
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (10)
185
_sourceTextContainersToDocumentIds = _sourceTextContainersToDocumentIds.Add(textContainer, documentInfo.
Id
);
195
_project._projectSystemProjectFactory.AddDocumentToDocumentsNotFromFiles_NoLock(documentInfo.
Id
);
197
w.OnDocumentOpened(documentInfo.
Id
, textContainer);
213
var documentId = documentInfo.
Id
;
313
if (_documentsAddedInBatch[i].
Id
== documentId)
374
if (_documentsAddedInBatch[i].
Id
== documentId)
418
if (!_documentsAddedInBatch.Any(d => d.
Id
== documentId))
596
documentIds: documentsAddedInBatch.Select(d => d.
Id
));
603
var textContainer = getContainer(documentInfo.
Id
);
606
documentsToOpen.Add((documentInfo.
Id
, textContainer));
Workspace\Solution\SolutionCompilationState.cs (3)
644
if (oldDocumentStates.TryGetState(newDocumentInfo.
Id
, out var oldDocumentState))
660
var newDocumentIdSet = newDocumentInfos.Select(static d => d.
Id
).ToSet();
1791
documentInfos.GroupBy(d => d.
Id
.ProjectId).Select(g =>
Workspace\Solution\TextDocumentStates.cs (2)
76
: this([.. infos.Select(info => info.
Id
)],
77
infos.ToImmutableSortedDictionary(info => info.
Id
, stateConstructor, DocumentIdComparer.Instance),
Workspace\Workspace.cs (5)
1040
WorkspaceChangeKind.DocumentAdded, documentId: documentInfo.
Id
);
1055
foreach (var projectId in data.documentInfos.Select(i => i.
Id
.ProjectId).Distinct())
1065
var documentId = newDocumentInfo.
Id
;
1361
var documentId = documentInfo.
Id
;
1399
var documentId = documentInfo.
Id
;
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildWorkspace.cs (2)
462
var project = this.CurrentSolution.GetRequiredProject(info.
Id
.ProjectId);
492
this.SaveDocumentText(info.
Id
, fullPath, text, text.Encoding ?? Encoding.UTF8);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (7)
Workspaces\TestWorkspace`1.cs (7)
390
var hostProject = this.GetTestProject(info.
Id
.ProjectId);
395
info.
Id
, info.FilePath, info.Folders, ExportProvider,
416
var hostProject = this.GetTestProject(info.
Id
.ProjectId);
419
var hostDocument = CreateDocument(text.ToString(), info.Name, id: info.
Id
, filePath: info.FilePath, folders: info.Folders, exportProvider: ExportProvider);
440
var hostProject = this.GetTestProject(info.
Id
.ProjectId);
443
var hostDocument = CreateDocument(text.ToString(), info.Name, id: info.
Id
, filePath: info.FilePath, folders: info.Folders, exportProvider: ExportProvider);
548
var documentId = documentInfo.
Id
;
Microsoft.CodeAnalysis.Workspaces.UnitTests (33)
SolutionTests\DocumentInfoTests.cs (3)
43
Assert.Equal(id, info.
Id
);
62
Assert.Equal(id, info.
Id
);
109
SolutionTestHelpers.TestProperty(instance, (old, value) => old.WithId(value), opt => opt.
Id
, documentId, defaultThrows: true);
SolutionTests\SolutionTests.cs (12)
2815
var document1 = project.GetDocument(documentInfo1.
Id
);
2816
var document2 = project.GetDocument(documentInfo2.
Id
);
2841
var document1 = project1.GetDocument(documentInfo1.
Id
);
2842
var document2 = project2.GetDocument(documentInfo2.
Id
);
2889
solution = solution.RemoveDocuments(ImmutableArray.Create(documentInfo1.
Id
, documentInfo2.
Id
));
2913
solution = solution.RemoveDocuments(ImmutableArray.Create(documentInfo1.
Id
, documentInfo2.
Id
));
2934
Assert.Throws<ArgumentException>(() => solution.GetProject(projectId2).RemoveDocuments(ImmutableArray.Create(documentInfo1.
Id
)));
2953
Assert.Throws<ArgumentException>(() => solution.GetProject(projectId2).RemoveAdditionalDocuments(ImmutableArray.Create(documentInfo1.
Id
)));
2972
Assert.Throws<ArgumentException>(() => solution.GetProject(projectId2).RemoveAnalyzerConfigDocuments(ImmutableArray.Create(documentInfo1.
Id
)));
5646
var doc = solution.GetDocument(docInfo.
Id
);
WorkspaceTests\AdhocWorkspaceTests.cs (17)
62
Assert.Equal(ws.CurrentSolution.GetDocument(info.
Id
), doc);
226
var doc = ws.CurrentSolution.GetDocument(docInfo.
Id
);
229
ws.OpenDocument(docInfo.
Id
);
231
doc = ws.CurrentSolution.GetDocument(docInfo.
Id
);
237
ws.CloseDocument(docInfo.
Id
);
239
doc = ws.CurrentSolution.GetDocument(docInfo.
Id
);
260
var doc = ws.CurrentSolution.GetAdditionalDocument(docInfo.
Id
);
263
ws.OpenAdditionalDocument(docInfo.
Id
);
265
doc = ws.CurrentSolution.GetAdditionalDocument(docInfo.
Id
);
271
ws.CloseAdditionalDocument(docInfo.
Id
);
273
doc = ws.CurrentSolution.GetAdditionalDocument(docInfo.
Id
);
299
var doc = ws.CurrentSolution.GetAnalyzerConfigDocument(docInfo.
Id
);
302
ws.OpenAnalyzerConfigDocument(docInfo.
Id
);
304
doc = ws.CurrentSolution.GetAnalyzerConfigDocument(docInfo.
Id
);
310
ws.CloseAnalyzerConfigDocument(docInfo.
Id
);
312
doc = ws.CurrentSolution.GetAnalyzerConfigDocument(docInfo.
Id
);
333
var doc = ws.CurrentSolution.GetDocument(docInfo.
Id
);
WorkspaceTests\WorkspaceTests.cs (1)
182
return this.CurrentSolution.GetDocument(documentInfo.
Id
);
Microsoft.VisualStudio.LanguageServices (13)
ProjectSystem\MiscellaneousFilesWorkspace.cs (1)
284
OnDocumentOpened(projectInfo.Documents.Single().
Id
, sourceTextContainer);
ProjectSystem\VisualStudioWorkspaceImpl.AbstractAddDocumentUndoUnit.cs (1)
22
: base(workspace, docInfo.
Id
.ProjectId)
ProjectSystem\VisualStudioWorkspaceImpl.cs (11)
745
GetProjectData(info.
Id
.ProjectId, out _, out var project);
759
AddDocumentToFolder(project, info.
Id
, [AppCodeFolderName], info.Name, documentKind, initialText, info.FilePath);
763
AddDocumentToFolder(project, info.
Id
, folders, info.Name, documentKind, initialText, info.FilePath);
767
AddDocumentToProject(project, info.
Id
, info.Name, documentKind, initialText, info.FilePath);
775
undoManager?.Add(new RemoveAdditionalDocumentUndoUnit(this, info.
Id
));
779
undoManager?.Add(new RemoveAnalyzerConfigDocumentUndoUnit(this, info.
Id
));
783
undoManager?.Add(new RemoveDocumentUndoUnit(this, info.
Id
));
903
if (PathUtilities.GetDirectoryName(CurrentSolution.GetProject(documentInfo.
Id
.ProjectId)?.FilePath) == solutionDirectory)
934
documentInfo.
Id
,
1248
GetProjectData(updatedInfo.
Id
.ProjectId, out var _, out var dteProject);
1314
if (document.Id != updatedInfo.
Id
)
Microsoft.VisualStudio.LanguageServices.LiveShare (1)
Client\RemoteLanguageServiceWorkspace.cs (1)
341
return CurrentSolution.GetRequiredDocument(docInfo.
Id
);