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

[Enhancement][Track] KCL VSCode IDE extension and lsp enhancement #524

Closed
61 tasks done
He1pa opened this issue Apr 20, 2023 · 3 comments · Fixed by #593
Closed
61 tasks done

[Enhancement][Track] KCL VSCode IDE extension and lsp enhancement #524

He1pa opened this issue Apr 20, 2023 · 3 comments · Fixed by #593
Assignees
Labels
ide Issues or PRs related to kcl LSP and IDE plugins long-term lsp track

Comments

@He1pa
Copy link
Contributor

He1pa commented Apr 20, 2023

Enhancement

TODO List

image

image

  • Wrong schema entry completion items for internal schema definition in the schema.

image

  • Support completion for more complex selector and subscript expression syntax, e.g, kind[0].lower() # kind[0] is the string type
schema Person:
    names: [str]

a = (Person{
    names = ["123"]
}.names)?[0]

feat:

lambda a: int {
    b = a # Go to definition feat for `a` in `b = a` is not work.
}

release:
#602

bugfix:

capabilities = option("params").capabilities or ["SETUID", "SETFCAP"]
items = [item | {
    if item.kind == "Pod":
        spec.containers: [{
            "securityContext": {"capabilities": {"add" += [c] if c not in (container?.securityContext?.capabilities?.drop or []) else [] for c in capabilities}}
        } for container in item.spec.containers]
} for item in option("items")]

params = option("params")
toMatch = params.toMatch
toAdd = params.toAdd
items = [item | {
   # If all annotations are matched, patch more annotations
   if all key, value in toMatch {
      item.metadata.annotations[key] == value
   }:
       metadata.annotations: toAdd
} for item in option("items")]
a = "".capitalize() # The function has hover info
b = a.capitalize() # The function has not hover info

releated issues

image

  • Wrong hover item for the package name. expected app got app:

image

image

  • Wrong schema entry completion items for internal schema definition in the schema.

image

  • Support completion for more complex selector and subscript expression syntax, e.g, kind[0].lower() # kind[0] is the string type
schema Person:
    names: [str]

a = (Person{
    names = ["123"]
}.names)?[0]

image

import k8s.api.apps.v1 as appsv1
import k8s.api.core.v1 as corev1
import config

deployment = appsv1.Deployment {
    metadata: config.metadata
    spec: appsv1.DeploymentSpec {
        if config.autoscaling.enabled:
            replicas = config.replicas
        strategy = {
            type =  "RollingUpdate"
            rollingUpdate.maxUnavailable = "50%"
        }
    }
}

image
image

  • Wrong completion items for multiple different char after . e.g. c, o, co

image
image
image

  • Wrong completion items for attribute in the if block.

image

  • Wrong completion items for attribute in the if condition.

image

f = lambda a: [str], b: [str], c: [str] -> [str] {
    c + a + b # The definition of `c` is wrong
}
c = f([], [], [])
@Peefy Peefy added this to the v0.5.0 Release milestone Apr 20, 2023
@Peefy Peefy added the lsp label Apr 20, 2023
@Peefy
Copy link
Contributor

Peefy commented Apr 20, 2023

  • The hover may not work well for the complex selector expr, e.g,. Fib {n = 8}.value at samples/fib.k
  • The hover may not work well for a in a?.b

@amyXia1994
Copy link
Contributor

amyXia1994 commented Apr 24, 2023

  • go to definition failed in base.k (appops/guestbook/base/base.k, Line 7) Can't find ast node from position due to config merge(preprocess in resolver)

@Peefy Peefy changed the title [Enhancement] KCL VSCode extension enhancement [Enhancement] KCL VSCode IDE extension and lsp enhancement May 11, 2023
@amyXia1994
Copy link
Contributor

amyXia1994 commented Jun 21, 2023

@Peefy Peefy closed this as completed in #593 Jul 3, 2023
@Peefy Peefy reopened this Jul 3, 2023
@Peefy Peefy added long-term ide Issues or PRs related to kcl LSP and IDE plugins labels Jul 6, 2023
@Peefy Peefy removed this from the v0.5.0 Release milestone Jul 6, 2023
@Peefy Peefy added this to the v0.6.0 Release milestone Jul 17, 2023
This was referenced Aug 2, 2023
@Peefy Peefy modified the milestones: v0.6.0 Release, v0.7.0 Release Sep 11, 2023
@Peefy Peefy added this to KCL 2023 Sep 18, 2023
@Peefy Peefy moved this to Todo in KCL 2023 Sep 18, 2023
@Peefy Peefy moved this from Todo to Backlog in KCL 2023 Sep 18, 2023
@Peefy Peefy moved this from Backlog to Track Issues in KCL 2023 Oct 9, 2023
@Peefy Peefy added the track label Oct 9, 2023
@Peefy Peefy changed the title [Enhancement] KCL VSCode IDE extension and lsp enhancement [Enhancement][Track] KCL VSCode IDE extension and lsp enhancement Oct 9, 2023
@Peefy Peefy removed this from the v0.7.0 Release milestone Nov 22, 2023
@Peefy Peefy closed this as completed Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ide Issues or PRs related to kcl LSP and IDE plugins long-term lsp track
Projects
No open projects
Status: Track Issues
Development

Successfully merging a pull request may close this issue.

3 participants