tarantool / tarantool/tarantool

console.completion: support paths with indexing by square brackets

Open
#10,724 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Lua
Stars
3.7k
Forks
419
Avg merge
1d 23h
Merged PRs (30d)
88

Description

> tabcomplete = function(s)
    return require('console').completion_handler(s, 0, #s)
end
> object = {{a =1}, key = {b = 2}}

Now supported only indexing by field

tabcomplete("object.key.")
- - object.key.b
  - object.key.b

Add support for:

tabcomplete("object['key'].")
tabcomplete("object[1].")
tabcomplete("object.")
- - object.key
  - object[1] # also add this maybe

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the console.completion_handler entry point and trace the existing field-indexing completion logic. Add coverage for object['key']. and object[1]., and determine whether object. should also suggest bracketed indexes; done means these examples return the expected completions.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.