Skip to content

Method name completion should support parenthesized expressions as well #23

@jamshark70

Description

@jamshark70

Probably already a known issue -- I just wanted to add an issue for tracking it.

Method completion after . works fine when the token preceding the dot is a numeric literal or an identifier:

// all method calls here get full autocompletion behavior
1 + 1.asFloat()

1 + 1.asFloat.rand()

1.0.rand()

Point.new(x, y)

\abc.asString.findRegexp("bc")

x = 1 + 1;
x.asFloat()

But autocompletion doesn't happen if the character preceding . is a closing delimiter:

(1 + 1).asF

x = 1 + 1;
x.asFloat().ra  // "x." autocomp is fine; "asFloat()." then "rand" failed to autocomplete

// ^^ chaining method calls is a common idiom;
// ideally autocompletion would fully support it

[1, 2, 3].wrapE

"abc".findR

'abc'.asStr

{}.pl  // not even Function:play

It might auto complete the method name if the name exists elsewhere in the same document, but it would be nicer if the behavior were consistent.

(As an aside, my first impression of SC-vscodium in Linux is: very impressive!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions