mechatroner / rainbow_csv

🌈Rainbow CSV - Vim plugin: Highlight columns in CSV and TSV files and run queries in SQL-like language
MIT License
626 stars 22 forks source link

[feature] Add complete for command #15

Open Freed-Wu opened 4 years ago

Freed-Wu commented 4 years ago

such as type Tab after :Select ma it will automatically complete max(?

Thanks!

mechatroner commented 4 years ago

Hi @Freed-Wu , I can try to add built-in Python keywords and available column names to generate the autocomplete, but this is

  1. Hard to do - I implemented column names autocomplete for VSCode version of the plugin, and it took me much more time than I originally expected.
  2. This autocomplete will not be capable of deep code analysis, i.e. if the user enters :Select random. and presses Tab there is no way that any relatively-simple autocomplete mechanism would be able to fetch the list of available methods from the random module. So the autocomplete would provide only very limited completion options therefore reducing its usefulness.

So I guess at some point I would try to implement a basic autocomplete: column names in dictionary/attribute forms + builtin functions and keywords from SQL and Python/JS