Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed Feb 3, 2022
1 parent 55a10dd commit 39f4fab
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public sealed override bool ShouldTriggerCompletion(SourceText text, int caretPo
return ShouldTriggerCompletionImpl(text, caretPosition, trigger, CompletionOptions.Default);
}

internal override bool ShouldTriggerCompletion(HostLanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, CompletionOptions options, OptionSet passthroughOptions)
internal override bool ShouldTriggerCompletion(HostLanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, CompletionOptions options, OptionSet passThroughOptions)
=> ShouldTriggerCompletionImpl(text, caretPosition, trigger, options);

private bool ShouldTriggerCompletionImpl(SourceText text, int caretPosition, CompletionTrigger trigger, in CompletionOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ internal override Task<CompletionList> GetCompletionsAsync(
Document document,
int caretPosition,
CompletionOptions options,
OptionSet passthroughOptions,
OptionSet passThroughOptions,
CompletionTrigger trigger,
ImmutableHashSet<string>? roles,
CancellationToken cancellationToken)
{
return GetCompletionsWithAvailabilityOfExpandedItemsAsync(document, caretPosition, options, passthroughOptions, trigger, roles, cancellationToken);
return GetCompletionsWithAvailabilityOfExpandedItemsAsync(document, caretPosition, options, passThroughOptions, trigger, roles, cancellationToken);
}

protected static bool IsKeywordItem(CompletionItem item)
Expand Down
4 changes: 2 additions & 2 deletions src/Features/Core/Portable/Completion/CompletionProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public virtual bool ShouldTriggerCompletion(SourceText text, int caretPosition,
/// <param name="caretPosition">The position of the caret after the triggering action.</param>
/// <param name="trigger">The triggering action.</param>
/// <param name="options">The set of options in effect.</param>
internal virtual bool ShouldTriggerCompletion(HostLanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, CompletionOptions options, OptionSet passthroughOptions)
internal virtual bool ShouldTriggerCompletion(HostLanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, CompletionOptions options, OptionSet passThroughOptions)
#pragma warning disable RS0030, CS0618 // Do not used banned/obsolete APIs
=> ShouldTriggerCompletion(text, caretPosition, trigger, passthroughOptions);
=> ShouldTriggerCompletion(text, caretPosition, trigger, passThroughOptions);
#pragma warning restore

/// <summary>
Expand Down
10 changes: 5 additions & 5 deletions src/Features/Core/Portable/Completion/CompletionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public virtual bool ShouldTriggerCompletion(
/// <param name="caretPosition">The position of the caret after the triggering action.</param>
/// <param name="trigger">The potential triggering action.</param>
/// <param name="options">Options.</param>
/// <param name="passthroughOptions">Options originating either from external caller of the <see cref="CompletionService"/> or set externally to <see cref="Solution.Options"/>.</param>
/// <param name="passThroughOptions">Options originating either from external caller of the <see cref="CompletionService"/> or set externally to <see cref="Solution.Options"/>.</param>
/// <param name="roles">Optional set of roles associated with the editor state.</param>
/// <remarks>
/// We pass the project here to retrieve information about the <see cref="Project.AnalyzerReferences"/>,
Expand All @@ -92,11 +92,11 @@ internal virtual bool ShouldTriggerCompletion(
int caretPosition,
CompletionTrigger trigger,
CompletionOptions options,
OptionSet passthroughOptions,
OptionSet passThroughOptions,
ImmutableHashSet<string>? roles = null)
{
Debug.Fail("Backward compat only, should not be called");
return ShouldTriggerCompletion(text, caretPosition, trigger, roles, passthroughOptions);
return ShouldTriggerCompletion(text, caretPosition, trigger, roles, passThroughOptions);
}

/// <summary>
Expand Down Expand Up @@ -145,13 +145,13 @@ internal virtual async Task<CompletionList> GetCompletionsAsync(
Document document,
int caretPosition,
CompletionOptions options,
OptionSet passthroughOptions,
OptionSet passThroughOptions,
CompletionTrigger trigger = default,
ImmutableHashSet<string>? roles = null,
CancellationToken cancellationToken = default)
{
#pragma warning disable RS0030 // Do not use banned APIs
return await GetCompletionsAsync(document, caretPosition, trigger, roles, passthroughOptions, cancellationToken).ConfigureAwait(false) ?? CompletionList.Empty;
return await GetCompletionsAsync(document, caretPosition, trigger, roles, passThroughOptions, cancellationToken).ConfigureAwait(false) ?? CompletionList.Empty;
#pragma warning restore
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ protected virtual ImmutableArray<CompletionProvider> GetProviders(ImmutableHashS
{
// Publicly available options do not affect this API.
var completionOptions = CompletionOptions.Default;
var passthroughOptions = options ?? document.Project.Solution.Options;
var passThroughOptions = options ?? document.Project.Solution.Options;

return await GetCompletionsWithAvailabilityOfExpandedItemsAsync(document, caretPosition, completionOptions, passthroughOptions, trigger, roles, cancellationToken).ConfigureAwait(false);
return await GetCompletionsWithAvailabilityOfExpandedItemsAsync(document, caretPosition, completionOptions, passThroughOptions, trigger, roles, cancellationToken).ConfigureAwait(false);
}

private protected async Task<CompletionList> GetCompletionsWithAvailabilityOfExpandedItemsAsync(
Document document,
int caretPosition,
CompletionOptions options,
OptionSet passthroughOptions,
OptionSet passThroughOptions,
CompletionTrigger trigger,
ImmutableHashSet<string>? roles,
CancellationToken cancellationToken)
Expand Down Expand Up @@ -172,9 +172,9 @@ ImmutableArray<CompletionProvider> GetTriggeredProviders(
case CompletionTriggerKind.Insertion:
case CompletionTriggerKind.Deletion:

if (ShouldTriggerCompletion(document.Project, document.Project.LanguageServices, text, caretPosition, trigger, options, passthroughOptions, roles))
if (ShouldTriggerCompletion(document.Project, document.Project.LanguageServices, text, caretPosition, trigger, options, passThroughOptions, roles))
{
var triggeredProviders = providers.Where(p => p.ShouldTriggerCompletion(document.Project.LanguageServices, text, caretPosition, trigger, options, passthroughOptions)).ToImmutableArrayOrEmpty();
var triggeredProviders = providers.Where(p => p.ShouldTriggerCompletion(document.Project.LanguageServices, text, caretPosition, trigger, options, passThroughOptions)).ToImmutableArrayOrEmpty();

Debug.Assert(ValidatePossibleTriggerCharacterSet(trigger.Kind, triggeredProviders, document, text, caretPosition, options));
return triggeredProviders.IsEmpty ? providers.ToImmutableArray() : triggeredProviders;
Expand Down Expand Up @@ -220,7 +220,7 @@ public sealed override bool ShouldTriggerCompletion(SourceText text, int caretPo
}

internal sealed override bool ShouldTriggerCompletion(
Project? project, HostLanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, CompletionOptions options, OptionSet passthroughOptions, ImmutableHashSet<string>? roles = null)
Project? project, HostLanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, CompletionOptions options, OptionSet passThroughOptions, ImmutableHashSet<string>? roles = null)
{
if (!options.TriggerOnTyping)
{
Expand All @@ -233,7 +233,7 @@ internal sealed override bool ShouldTriggerCompletion(
}

var providers = _providerManager.GetFilteredProviders(project, roles, trigger, options);
return providers.Any(p => p.ShouldTriggerCompletion(languageServices, text, caretPosition, trigger, options, passthroughOptions));
return providers.Any(p => p.ShouldTriggerCompletion(languageServices, text, caretPosition, trigger, options, passThroughOptions));
}

internal virtual bool SupportsTriggerOnDeletion(CompletionOptions options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected ImmutableArray<IEmbeddedLanguage> GetLanguageProviders(HostLanguageSer

public override ImmutableHashSet<char> TriggerCharacters { get; }

internal sealed override bool ShouldTriggerCompletion(HostLanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, CompletionOptions options, OptionSet passthroughOptions)
internal sealed override bool ShouldTriggerCompletion(HostLanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, CompletionOptions options, OptionSet passThroughOptions)
{
foreach (var language in GetLanguageProviders(languageServices))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed override bool ShouldTriggerCompletion(SourceText text, int caretPo
return ShouldTriggerCompletionImpl(text, caretPosition, trigger, CompletionOptions.Default.TriggerOnTypingLetters);
}

internal sealed override bool ShouldTriggerCompletion(HostLanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, CompletionOptions options, OptionSet passthroughOptions)
internal sealed override bool ShouldTriggerCompletion(HostLanguageServices languageServices, SourceText text, int caretPosition, CompletionTrigger trigger, CompletionOptions options, OptionSet passThroughOptions)
=> ShouldTriggerCompletionImpl(text, caretPosition, trigger, options.TriggerOnTypingLetters);

protected abstract bool ShouldTriggerCompletionImpl(SourceText text, int caretPosition, CompletionTrigger trigger, bool triggerOnTypingLetters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ private async Task CreateSpellCheckCodeIssueAsync(
ExpandedCompletionBehavior = ExpandedCompletionMode.NonExpandedItemsOnly
};

var passthroughOptions = document.Project.Solution.Options;
var passThroughOptions = document.Project.Solution.Options;

var completionList = await service.GetCompletionsAsync(
document, nameToken.SpanStart, options, passthroughOptions, cancellationToken: cancellationToken).ConfigureAwait(false);
document, nameToken.SpanStart, options, passThroughOptions, cancellationToken: cancellationToken).ConfigureAwait(false);
if (completionList.Items.IsEmpty)
{
return;
Expand Down

0 comments on commit 39f4fab

Please sign in to comment.