549 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.CodeStyle.Fixes (10)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (26)
Workspaces\WorkspaceTests_EditorFeatures.cs (10)
807(sender, args) => Assert.True(args.Document.Id == document.Id,
811(sender, args) => Assert.True(args.Document.Id == document.Id,
873(sender, args) => Assert.True(args.Document.Id == document.Id,
877(sender, args) => Assert.True(args.Document.Id == document.Id,
937(sender, args) => Assert.True(args.Document.Id == document.Id,
941(sender, args) => Assert.True(args.Document.Id == document.Id,
998(sender, args) => Assert.True(args.Document.Id == document.Id,
1002(sender, args) => Assert.True(args.Document.Id == document.Id,
1317workspace.TryApplyChanges(project.RemoveAdditionalDocument(doc.Id).Solution);
1345workspace.TryApplyChanges(project.RemoveAnalyzerConfigDocument(doc.Id).Solution);
Microsoft.CodeAnalysis.CSharp.Features (7)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (9)
Microsoft.CodeAnalysis.EditorFeatures (34)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (37)
CodeFixes\CodeFixServiceTests.cs (4)
893var changedtxtDocument = solution!.Projects.Single().AdditionalDocuments.Single(t => t.Id == txtDocument.Id);
950return document.Project.Solution.WithAdditionalDocumentText(document.Id, newText);
1081sourceDocument.Project.Solution, sourceDocument.Project.Id, sourceDocument.Id, diagnosticIds: null, shouldIncludeAnalyzer: null, getDocuments: null,
1145var cachedDiagnostics = await diagnosticIncrementalAnalyzer.GetCachedDiagnosticsAsync(sourceDocument.Project.Solution, sourceDocument.Project.Id, sourceDocument.Id,
Diagnostics\DiagnosticDataTests.cs (8)
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),
236firstDocument = secondDocument.Project.Solution.GetRequiredDocument(firstDocument.Id);
239new(secondDocument.Name, new(0, 0), new(0, 1)), secondDocument.Id);
252location: new DiagnosticDataLocation(new FileLinePositionSpan(firstDocument.FilePath, span: default), firstDocument.Id),
261.RemoveDocument(secondDocument.Id)
262.GetRequiredDocument(firstDocument.Id);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (1)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (4)
Microsoft.CodeAnalysis.ExternalAccess.Xaml (1)
Microsoft.CodeAnalysis.Features (103)
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 (2)
196var parsedDocument = new ParsedDocument(document.Id, text, root, hostServices);
229(service, solutionInfo, cancellationToken) => service.ConvertToStructAsync(solutionInfo, document.Id, span, scope, isRecord, cancellationToken),
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (7)
541var oldDocument = await oldProject.GetDocumentAsync(newDocument.Id, includeSourceGenerated: true, cancellationToken).ConfigureAwait(false);
577return DocumentAnalysisResults.SyntaxErrors(newDocument.Id, filePath, [], syntaxError, analysisStopwatch.Elapsed, hasChanges);
588return DocumentAnalysisResults.Unchanged(newDocument.Id, filePath, analysisStopwatch.Elapsed);
597return DocumentAnalysisResults.SyntaxErrors(newDocument.Id, filePath, [new RudeEditDiagnostic(RudeEditKind.ExperimentalFeaturesEnabled, default)], syntaxError: null, analysisStopwatch.Elapsed, hasChanges);
606return DocumentAnalysisResults.SyntaxErrors(newDocument.Id, filePath, [new RudeEditDiagnostic(RudeEditKind.NotSupportedByRuntime, default)], syntaxError: null, analysisStopwatch.Elapsed, hasChanges);
685newDocument.Id,
710return DocumentAnalysisResults.SyntaxErrors(newDocument.Id, filePath, [diagnostic], syntaxError: null, analysisStopwatch.Elapsed, hasChanges);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (3)
387await EnqueueDocumentWorkItemAsync(project, document.Id, document, invocationReasons).ConfigureAwait(false);
472await EnqueueDocumentWorkItemAsync(newDocument.Project, newDocument.Id, newDocument, UnitTestingInvocationReasons.DocumentChanged).ConfigureAwait(false);
479await EnqueueDocumentWorkItemAsync(newDocument.Project, newDocument.Id, newDocument, differenceResult.ChangeType, differenceResult.ChangedMember).ConfigureAwait(false);
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
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)
90DiagnosticDataLocation.TestAccessor.Create(new(sourcePath, new(0, 0), new(0, 5)), document.Id, new("a.razor", new(10, 10), new(10, 15)), forceMappedPath: true),
106DiagnosticDataLocation.TestAccessor.Create(new(sourcePath, new(0, 0), new(0, 5)), document.Id, new(@"..\a.razor", new(10, 10), new(10, 15)), forceMappedPath: true),
123new DiagnosticDataLocation(new(sourcePath, new(0, 1), new(0, 5)), document.Id),
Microsoft.CodeAnalysis.LanguageServer.Protocol (39)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (3)
269builder.AddExternalSyntaxDiagnostics(document.Id, await DocumentAnalysisExecutor.ComputeDocumentDiagnosticAnalyzerDiagnosticsAsync(documentAnalyzer, document, AnalysisKind.Syntax, compilation, cancellationToken).ConfigureAwait(false));
270builder.AddExternalSemanticDiagnostics(document.Id, await DocumentAnalysisExecutor.ComputeDocumentDiagnosticAnalyzerDiagnosticsAsync(documentAnalyzer, document, AnalysisKind.Semantic, compilation, cancellationToken).ConfigureAwait(false));
311lazyLoadDiagnostics.Add(document.Id, [DiagnosticData.Create(loadDiagnostic, document)]);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectState.cs (5)
136if (IsEmpty(lastResult, document.Id))
252Contract.ThrowIfFalse(state.DocumentId == document.Id);
287AddToInMemoryStorage(serializerVersion, project, document, document.Id, SyntaxStateName, syntax.Items);
288AddToInMemoryStorage(serializerVersion, project, document, document.Id, SemanticStateName, semantic.Items);
370var documentId = document.Id;
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateSet.cs (6)
108projectState.IsEmpty(document.Id))
118var activeFileState = GetOrCreateActiveFileState(document.Id);
120activeFileState.Save(AnalysisKind.Syntax, new DocumentAnalysisData(result.Version, text.Lines.Count, result.GetDocumentDiagnostics(document.Id, AnalysisKind.Syntax)));
121activeFileState.Save(AnalysisKind.Semantic, new DocumentAnalysisData(result.Version, text.Lines.Count, result.GetDocumentDiagnostics(document.Id, AnalysisKind.Semantic)));
130if (!_activeFileStates.TryRemove(document.Id, out var activeFileState))
146if (TryGetActiveFileState(document.Id, out var activeFileState))
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Microsoft.CodeAnalysis.Remote.ServiceHub (14)
Host\RemoteWorkspace.SolutionCreator.cs (12)
556assetPath: document.Id, newDocumentChecksums.textChecksum, cancellationToken).ConfigureAwait(false);
562TextDocumentKind.Document => document.Project.Solution.WithDocumentTextLoader(document.Id, loader, mode).GetRequiredDocument(document.Id),
563TextDocumentKind.AnalyzerConfigDocument => document.Project.Solution.WithAnalyzerConfigDocumentTextLoader(document.Id, loader, mode).GetRequiredAnalyzerConfigDocument(document.Id),
564TextDocumentKind.AdditionalDocument => document.Project.Solution.WithAdditionalDocumentTextLoader(document.Id, loader, mode).GetRequiredAdditionalDocument(document.Id),
575assetPath: document.Id, infoChecksum, cancellationToken).ConfigureAwait(false);
588document = document.Project.Solution.WithDocumentFolders(document.Id, newDocumentInfo.Folders).GetDocument(document.Id)!;
595document = document.Project.Solution.WithDocumentSourceCodeKind(document.Id, newDocumentInfo.SourceCodeKind).GetDocument(document.Id)!;
Microsoft.CodeAnalysis.TestAnalyzerReference (2)
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
Microsoft.CodeAnalysis.Workspaces (81)
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 (19)
333this.Project.Solution.OnSemanticModelObtained(this.Id, semanticModel);
386=> this.Project.Solution.WithDocumentSourceCodeKind(this.Id, kind).GetRequiredDocument(Id);
392=> this.Project.Solution.WithDocumentText(this.Id, text, PreservationMode.PreserveIdentity).GetRequiredDocument(Id);
398=> this.Project.Solution.WithDocumentSyntaxRoot(this.Id, root, PreservationMode.PreserveIdentity).GetRequiredDocument(Id);
404=> this.Project.Solution.WithDocumentName(this.Id, name).GetRequiredDocument(Id);
410=> this.Project.Solution.WithDocumentFolders(this.Id, folders).GetRequiredDocument(Id);
416=> this.Project.Solution.WithDocumentFilePath(this.Id, filePath).GetRequiredDocument(Id);
450if (this.Id != oldDocument.Id)
505var filteredDocumentIds = this.Project.Solution.GetRelatedDocumentIds(this.Id);
506return filteredDocumentIds.Remove(this.Id);
547var newSolution = this.Project.Solution.WithFrozenPartialCompilationIncludingSpecificDocument(this.Id, cancellationToken);
548return newSolution.GetRequiredDocument(this.Id);
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (12)
Microsoft.CodeAnalysis.Workspaces.UnitTests (44)
SolutionTests\SolutionTests.cs (21)
3694var doc2 = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot, PreservationMode.PreserveValue).GetDocument(doc.Id);
4133var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { /*no top level change*/ } }"));
4134var documentToFreezeChanged = solution.GetDocument(documentToFreezeOriginal.Id);
4178var solution = project.Solution.WithDocumentText(documentToFreezeOriginal.Id, SourceText.From("class DocumentToFreeze { void M() { } public void NewMethod() { } }"));
4179var documentToFreezeChanged = solution.GetDocument(documentToFreezeOriginal.Id);
4419var relatedIds1 = currentSolution.GetRelatedDocumentIds(document1.Id);
4420var relatedIds2 = currentSolution.GetRelatedDocumentIds(document2.Id);
4421AssertEx.SetEqual(relatedIds1, ImmutableArray.Create(document1.Id, document2.Id));
4422AssertEx.SetEqual(relatedIds2, ImmutableArray.Create(document1.Id, document2.Id));
4424document1 = currentSolution.GetRequiredDocument(document1.Id);
4425document2 = currentSolution.GetRequiredDocument(document2.Id);
4436var frozenDoc2 = frozenDoc1.Project.Solution.GetRequiredDocument(document2.Id);
4451var frozenDoc1 = frozenDoc2.Project.Solution.GetRequiredDocument(document1.Id);
5439var newDoc = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot).GetDocument(doc.Id);
5471static (sourceText, document) => document.Project.Solution.WithDocumentText(document.Id, sourceText, PreservationMode.PreserveIdentity),
5715var forkedProject1 = frozenSolution.WithDocumentText(project1.Documents.Single().Id, SourceText.From("class Doc2 { }")).GetProject(project1.Id);
5754var 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 (43)
Preview\FileChange.cs (5)
50this.Id = left != null ? left.Id : right.Id;
97return GetChangeList(diff, right.Id, oldText, newText);
130var entireSpanChild = new SpanChange(entireSpan, _buffer, document.Id, displayText, text, text, isDeletion: false, parent: this, engine: engine);
226if (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)