Skip to content

[Task]: Build completions datasets for ACE autocompleters #1954

@norberttech

Description

@norberttech

What needs to be done?

In the first version we need just 3 types of completions:

  • Methods of src/core/etl/src/Flow/ETL/DataFrame.php - so can be recommended when used on df() or data_frame() dsl functions and most of DataFrame methods as DataFrame implements fluent interface.
  • Methods of src/core/etl/src/Flow/ETL/Function/ScalarFunctionChain.php - so we can suggest methods available on any standalone scalar functions like lit() or ref() etc.
  • DSL Functions - we should autocomplete all possible DSL functions

Building those completions shouldn't be too hard, however there is a catch here.

Since Ace Editor operates on regular expressions, we might need to build those expressions while analyzing codebase.

Lets take a look at DataFrame, this particular class implements FluentInterface, which means that we need to suggest methods of DataFrame on:

  • df()-> - scalar functions
  • data_frame()-> - scalar functions
  • df()->method()-> - on results of those data frame methods that returns instance of data fame

ScalarFunctionChain methods should be recommended on:

  • all standalone scalar functions like lit() or ref() but in our DSL all scalar functions are marked with #[DocumentationDSL(module: Module::CORE, type: DSLType::SCALAR_FUNCTION)] attribute which should be a huge help

Standaloen Scalar Functions:

in this case we just want those functions to have higher priority than php build in functions so they are higher on the list of recommendations.

So in general there should be 3 completers:

  • data_frame
  • scalar_function_chain
  • scalar_function

And the php code should output them all directly into: web/landing/assets/ace/completers/{name}.js.

I think the logic of building those should live in web/landing and more specifically in Symfony Framework Commands web/landing/src/Flow/Website/Command and they should be executed during composer build

Each completer should have it's own command.
To generate javascript code we should use Twig.

As for references and finding code, that Symfony app has a parameter called flow_root_dir which pretty much points to monorepo root.

Details about how to build Ace Editor completers: autocompleters.md

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions