Skip to content

Project Builder API #1780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from
Draft

Project Builder API #1780

wants to merge 20 commits into from

Conversation

MaxAtoms
Copy link
Collaborator

No description provided.

@MaxAtoms MaxAtoms added the enhancement New feature or request label Jun 24, 2025
@MaxAtoms
Copy link
Collaborator Author

MaxAtoms commented Jun 24, 2025

This crude prototype can be executed via: npx ts-node src/project/flowr-analyzer.ts

@MaxAtoms MaxAtoms requested a review from EagleoutIce June 24, 2025 19:18
Copy link
Member

@EagleoutIce EagleoutIce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the basic structure :)

return this;
}

public setEngine(engine : 'tree-sitter' | 'r-shell') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the KnownParser type which... Should be renamed to known engine :p

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we want to have an extra field for the engine that has precedence over the options?
It gets a bit confusing when doing something like this:

await new FlowrAnalyzerBuilder(require("x <- 1"))
	.setEngine(new RShell())
	.amendConfig(c => {
		c.defaultEngine = 'tree-sitter'
		return c;
	}).build();

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction: Take name property from KnownParser

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amendConfig should accept a function that can return FlowrConfigOptions | void.
Disabling the eslint warning is fine

this.parser = parser;
}

public async dataflow() : Promise<PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using default data flow pipeline here is... Wrong in general we should select the type based on the engine :D in general we maybe want to embed a cache?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general we maybe want to embed a cache?

Yes, I think that would make sense. We need to have the dataflow analysis results for the query execution anyways. In theory, the slicing pipeline could re-use the dataflow step results, but I'm not sure whether we should enable this right now

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.

3 participants