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

Allow a null rootUri during initialization instead of crashing #1815

Closed
neilyio opened this issue May 16, 2024 · 3 comments
Closed

Allow a null rootUri during initialization instead of crashing #1815

neilyio opened this issue May 16, 2024 · 3 comments
Labels
bug Something isn't working editor Related to clojure-lsp on a text editor

Comments

@neilyio
Copy link

neilyio commented May 16, 2024

Describe the bug
I'm trying to get clojure-lsp working with Helix and Babashka. I'm finding that the language server crashes immediately when opening a .clj file without a git repo.

Helix does not send rootUri to language servers if you're not in a git repo, which causes the crash. One-off .clj files seems to be a common workflow with Babashka, so I figure clojure-lsp should support this.

To Reproduce
Steps to reproduce the behavior:

  1. Created an empty file ~/Desktop/bb.clj
  2. Start Helix withhx ~/Desktop/bb.clj

clojure-lsp crashes immediately.

Expected behavior
clojure-lsp should work normally in Helix without a rootUri.

Screenshots

2024-05-16T17:10:34.261Z  INFO [clojure-lsp.server:627] - [SERVER] Starting server...
2024-05-16T17:10:34.308Z  DEBUG [clojure-lsp.nrepl:21] - nrepl not found, skipping nrepl server start...
2024-05-16T17:10:34.321Z  INFO [clojure-lsp.server:509] - Initializing...
2024-05-16T17:10:34.328Z  ERROR [clojure-lsp.server:55] - Error receiving message: Internal error (-32603)
{:id 0, :method "initialize"}
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
                                                                      ...                                 
                                        clojure.core.async/thread-call/fn                  async.clj:  486
                                            lsp4clj.server/thread-loop/fn                 server.clj:  122
                                             lsp4clj.server.ChanServer/fn                 server.clj:  260
                                lsp4clj.server.ChanServer/receive-request                 server.clj:  365
                                  lsp4clj.server/pending-received-request                 server.clj:  181
                                                                      ...                                 
                                                    clojure-lsp.server/fn                 server.clj:  520
                             clojure-lsp.shared/normalize-uri-from-client                 shared.clj:  546
                                              clojure.string/starts-with?                 string.clj:  365
java.lang.NullPointerException: 

User details (please complete the following information):

  • OS: MacOS
  • Editor: Helix
  • Version: clojure-lsp 2024.04.22-11.58.08-nightly
@neilyio neilyio added bug Something isn't working editor Related to clojure-lsp on a text editor labels May 16, 2024
@AjBreidenbach
Copy link

@neilyio, in the meantime you can add (or just touch) a deps.edn adjacent to your script.

You could also add a root to your .config/helix/languages.toml (see https://github.com/helix-editor/helix/blob/master/languages.toml#L2258)

@ericdallo
Copy link
Member

Fixed!

@borkdude
Copy link
Contributor

borkdude commented Aug 5, 2024

Finally!

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

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy