Skip to content

Filter completion items based on access modifiers (e.g. public/private) #12

@MartTave

Description

@MartTave

For now, the completion serves all the members of a struct without any distinction for the access modifier.

As a first step, we could at least differentiate the two when serving completion items.

But in its final state, we might need to detect the current scope and accessibility of the members, and put a warning (or something else) to tell the user that this member exists, but is not accessible in this context.

Example :

struct A {
  public memberwise init
  private let m1: Bool
}

let a = A(m1: true)

a. // <- trigger completion here
// For now, it returns :
// - m1: let Bool

// And it should return something like :
// - private m1: Bool
// or :
// - m1: Bool          ! This member is not accessible in this scope

I'm not convinced of the solutions I'm proposing, but I'm pretty confident that we can't leave it as is :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions