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

Unable to require suggested namespace when ns isn't present #1734

Open
raghavio opened this issue Dec 7, 2023 · 0 comments
Open

Unable to require suggested namespace when ns isn't present #1734

raghavio opened this issue Dec 7, 2023 · 0 comments
Labels
bug Something isn't working editor Related to clojure-lsp on a text editor

Comments

@raghavio
Copy link

raghavio commented Dec 7, 2023

Describe the bug
I'm trying to do a require via VSCode's quick fix suggestion box. It's failing with below error in output:

Request workspace/executeCommand failed.
  Message: Internal error
  Code: -32603 
[object Object]

This is failing only when I don't have a namespace declartion in my file at the top using the ns macro.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new clj file.
  2. Write any function from another namespace. eg: str/split-lines
  3. VSCode will show a pop up for quick fix to require the namespace.
  4. See error

Expected behavior
I expect it to add the require namespace using the require function but it's failing.

Log - clojure-lsp
2023-12-06T19:22:28.758Z  INFO [clojure-lsp.handlers:475] - :code-actions 87ms
2023-12-06T19:22:28.877Z  INFO [clojure-lsp.handlers:475] - :code-actions 3ms
2023-12-06T19:22:29.070Z  INFO [clojure-lsp.handlers:502] - :semantic-tokens-full 1ms
2023-12-06T19:22:29.739Z  INFO [clojure-lsp.handlers:385] - :clojuredocs-raw 0ms
2023-12-06T19:22:29.739Z  INFO [clojure-lsp.handlers:385] - :clojuredocs-raw 0ms
2023-12-06T19:22:29.937Z  INFO [clojure-lsp.handlers:475] - :code-actions 1ms
2023-12-06T19:22:30.099Z  INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2023-12-06T19:22:30.362Z  INFO [clojure-lsp.handlers:475] - :code-actions 1ms
2023-12-06T19:22:32.580Z  ERROR [clojure-lsp.server:55] - Error receiving message: Internal error (-32603)
{:id 6808, :method "workspace/executeCommand"}
com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine  PosixPlatformThreads.java:  211
            com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine       PlatformThreads.java:  832
                                                     java.lang.Thread.run                Thread.java: 1583
                                                 java.lang.Thread.runWith                Thread.java: 1596
                       java.util.concurrent.ThreadPoolExecutor$Worker.run    ThreadPoolExecutor.java:  642
                        java.util.concurrent.ThreadPoolExecutor.runWorker    ThreadPoolExecutor.java: 1144
                   java.util.concurrent.CompletableFuture$AsyncSupply.run     CompletableFuture.java: 1768
                                                promesa.util.Supplier/get                  util.cljc:   34
                                            promesa.exec/wrap-bindings/fn                  exec.cljc:  163
                                                 clojure-lsp.server/fn/fn                 server.clj:  396
                                     clojure-lsp.handlers/execute-command               handlers.clj:  422
                                            clojure-lsp.handlers/refactor               handlers.clj:  397
                               clojure-lsp.feature.refactor/call-refactor               refactor.clj:  194
                                                                      ...                                 
                                          clojure-lsp.feature.refactor/fn               refactor.clj:   37
                                                       clojure.core/apply                   core.clj:  671
                                                                      ...                                 
           clojure-lsp.feature.add-missing-libspec/add-require-suggestion    add_missing_libspec.clj:  493
                  clojure-lsp.feature.add-missing-libspec/add-known-alias    add_missing_libspec.clj:  255
                 clojure-lsp.feature.add-missing-libspec/add-to-namespace    add_missing_libspec.clj:  241
                clojure-lsp.feature.add-missing-libspec/add-to-namespace*    add_missing_libspec.clj:  124
                                           rewrite-clj.zip.subedit/subzip               subedit.cljc:   76
java.lang.AssertionError: Assert failed: could not create subzipper.
                          zloc'

2023-12-06T19:22:32.588Z INFO [clojure-lsp.handlers:475] - :code-actions 6ms

User details (please complete the following information):

  • OS: [e.g. ArchLinux, MacOS, Windows 10] Windows 10
  • Editor [e.g. emacs, nvim, VSCode (Calva)] VSCode (Calva)
  • Version: (post the result of clojure-lsp --version) 2023.10.30-16.25.41
@raghavio raghavio added bug Something isn't working editor Related to clojure-lsp on a text editor labels Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working editor Related to clojure-lsp on a text editor
Projects
None yet
Development

No branches or pull requests

1 participant