42 references to PreserveValue
Microsoft.CodeAnalysis.Features (1)
EditAndContinue\CommittedSolution.cs (1)
291
_solution = _solution.WithDocumentText(documentId, matchingSourceText, PreservationMode.
PreserveValue
);
Microsoft.CodeAnalysis.Features.UnitTests (1)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (1)
150
solution = solution.WithDocumentTextLoader(documentIdB, new WorkspaceFileTextLoader(solution.Services, sourceFileB.Path, encodingB), PreservationMode.
PreserveValue
);
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Host\RemoteWorkspace.SolutionCreator.cs (1)
558
var mode = PreservationMode.
PreserveValue
;
Microsoft.CodeAnalysis.Workspaces (32)
Workspace\ProjectSystem\ProjectSystemProject.cs (3)
181
documentTextLoaderChangedAction: (s, d, loader) => s.WithDocumentTextLoader(d, loader, PreservationMode.
PreserveValue
),
188
documentTextLoaderChangedAction: (s, d, loader) => s.WithAdditionalDocumentTextLoader(d, loader, PreservationMode.
PreserveValue
),
195
documentTextLoaderChangedAction: (s, d, loader) => s.WithAnalyzerConfigDocumentTextLoader(d, loader, PreservationMode.
PreserveValue
),
Workspace\Solution\DocumentState.cs (1)
121
PreservationMode mode = PreservationMode.
PreserveValue
)
Workspace\Solution\PreservationMode.cs (1)
28
=> mode is >= PreservationMode.
PreserveValue
and <= PreservationMode.PreserveIdentity;
Workspace\Solution\Solution.cs (11)
966
public Solution AddDocument(DocumentId documentId, string name, SyntaxNode syntaxRoot, IEnumerable<string>? folders = null, string? filePath = null, bool isGenerated = false, PreservationMode preservationMode = PreservationMode.
PreserveValue
)
1238
public Solution WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.
PreserveValue
)
1241
internal Solution WithDocumentTexts(ImmutableArray<(DocumentId documentId, SourceText text)> texts, PreservationMode mode = PreservationMode.
PreserveValue
)
1261
public Solution WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.
PreserveValue
)
1282
public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.
PreserveValue
)
1303
public Solution WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.
PreserveValue
)
1324
public Solution WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.
PreserveValue
)
1345
public Solution WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.
PreserveValue
)
1366
public Solution WithDocumentSyntaxRoot(DocumentId documentId, SyntaxNode root, PreservationMode mode = PreservationMode.
PreserveValue
)
1370
internal Solution WithDocumentSyntaxRoots(ImmutableArray<(DocumentId documentId, SyntaxNode root)> syntaxRoots, PreservationMode mode = PreservationMode.
PreserveValue
)
1592
public Solution WithDocumentText(IEnumerable<DocumentId?> documentIds, SourceText text, PreservationMode mode = PreservationMode.
PreserveValue
)
Workspace\Solution\SolutionState.cs (6)
951
public StateChange WithDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.
PreserveValue
)
979
public StateChange WithAdditionalDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.
PreserveValue
)
995
public StateChange WithAnalyzerConfigDocumentText(DocumentId documentId, SourceText text, PreservationMode mode = PreservationMode.
PreserveValue
)
1011
public StateChange WithDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.
PreserveValue
)
1027
public StateChange WithAdditionalDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.
PreserveValue
)
1043
public StateChange WithAnalyzerConfigDocumentText(DocumentId documentId, TextAndVersion textAndVersion, PreservationMode mode = PreservationMode.
PreserveValue
)
Workspace\Solution\TextDocumentState.cs (2)
56
.WithTextLoader(info.TextLoader, PreservationMode.
PreserveValue
);
161
protected static ITextAndVersionSource CreateTextAndVersionSource(SolutionServices solutionServices, TextLoader? loader, string? filePath, LoadTextOptions loadTextOptions, PreservationMode mode = PreservationMode.
PreserveValue
)
Workspace\Workspace.cs (5)
1160
(solution, docId, loader) => solution.WithDocumentTextLoader(docId, loader, PreservationMode.
PreserveValue
),
1175
(solution, docId, loader) => solution.WithAdditionalDocumentTextLoader(docId, loader, PreservationMode.
PreserveValue
),
1190
(solution, docId, loader) => solution.WithAnalyzerConfigDocumentTextLoader(docId, loader, PreservationMode.
PreserveValue
),
2200
this.OnDocumentTextChanged(id, text, PreservationMode.
PreserveValue
);
2244
this.OnAdditionalDocumentTextChanged(id, text, PreservationMode.
PreserveValue
);
Workspace\Workspace_Editor.cs (3)
409
return oldSolution.WithDocumentText(documentId, newText, PreservationMode.
PreserveValue
);
681
return oldSolution.WithDocumentTextLoader(documentId, reloader, PreservationMode.
PreserveValue
);
779
return data.withTextDocumentTextLoader(oldSolution, documentId, data.reloader, PreservationMode.
PreserveValue
);
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildWorkspace.cs (2)
399
this.OnDocumentTextChanged(documentId, text, PreservationMode.
PreserveValue
);
417
this.OnAdditionalDocumentTextChanged(documentId, text, PreservationMode.
PreserveValue
);
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
SolutionTests\SolutionTests.cs (3)
3694
var doc2 = doc.Project.Solution.WithDocumentSyntaxRoot(doc.Id, newRoot, PreservationMode.
PreserveValue
).GetDocument(doc.Id);
4775
PreservationMode.
PreserveValue
);
5477
static (s, documentId) => s.WithDocumentTextLoader(documentId, new TestTextLoader(Guid.NewGuid().ToString()), PreservationMode.
PreserveValue
), documentId).GetReference();
Microsoft.VisualStudio.LanguageServices (1)
Preview\TopLevelChange.cs (1)
178
solution = solution.WithTextDocumentText(updatedDocumentIdOpt, updateDocumentTextOpt, mode: PreservationMode.
PreserveValue
);
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
SolutionExplorer\SourceGeneratorItemTests.vb (1)
257
PreservationMode.
PreserveValue
)