Skip to content

Commit

Permalink
simplified the filtering logic for internals visible to
Browse files Browse the repository at this point in the history
  • Loading branch information
filipw committed Aug 19, 2020
1 parent 72f179a commit 4e70b5c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ public async Task<CompletionResponse> Handle(CompletionRequest request)
for (int i = 0; i < completions.Items.Length; i++)
{
var completion = completions.Items[i];
if (!completion.IsVisible()) continue;

var commitCharacters = buildCommitCharacters(completions, completion.Rules.CommitCharacterRules, triggerCharactersBuilder);

var insertTextFormat = InsertTextFormat.PlainText;
Expand All @@ -168,7 +166,7 @@ public async Task<CompletionResponse> Handle(CompletionRequest request)
// span, only assembly keys at the end if they exist.
{
// if the completion is for the hidden Misc files project, skip it

if (completion.DisplayText == Configuration.OmniSharpMiscProjectName) continue;
CompletionChange change = await completionService.GetChangeAsync(document, completion);
Debug.Assert(typedSpan == change.TextChange.Span);
insertText = change.TextChange.NewText!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,5 @@ public static AutoCompleteResponse ToAutoCompleteResponse(this CompletionItem it

return response;
}

public static bool IsVisible(this CompletionItem item)
{
switch (item.GetProviderName())
{
case InternalsVisibleToCompletionProvider:
if (item.DisplayText == Configuration.OmniSharpMiscProjectName) return false;
break;
}

return true;
}
}
}

0 comments on commit 4e70b5c

Please sign in to comment.