Skip to content

Commit

Permalink
Remove dependency on internal VS utility apis.
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi committed Feb 18, 2021
1 parent 724452a commit 6a8ff25
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using Microsoft.VisualStudio.Text.BraceCompletion;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Operations;
using Microsoft.VisualStudio.Utilities.Internal;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.Editor.Implementation.AutomaticCompletion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using Microsoft.CodeAnalysis.Notification;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.VisualStudio.LanguageServices.Implementation.Utilities;
using Microsoft.VisualStudio.Utilities.Internal;
using Roslyn.Utilities;

namespace Microsoft.VisualStudio.LanguageServices.Implementation.ChangeSignature
Expand Down Expand Up @@ -141,13 +140,13 @@ internal bool CanSubmit([NotNullWhen(false)] out string? message)
return false;
}

if (IsCallsiteRegularValue && CallSiteValue.IsNullOrWhiteSpace())
if (IsCallsiteRegularValue && string.IsNullOrWhiteSpace(CallSiteValue))
{
message = ServicesVSResources.Enter_a_call_site_value_or_choose_a_different_value_injection_kind;
return false;
}

if (IsOptional && DefaultValue.IsNullOrWhiteSpace())
if (IsOptional && string.IsNullOrWhiteSpace(DefaultValue))
{
message = ServicesVSResources.Optional_parameters_must_provide_a_default_value;
return false;
Expand Down Expand Up @@ -177,7 +176,7 @@ private void SetCurrentTypeTextAndUpdateBindingStatus(string typeName)
{
VerbatimTypeName = typeName;

if (typeName.IsNullOrWhiteSpace())
if (string.IsNullOrWhiteSpace(typeName))
{
TypeIsEmptyImage = Visibility.Visible;
TypeDoesNotParseImage = Visibility.Collapsed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.LanguageServer.Client;
using Microsoft.VisualStudio.LanguageServer.Protocol;
using Microsoft.VisualStudio.Utilities.Internal;
using Roslyn.Utilities;
using StreamJsonRpc;
using LSP = Microsoft.VisualStudio.LanguageServer.Protocol;
Expand Down Expand Up @@ -558,7 +557,7 @@ internal async Task PublishDiagnosticsAsync(IDiagnosticService diagnosticService
{
// There were diagnostics from other documents, but none from the current document.
// If we're tracking the current document, we can stop.
_publishedFileToDiagnostics.GetOrDefault(fileUri)?.Remove(document.Id);
((IReadOnlyDictionary<Uri, Dictionary<DocumentId, ImmutableArray<LanguageServer.Protocol.Diagnostic>>>)_publishedFileToDiagnostics).GetValueOrDefault(fileUri)?.Remove(document.Id);
_documentsToPublishedUris.MultiRemove(document.Id, fileUri);
}
}
Expand Down Expand Up @@ -645,7 +644,7 @@ private static LSP.DiagnosticSeverity Convert(CodeAnalysis.DiagnosticSeverity se
// In this case, unless we have a null client name, we don't want to publish the diagnostic
// (since a null client name represents the C#/VB language server).
private bool IncludeDiagnostic(DiagnosticData diagnostic) =>
diagnostic.Properties.GetOrDefault(nameof(DocumentPropertiesService.DiagnosticsLspClientName)) == _clientName;
((IReadOnlyDictionary<string, string?>)diagnostic.Properties).GetValueOrDefault(nameof(DocumentPropertiesService.DiagnosticsLspClientName)) == _clientName;

private static LSP.Range GetDiagnosticRange(DiagnosticDataLocation diagnosticDataLocation, SourceText text)
{
Expand Down

0 comments on commit 6a8ff25

Please sign in to comment.