Skip to content

KCL LSP cannot find installed modules #1869

@vlada-dudr

Description

@vlada-dudr

Bug Report

1. Minimal reproduce step (Required)

  1. setup kcl neovim via mason
  2. kcl mod init && kcl mod add k8s
  3. main.k:
import k8s.api.apps.v1 as k8sapps

pod = k8sapps.Deployment {
    metadata.name = "web-app"
    spec = {
        selector = {
            matchLabels = {
                app = "ngx"
            }
        }
        template.spec.containers = [{
            name = "nginx"
            image = "nginx"
            ports = [{
                containerPort = 80
                name = "http"
            }]
        }]
    }
}
  1. observe
    Image
  2. also when you drop into neovim terminal - we have kcl in path via mason you can see this:

Image
6) try nix-shell -p kcl

Image

2. What did you expect to see? (Required)

no errors with lsp and kclvm_cli - go cli is obviously able to find the modules in ~/.kcl

3. What did you see instead (Required)

module not found error - lsp and kclvm_cli are probably not searching in ~/.kcl for modules

4. What is your KCL components version? (Required)

# nix installed - go cli
[nix-shell:~/devel/kcl]$ kcl --version
kcl version v0.10.0

# mason install rust cli/lsp
~/devel/kcl master* ❯ kcl-language-server --version                     
kcl-language-server Version: 0.11.1-c020ab3eb4b9179219d6837a57f5d323    
Platform: x86_64-unknown-linux-gnu                                      
GitCommit: d8964b29170ba28c98a31b561a2d9525112d1f30                     
~/devel/kcl master* ❯ kcl --version                               
kclvm_cli 0.11.1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions