clojure-lsp / clojure-lsp

Clojure & ClojureScript Language Server (LSP) implementation

Home Page:https://clojure-lsp.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LSP Organize imports code action not working with a `#_` comment

victorpigmeo opened this issue · comments

Describe the bug
When I have a #_ comment on my file, the code action "LSP Organize Imports" throws an Internal Error

To Reproduce
Steps to reproduce the behavior:

  1. Open any project
  2. Run "LSP Organize Imports" code action (I think it is the clean-ns command)
  3. See error

Expected behavior
The code action works, ignoring the commented lines with #_

clojure-lsp output
2024-05-22T20:03:20.527Z  ERROR [clojure-lsp.server:55] - Error receiving message: Internal error (-32603)
{:id 46377, :method "workspace/executeCommand"}
com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine  PosixPlatformThreads.java:  211
            com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine       PlatformThreads.java:  833
                                                     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:  410
                                     clojure-lsp.handlers/execute-command               handlers.clj:  347
                                 clojure-lsp.feature.command/call-command                command.clj:  210
                                                                      ...                                 
                                           clojure-lsp.feature.command/fn                command.clj:   42
                              clojure-lsp.feature.clean-ns/clean-ns-edits               clean_ns.clj:  455
                            clojure-lsp.feature.clean-ns/sort-ns-children               clean_ns.clj:  415
                                    rewrite-clj.zip/find-next-depth-first                   zip.cljc:  423
                              rewrite-clj.zip.findz/find-next-depth-first                 findz.cljc:   81
                                          rewrite-clj.zip.findz/find-next                 findz.cljc:   75
                                               rewrite-clj.zip.findz/find                 findz.cljc:   44
                                                       clojure.core/first                   core.clj:   55
                                                                      ...                                 
                                               clojure.core/drop-while/fn                   core.clj: 2994
                                             clojure.core/drop-while/step                   core.clj: 2991
                                               clojure.core/complement/fn                   core.clj: 1455
                         clojure-lsp.feature.clean-ns/sort-ns-children/fn               clean_ns.clj:  416
                                                    rewrite-clj.zip/sexpr                   zip.cljc:  254
                                               rewrite-clj.zip.base/sexpr                  base.cljc:   76
                                         rewrite-clj.node.protocols/sexpr             protocols.cljc:   49
                                rewrite-clj.node.uneval.UnevalNode/sexpr*                uneval.cljc:   14
clojure.lang.ExceptionInfo: unsupported operation

2024-05-22T20:03:20.612Z INFO [clojure-lsp.handlers:302] - :document-highlight 0ms
2024-05-22T20:03:20.632Z INFO [clojure-lsp.handlers:400] - :code-actions 21ms

User details (please complete the following information):

  • OS: Debian Linux
  • Version:
    clojure-lsp 2024.05.22-14.51.25-nightly
    clj-kondo 2024.05.22

Additional context
Add any other context about the problem here.