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

Show default values from models preview in the KCL language server #1578

Open
soubinan opened this issue Aug 16, 2024 · 4 comments
Open

Show default values from models preview in the KCL language server #1578

soubinan opened this issue Aug 16, 2024 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed lsp resolver

Comments

@soubinan
Copy link

Enhancement

What we have today
image

The corresponding model is

schema DataGroup:
    class = "Data_Group"
    remark?: str
    keyDataType: "integer" | "ip" | "string" = "string"
    records: [Record]

Would be very useful to have default values from the preview so the user could know what are the default values at the time he wants to instanciate a configuration from a given model.

@Peefy
Copy link
Contributor

Peefy commented Aug 16, 2024

Good Ideas! cc @He1pa

@Peefy Peefy changed the title Show default values from models preview Show default values from models preview in the KCL language server Aug 17, 2024
@Peefy Peefy transferred this issue from kcl-lang/vscode-kcl Aug 17, 2024
@Peefy Peefy added help wanted Extra attention is needed good first issue Good for newcomers resolver lsp labels Aug 17, 2024
@Peefy Peefy added this to the v0.10.0 Release milestone Aug 17, 2024
@He1pa
Copy link
Contributor

He1pa commented Aug 19, 2024

good idea. I will impl this feature later

@soubinan
Copy link
Author

soubinan commented Aug 19, 2024

Thank you @He1pa,
I could say the case is applicable to lambdas functions too

@Peefy
Copy link
Contributor

Peefy commented Sep 10, 2024

I would like to add that we can also add index signature hover information to the schema. e.g.,

schema Config[foo:str, bar:str]:
    [...str]: any
    domain: str = foo
    name: str = bar
    abc?: str = ""
    xyz?: bool = False

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed lsp resolver
Projects
None yet
Development

No branches or pull requests

3 participants