Skip to content
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

Provide a mechanism to select the current DSL #136

Closed
lordrip opened this issue Sep 20, 2023 · 4 comments
Closed

Provide a mechanism to select the current DSL #136

lordrip opened this issue Sep 20, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed source code editor Source Code Editor-related issues
Milestone

Comments

@lordrip
Copy link
Member

lordrip commented Sep 20, 2023

Context

Currently, there's no global state nor provider to determine the current DSL, and this is required to properly set the correct schema into the Source Code editor

Goal

We need to decide whether to use a global UI store or a react provider to store the following information:

{
  currentDsl: CamelRoute | KameletBinding | Kamelet | Pipe | Integration
}

whereas each DSL object would have:

{
  name: string;
  schema: Record<string, unknown>;
  multipleRoute: boolean;
}

Note

  1. It would be beneficial to have a registry class to place the available DSL with their corresponding schemas and potentially allowed nodes (Camel Components, Processors, Kamelets, etc...)
  2. This issue is a prerequisite of: Port multiple route support controls from kaoto #81
@lordrip lordrip added enhancement New feature or request help wanted Extra attention is needed source code editor Source Code Editor-related issues labels Sep 20, 2023
@lordrip lordrip added this to the 0.1.0 - Smart Connectors' MVP milestone Sep 20, 2023
@mmelko mmelko self-assigned this Sep 20, 2023
@lordrip
Copy link
Member Author

lordrip commented Sep 21, 2023

After discussing it, it makes more sense to have a dedicated property within the EntityContext object in order to be determined when we're parsing the YAML source code.

@lhein
Copy link
Contributor

lhein commented Sep 22, 2023

I am quite curious why the source code editor cannot auto detect what is in the code. Of course you will have to provide a selector if you start with a blank source editor.

@lordrip
Copy link
Member Author

lordrip commented Sep 22, 2023

There are two ways to signal the source code editor which schema or language to use:

  1. Set all the schemas beforehand and instruct the source code editor to apply the correct one depending on the filename. We're doing this for .camel.yaml files in VSCode
  2. Inspect what's the content of the source code editor (parsing) and apply the correct schema afterward.

Since we don't have filenames in kaoto-next at the moment, we'll go with the second approach, detecting the content and reacting accordingly.

@lordrip
Copy link
Member Author

lordrip commented Oct 5, 2023

Closed by #172

@lordrip lordrip closed this as completed Oct 5, 2023
@lhein lhein modified the milestones: Smart Connectors' MVP, Feature Parity Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed source code editor Source Code Editor-related issues
Projects
Archived in project
Development

No branches or pull requests

3 participants