Skip to content

Complete keyword arguments - #5

Open
tompng wants to merge 1 commit into
mainfrom
kwargs_completion
Open

Complete keyword arguments#5
tompng wants to merge 1 commit into
mainfrom
kwargs_completion

Conversation

@tompng

@tompngtompng commented Dec 3, 2023

Copy link
Copy Markdown
Member

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_nodeDigTargets.new(parent_nodes_to_analyze,target_node){callback_when_analyzed_target_node}# ↓# Multiple target nodesdig_targets=DigTargets.new(parent_nodes_to_analyze)dig_targets.on(node1){callback1}dig_targets.on(node2){callback2}

@tompngtompng added the enhancement New feature or request label Dec 20, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementNew feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@tompng