Skip to content

Commit

Permalink
Merge pull request #51806 from dotnet/merges/release/dev16.10-to-main
Browse files Browse the repository at this point in the history
Merge release/dev16.10 to main
  • Loading branch information
allisonchou authored Mar 12, 2021
2 parents edccfb4 + 2f14568 commit 24de972
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ public bool IsTracking(Uri documentUri)

public void StartTracking(Uri documentUri, SourceText initialText)
{
Contract.ThrowIfTrue(_trackedDocuments.ContainsKey(documentUri), "didOpen received for an already open document.");
Contract.ThrowIfTrue(_trackedDocuments.ContainsKey(documentUri), $"didOpen received for {documentUri} which is already open.");

_trackedDocuments.Add(documentUri, initialText);
}

public void UpdateTrackedDocument(Uri documentUri, SourceText text)
{
Contract.ThrowIfFalse(_trackedDocuments.ContainsKey(documentUri), "didChange received for a document that isn't open.");
Contract.ThrowIfFalse(_trackedDocuments.ContainsKey(documentUri), $"didChange received for {documentUri} which is not open.");

_trackedDocuments[documentUri] = text;
}
Expand All @@ -99,7 +99,7 @@ public SourceText GetTrackedDocumentSourceText(Uri documentUri)

public void StopTracking(Uri documentUri)
{
Contract.ThrowIfFalse(_trackedDocuments.ContainsKey(documentUri), "didClose received for a document that isn't open.");
Contract.ThrowIfFalse(_trackedDocuments.ContainsKey(documentUri), $"didClose received for {documentUri} which is not open.");

_trackedDocuments.Remove(documentUri);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ protected internal override VSServerCapabilities GetCapabilities()
{
serverCapabilities = _defaultCapabilitiesProvider.GetCapabilities();
}
else
{
// Even if the flag is off, we want to include text sync capabilities.
serverCapabilities.TextDocumentSync = new TextDocumentSyncOptions
{
Change = TextDocumentSyncKind.Incremental,
OpenClose = true,
};
}

serverCapabilities.SupportsDiagnosticRequests = Workspace.IsPullDiagnostics(InternalDiagnosticsOptions.NormalDiagnosticMode);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ internal static class WellKnownExperimentNames
public const string TargetTypedCompletionFilter = "Roslyn.TargetTypedCompletionFilter";
public const string OOPServerGC = "Roslyn.OOPServerGC";
public const string ImportsOnPasteDefaultEnabled = "Roslyn.ImportsOnPasteDefaultEnabled";
public const string LspTextSyncEnabled = "Roslyn.LspTextSyncEnabled";
public const string RemoveUnusedReferences = "Roslyn.RemoveUnusedReferences";
public const string LSPCompletion = "Roslyn.LSP.Completion";
}
Expand Down

0 comments on commit 24de972

Please sign in to comment.