566 references to Id
AnalyzerRunner (3)
Microsoft.Analyzers.Extra (3)
Microsoft.AspNetCore.Analyzer.Testing (1)
Microsoft.AspNetCore.App.Analyzers.Test (3)
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Microsoft.CodeAnalysis.Analyzers (5)
Microsoft.CodeAnalysis.CodeStyle.Fixes (10)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (30)
Workspaces\WorkspaceTests_EditorFeatures.cs (10)
818(sender, args) => Assert.True(args.Document.Id == document.Id,
822(sender, args) => Assert.True(args.Document.Id == document.Id,
884(sender, args) => Assert.True(args.Document.Id == document.Id,
888(sender, args) => Assert.True(args.Document.Id == document.Id,
948(sender, args) => Assert.True(args.Document.Id == document.Id,
952(sender, args) => Assert.True(args.Document.Id == document.Id,
1009(sender, args) => Assert.True(args.Document.Id == document.Id,
1013(sender, args) => Assert.True(args.Document.Id == document.Id,
1328workspace.TryApplyChanges(project.RemoveAdditionalDocument(doc.Id).Solution);
1356workspace.TryApplyChanges(project.RemoveAnalyzerConfigDocument(doc.Id).Solution);
Microsoft.CodeAnalysis.CSharp.Features (7)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (9)
Microsoft.CodeAnalysis.EditorFeatures (35)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (37)
Diagnostics\DiagnosticDataTests.cs (9)
125location: new DiagnosticDataLocation(new("originalFile1", new(startLine, startColumn), new(endLine, endColumn)), document.Id),
145new(additionalDocument.Name, new(0, 0), new(0, 1)), additionalDocument.Id);
158location: new DiagnosticDataLocation(new FileLinePositionSpan(document.FilePath, span: default), document.Id),
193location: new DiagnosticDataLocation(new FileLinePositionSpan(document.FilePath, span: default), document.Id),
273firstDocument = secondDocument.Project.Solution.GetRequiredDocument(firstDocument.Id);
276new(secondDocument.Name, new(0, 0), new(0, 1)), secondDocument.Id);
289location: new DiagnosticDataLocation(new FileLinePositionSpan(firstDocument.FilePath, span: default), firstDocument.Id),
298.RemoveDocument(secondDocument.Id)
299.GetRequiredDocument(firstDocument.Id);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (4)
Microsoft.CodeAnalysis.ExternalAccess.Xaml (1)
Microsoft.CodeAnalysis.Features (107)
AddImport\AbstractAddImportFeatureService.cs (2)
75service.GetFixesAsync(solutionInfo, callbackId, document.Id, span, diagnosticId, maxResults, options, packageSources, cancellationToken),
548service.GetUniqueFixesAsync(solutionInfo, callbackId, document.Id, span, diagnosticIds, options, packageSources, cancellationToken),
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (3)
195var parsedDocument = new ParsedDocument(document.Id, text, root, hostServices);
228(service, solutionInfo, cancellationToken) => service.ConvertToStructAsync(solutionInfo, document.Id, span, scope, isRecord, cancellationToken),
589var docId = currentDoc.Id;
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (7)
538var oldDocument = await oldProject.GetDocumentAsync(newDocument.Id, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false);
574return DocumentAnalysisResults.SyntaxErrors(newDocument.Id, filePath, [], syntaxError, analysisStopwatch.Elapsed, hasChanges);
585return DocumentAnalysisResults.Unchanged(newDocument.Id, filePath, analysisStopwatch.Elapsed);
593return DocumentAnalysisResults.SyntaxErrors(newDocument.Id, filePath, [new RudeEditDiagnostic(RudeEditKind.ExperimentalFeaturesEnabled, default)], syntaxError: null, analysisStopwatch.Elapsed, hasChanges);
602return DocumentAnalysisResults.SyntaxErrors(newDocument.Id, filePath, [new RudeEditDiagnostic(RudeEditKind.NotSupportedByRuntime, default)], syntaxError: null, analysisStopwatch.Elapsed, hasChanges);
691newDocument.Id,
716return DocumentAnalysisResults.SyntaxErrors(newDocument.Id, filePath, [diagnostic], syntaxError: null, analysisStopwatch.Elapsed, hasChanges);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (3)
382await EnqueueDocumentWorkItemAsync(project, document.Id, document, invocationReasons).ConfigureAwait(false);
466await EnqueueDocumentWorkItemAsync(newDocument.Project, newDocument.Id, newDocument, UnitTestingInvocationReasons.DocumentChanged).ConfigureAwait(false);
473await EnqueueDocumentWorkItemAsync(newDocument.Project, newDocument.Id, newDocument, differenceResult.ChangeType, differenceResult.ChangedMember).ConfigureAwait(false);
Microsoft.CodeAnalysis.Features.Test.Utilities (3)
Microsoft.CodeAnalysis.Features.UnitTests (20)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (17)
212Assert.Equal(document1.Id, document2.Id);
250solution = solution.WithDocumentText(document1.Id, CreateText("dummy2"));
258var document2 = solution.GetDocument(document1.Id);
289solution = solution.WithDocumentText(document1.Id, CreateText(sourceV2));
362solution = solution.WithDocumentText(document1.Id, CreateText("class E {}"));
589solution = solution.WithDocumentText(document1.Id, CreateText("class C1 { void M() { System.Console.WriteLine(2); } }"));
590var document2 = solution.GetDocument(document1.Id);
826solution = solution.WithDocumentText(document1.Id, CreateText(source2));
876solution = solution.WithDocumentText(document1.Id, CreateText(source2));
877var document2 = solution.GetDocument(document1.Id);
976solution = solution.WithDocumentText(document1.Id, CreateText(source2));
977var document2 = solution.GetDocument(document1.Id);
1113solution = solution.WithDocumentText(document1.Id, CreateText(sourceV2));
1459solution = solution.WithDocumentText(document1.Id, CreateText("class C1 { void M() { "));
1499solution = solution.WithDocumentText(document1.Id, CreateText("class C1 { void M() { int i = 0L; System.Console.WriteLine(i); } }"));
1559solution = solution.WithDocumentText(documentC.Id, CreateText("class C { void M() { "));
EditAndContinue\EmitSolutionUpdateResultsTests.cs (3)
88DiagnosticDataLocation.TestAccessor.Create(new(sourcePath, new(0, 0), new(0, 5)), document.Id, new("a.razor", new(10, 10), new(10, 15)), forceMappedPath: true),
104DiagnosticDataLocation.TestAccessor.Create(new(sourcePath, new(0, 0), new(0, 5)), document.Id, new(@"..\a.razor", new(10, 10), new(10, 15)), forceMappedPath: true),
121new DiagnosticDataLocation(new(sourcePath, new(0, 1), new(0, 5)), document.Id),
Microsoft.CodeAnalysis.LanguageServer.Protocol (23)
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (8)
Microsoft.CodeAnalysis.Remote.ServiceHub (18)
Host\RemoteWorkspace.SolutionCreator.cs (16)
551assetPath: document.Id, newDocumentChecksums.textChecksum, cancellationToken).ConfigureAwait(false);
557TextDocumentKind.Document => document.Project.Solution.WithDocumentTextLoader(document.Id, loader, mode).GetRequiredDocument(document.Id),
558TextDocumentKind.AnalyzerConfigDocument => document.Project.Solution.WithAnalyzerConfigDocumentTextLoader(document.Id, loader, mode).GetRequiredAnalyzerConfigDocument(document.Id),
559TextDocumentKind.AdditionalDocument => document.Project.Solution.WithAdditionalDocumentTextLoader(document.Id, loader, mode).GetRequiredAdditionalDocument(document.Id),
570assetPath: document.Id, infoChecksum, cancellationToken).ConfigureAwait(false);
578document = document.Project.Solution.WithDocumentName(document.Id, newDocumentInfo.Name).GetRequiredDocument(document.Id);
581document = document.Project.Solution.WithDocumentFilePath(document.Id, newDocumentInfo.FilePath).GetRequiredDocument(document.Id);
587document = document.Project.Solution.WithDocumentFolders(document.Id, newDocumentInfo.Folders).GetRequiredDocument(document.Id);
594document = document.Project.Solution.WithDocumentSourceCodeKind(document.Id, newDocumentInfo.SourceCodeKind).GetRequiredDocument(document.Id);
Microsoft.CodeAnalysis.TestAnalyzerReference (2)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
Microsoft.CodeAnalysis.Workspaces (86)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (8)
240results.Add(new RenameLocation(location, document.Id, isRenamableAccessor: isRenamableAccessor));
268results.Add(new RenameLocation(location, location.Document.Id));
274results.Add(new RenameLocation(aliasLocation, solution.GetRequiredDocument(aliasLocation.SourceTree).Id));
287results.Add(new RenameLocation(location.Location, location.Document.Id,
293results.Add(new RenameLocation(aliasLocation, solution.GetRequiredDocument(aliasLocation.SourceTree).Id));
301location.Document.Id,
309location.Document.Id,
424var renameLocation = new RenameLocation(matchLocation, document.Id, containingLocationForStringOrComment: containingSpan);
Workspace\Solution\Document.cs (23)
332this.Project.Solution.OnSemanticModelObtained(this.Id, semanticModel);
385=> this.Project.Solution.WithDocumentSourceCodeKind(this.Id, kind).GetRequiredDocument(Id);
392var solution = this.Project.Solution.WithDocumentText(this.Id, text, PreservationMode.PreserveIdentity);
394if (Id.IsSourceGenerated)
397return solution.GetRequiredSourceGeneratedDocumentForAlreadyGeneratedId(Id);
400return solution.GetRequiredDocument(Id);
408var solution = this.Project.Solution.WithDocumentSyntaxRoot(this.Id, root, PreservationMode.PreserveIdentity);
410if (Id.IsSourceGenerated)
413return solution.GetRequiredSourceGeneratedDocumentForAlreadyGeneratedId(Id);
416return solution.GetRequiredDocument(Id);
423=> this.Project.Solution.WithDocumentName(this.Id, name).GetRequiredDocument(Id);
429=> this.Project.Solution.WithDocumentFolders(this.Id, folders).GetRequiredDocument(Id);
435=> this.Project.Solution.WithDocumentFilePath(this.Id, filePath).GetRequiredDocument(Id);
469if (this.Id != oldDocument.Id)
524var filteredDocumentIds = this.Project.Solution.GetRelatedDocumentIds(this.Id);
525return filteredDocumentIds.Remove(this.Id);
566var newSolution = this.Project.Solution.WithFrozenPartialCompilationIncludingSpecificDocument(this.Id, cancellationToken);
567return newSolution.GetRequiredDocument(this.Id);
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (12)
Microsoft.CodeAnalysis.Workspaces.UnitTests (48)
SolutionTests\SolutionTests.cs (21)
3695var doc2 = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot, PreservationMode.PreserveValue).GetDocument(doc.Id);
4145var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { /*no top level change*/ } }"));
4146var documentToFreezeChanged = solution.GetDocument(documentToFreezeOriginal.Id);
4190var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { } public void NewMethod() { } }"));
4191var documentToFreezeChanged = solution.GetDocument(documentToFreezeOriginal.Id);
4435var relatedIds1 = currentSolution.GetRelatedDocumentIds(document1.Id);
4436var relatedIds2 = currentSolution.GetRelatedDocumentIds(document2.Id);
4437AssertEx.SetEqual(relatedIds1, ImmutableArray.Create(document1.Id, document2.Id));
4438AssertEx.SetEqual(relatedIds2, ImmutableArray.Create(document1.Id, document2.Id));
4440document1 = currentSolution.GetRequiredDocument(document1.Id);
4441document2 = currentSolution.GetRequiredDocument(document2.Id);
4452var frozenDoc2 = frozenDoc1.Project.Solution.GetRequiredDocument(document2.Id);
4467var frozenDoc1 = frozenDoc2.Project.Solution.GetRequiredDocument(document1.Id);
5472var newDoc = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot).GetDocument(doc.Id);
5504static (sourceText, document) => document.Project.Solution.WithDocumentText(document.Id, sourceText, PreservationMode.PreserveIdentity),
5748var forkedProject1 = frozenSolution.WithDocumentText(project1.Documents.Single().Id, SourceText.From("class Doc2 { }")).GetProject(project1.Id);
5787var forkedProject1 = frozenSolution.WithDocumentText(project1.Documents.Single().Id, SourceText.From("class Doc2 { }")).GetProject(project1.Id);
Microsoft.Interop.ComInterfaceGenerator (1)
Microsoft.Interop.LibraryImportGenerator (3)
Microsoft.VisualStudio.LanguageServices (42)
Preview\FileChange.cs (5)
49this.Id = left != null ? left.Id : right.Id;
96return GetChangeList(diff, right.Id, oldText, newText);
129var entireSpanChild = new SpanChange(entireSpan, _buffer, document.Id, displayText, text, text, isDeletion: false, parent: this, engine: engine);
225if (vsWorkspace.TryGetImageListAndIndex(_imageService, document.Id, out pData[0].hImageList, out pData[0].Image))
Preview\TopLevelChange.cs (6)
81ApplyFileChangesCore(oldTextDocument, updatedTextDocument?.Id, updatedDocumentTextOpt,
92var newLinkedDocumentIdOpt = updatedDocumentTextOpt != null ? oldLinkedDocument.Id : null;
157solution = solution.AddDocument(oldDocument.Id, oldDocument.Name, oldText, oldDocument.Folders, oldDocument.FilePath);
161solution = solution.AddAnalyzerConfigDocument(oldDocument.Id, oldDocument.Name, SourceText.From(oldText), oldDocument.Folders, oldDocument.FilePath);
165solution = solution.AddAdditionalDocument(oldDocument.Id, oldDocument.Name, oldText, oldDocument.Folders, oldDocument.FilePath);
175Debug.Assert(oldDocument.Id == updatedDocumentIdOpt);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
Microsoft.VisualStudio.LanguageServices.LiveShare (2)
Microsoft.VisualStudio.LanguageServices.UnitTests (5)
Microsoft.VisualStudio.LanguageServices.VisualBasic (4)
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Roslyn.VisualStudio.DiagnosticsWindow (1)
Roslyn.VisualStudio.Next.UnitTests (15)