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

Associate Camel K schema when modeline is available #483

Merged

Conversation

apupier
Copy link
Member

@apupier apupier commented Jul 16, 2020

completionWithCamelKModelineOnly

@apupier
Copy link
Member Author

apupier commented Jul 22, 2020

this is failing due to redhat-developer/vscode-yaml#323 (well more that VS Code Kubernetes extension is throwing an error but it will be more robust if the error is caught at VS Code Yaml level)

@apupier apupier force-pushed the relyOnCamelKModelineToAssociateSchema branch 2 times, most recently from 971cf95 to 782ac3d Compare July 23, 2020 12:27
@apupier apupier changed the title WIP Associate Camel K schema when modeline is available Associate Camel K schema when modeline is available Jul 23, 2020
@apupier apupier force-pushed the relyOnCamelKModelineToAssociateSchema branch from 782ac3d to d92ae0b Compare July 23, 2020 12:42
@apupier apupier force-pushed the relyOnCamelKModelineToAssociateSchema branch 2 times, most recently from a59621e to b187d49 Compare August 21, 2020 07:43
}

function getCamelKSchemaUrl(): string {
return 'https://raw.githubusercontent.com/apache/camel-k-runtime/master/camel-k-loader-yaml/camel-k-loader-yaml/src/generated/resources/camel-yaml-dsl.json';
Copy link
Member Author

Choose a reason for hiding this comment

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

hardcoded. planning to provide a settings to let user modify it in another task https://issues.redhat.com/browse/FUSETOOLS2-571

@apupier apupier force-pushed the relyOnCamelKModelineToAssociateSchema branch 4 times, most recently from d818db0 to 458ed19 Compare August 21, 2020 08:09
@apupier
Copy link
Member Author

apupier commented Aug 21, 2020

job is green on CI, github is not updatign the status: https://travis-ci.org/github/camel-tooling/vscode-camelk/builds/719861172

CHANGELOG.md Outdated Show resolved Hide resolved
src/CamelKSchemaManager.ts Outdated Show resolved Hide resolved
src/CamelKSchemaManager.ts Outdated Show resolved Hide resolved
src/CamelKSchemaManager.ts Outdated Show resolved Hide resolved
src/CamelKSchemaManager.ts Outdated Show resolved Hide resolved
src/CamelKSchemaManager.ts Outdated Show resolved Hide resolved
src/CamelKSchemaManager.ts Outdated Show resolved Hide resolved
&& textDocument.getText().startsWith(CAMELK_MODELINE_PREFIX)) {
return CAMELK_SCHEMA_URI_PREFIX + resource;
}
return undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that is the default if you don't specify it, but I could be wrong.

Copy link
Member Author

Choose a reason for hiding this comment

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

if you are not sure, it means that it is easier to understand when specifying it

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, was just thinking loud. I am fine with the current way you handle it.

src/CamelKSchemaManager.ts Outdated Show resolved Hide resolved
@apupier apupier force-pushed the relyOnCamelKModelineToAssociateSchema branch from 458ed19 to a850f95 Compare August 21, 2020 08:52
@bfitzpat
Copy link
Contributor

@apupier -- What's the use case for this? User creates a new, blank yaml and wants to create a camel k file? Not arguing that it's not helpful, but wondering where the user is coming at this from. If they create a new yaml Camel K file through the Camel K extension, this is done for them already, right?

@apupier
Copy link
Member Author

apupier commented Aug 23, 2020

What's the use case for this? User creates a new, blank yaml and wants to create a camel k file?

Camel K developers doesn't want to impose *.camelk.yaml file name pattern.

Not arguing that it's not helpful, but wondering where the user is coming at this from.

coming at request from Luca

If they create a new yaml Camel K file through the Camel K extension, this is done for them already, right?

no, when creating from Command Palette, it is reusing the kamel init command and then it is creating with .yaml and not .camelk.yaml

specified and the filename doesn't match the file name pattern

Signed-off-by: Aurélien Pupier <[email protected]>
@apupier apupier force-pushed the relyOnCamelKModelineToAssociateSchema branch from a850f95 to 3f90ee0 Compare August 24, 2020 07:33
@apupier apupier requested a review from lhein August 24, 2020 07:39
@apupier apupier merged commit 5473cdc into camel-tooling:master Aug 25, 2020
@apupier apupier deleted the relyOnCamelKModelineToAssociateSchema branch August 25, 2020 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants