Skip to content

Conversation

tompng
Copy link
Member

@tompng tompng commented Dec 3, 2023

kwarg

For obj.foo ba, ba can be an lvar, method or keyword that starts with ba.
We need to check two things, type of obj and scope at ba in a single analyze.
Completion candidates will be:

  • keyword arguments names of obj.foo
  • local variables in scope at ba
  • methods of self in scope at ba

To do it, ReplTypeCompletion::TypeAnalyze::DigTargets is changed.

# This class is used to check if the node is analyze target, and to skip analyze for some node.
# For `def f;long_code;end; def g; 1.a`, `def f` is skipped, `1` is target_node.

# Only single target_node
DigTargets.new(parent_nodes_to_analyze, target_node){
  callback_when_analyzed_target_node
}
# ↓
# Multiple target nodes
dig_targets = DigTargets.new(parent_nodes_to_analyze)
dig_targets.on(node1){callback1}
dig_targets.on(node2){callback2}

@tompng tompng added the enhancement New feature or request label Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant