Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit 4d04edb

Browse files
author
MikhailArkhipov
committed
Make old member available for IntelliCode
1 parent ebb70c7 commit 4d04edb

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/Analysis/Engine/Impl/Definitions/IModuleAnalysis.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public interface IModuleAnalysis {
147147
/// <param name="location">
148148
/// The location in the file where the available members should be looked up.
149149
/// </param>
150-
IEnumerable<IMemberResult> GetAllAvailableMembers(SourceLocation location, GetMemberOptions options = GetMemberOptions.IntersectMultipleResults);
150+
IEnumerable<IMemberResult> GetAllMembers(SourceLocation location, GetMemberOptions options = GetMemberOptions.IntersectMultipleResults);
151151

152152
/// <summary>
153153
/// Gets the AST for the given text as if it appeared at the specified location.

src/Analysis/Engine/Impl/ModuleAnalysis.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public IEnumerable<IMemberResult> GetMembers(
351351
GetMemberOptions options = GetMemberOptions.IntersectMultipleResults
352352
) {
353353
if (string.IsNullOrEmpty(exprText)) {
354-
return GetAllAvailableMembers(location, options);
354+
return GetAllMembers(location, options);
355355
}
356356

357357
var expr = GetExpressionForText(exprText, location, out var scope, out var ast);
@@ -631,7 +631,11 @@ public IEnumerable<IOverloadResult> GetOverrideable(SourceLocation location) {
631631
internal IEnumerable<IMemberResult> GetAllAvailableMembersByIndex(
632632
int index,
633633
GetMemberOptions options = GetMemberOptions.IntersectMultipleResults
634-
) => GetAllAvailableMembers(_unit.Tree.IndexToLocation(index), options);
634+
) => GetAllMembers(_unit.Tree.IndexToLocation(index), options);
635+
636+
[Obsolete]
637+
public IEnumerable<MemberResult> GetAllAvailableMembers(SourceLocation location, GetMemberOptions options = GetMemberOptions.IntersectMultipleResults)
638+
=> GetAllMembers(location, options).OfType<MemberResult>();
635639

636640
/// <summary>
637641
/// Gets the available names at the given location. This includes
@@ -642,7 +646,7 @@ internal IEnumerable<IMemberResult> GetAllAvailableMembersByIndex(
642646
/// looked up.
643647
/// </param>
644648
/// <remarks>New in 2.2</remarks>
645-
public IEnumerable<IMemberResult> GetAllAvailableMembers(SourceLocation location, GetMemberOptions options = GetMemberOptions.IntersectMultipleResults) {
649+
public IEnumerable<IMemberResult> GetAllMembers(SourceLocation location, GetMemberOptions options = GetMemberOptions.IntersectMultipleResults) {
646650
var result = new Dictionary<string, IEnumerable<AnalysisValue>>();
647651

648652
// collect builtins

src/LanguageServer/Impl/Implementation/CompletionAnalysis.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ private IEnumerable<CompletionItem> GetCompletionsFromTopLevel(bool allowKeyword
771771
}
772772

773773
_log.TraceMessage($"Completing all names");
774-
var members = Analysis.GetAllAvailableMembers(Position, opts);
774+
var members = Analysis.GetAllMembers(Position, opts);
775775

776776
if (allowArguments) {
777777
var finder = new ExpressionFinder(Tree, new GetExpressionOptions { Calls = true });

src/LanguageServer/Impl/Implementation/Server.WorkspaceSymbols.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private static async Task<List<IMemberResult>> GetModuleVariablesAsync(ProjectEn
7272
}
7373

7474
private static IEnumerable<IMemberResult> GetModuleVariables(ProjectEntry entry, GetMemberOptions opts, string prefix, IModuleAnalysis analysis) {
75-
var all = analysis.GetAllAvailableMembers(SourceLocation.None, opts);
75+
var all = analysis.GetAllMembers(SourceLocation.None, opts);
7676
return all
7777
.Where(m => {
7878
if (m.Values.Any(v => v.DeclaringModule == entry || v.Locations.Any(l => l.DocumentUri == entry.DocumentUri))) {

0 commit comments

Comments
 (0)