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

Breadcrumbs missing from babashka scripts without file extensions. #1841

Closed
jeffp42ker opened this issue Aug 25, 2022 · 4 comments
Closed

Breadcrumbs missing from babashka scripts without file extensions. #1841

jeffp42ker opened this issue Aug 25, 2022 · 4 comments
Labels

Comments

@jeffp42ker
Copy link

We have a few babashka scripts without file extensions that begin with a shebang to indicate they're babashka scripts:

#!/usr/bin/env bb
; vim: ft=clojure
(load-file "common.bb")

The status bar indicates they are Clojure files. However, the breadcrumbs at the top of the file which lists the functions in the file etc do not appear.

Related slack thread: https://clojurians.slack.com/archives/CBE668G4R/p1661453621026229

@PEZ PEZ added the lsp label Aug 25, 2022
@PEZ
Copy link
Collaborator

PEZ commented Aug 25, 2022

Thanks! As we've found out in the slack thread, this is related to clojure-lsp, or maybe to how Calva uses clojure-lsp. I tested with a file with this content:

#!/bin/bb

(ns my.app)

(defn ^:dev/before-load stop []
  (js/console.log "stop"))

(defn ^:dev/after-load start []
  (js/console.log "start"))

If the name of the file is app.cljs I find this in the log between Calva and the clojure-lsp server:

[Trace - 10:08:44 PM] Sending request 'textDocument/codeAction - (31)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/pez/Projects/tests/minimal-shadow-cljs/src/my/app.cljs"
    },
    "range": {
        "start": {
            "line": 0,
            "character": 0
        },
        "end": {
            "line": 0,
            "character": 0
        }
    },
    "context": {
        "diagnostics": [],
        "triggerKind": 2
    }
}


[Trace - 10:08:44 PM] Received response 'textDocument/documentHighlight - (30)' in 2ms.
Result: [
    {
        "range": {
            "start": {
                "line": 4,
                "character": 7
            },
            "end": {
                "line": 4,
                "character": 23
            }
        }
    }
]

Whereas I name it file, without any extension, VS Code identifies it as a Clojure file, but the client<->server log contains this:

[Trace - 10:07:51 PM] Sending request 'textDocument/documentHighlight - (28)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/pez/Projects/tests/minimal-shadow-cljs/src/my/file"
    },
    "position": {
        "line": 8,
        "character": 22
    }
}


[Trace - 10:07:51 PM] Received response 'textDocument/documentHighlight - (28)' in 1ms.
Result: []

CC: @ericdallo

@ericdallo
Copy link
Contributor

I get this on emacs:
2022-08-25_17-39

maybe it's a clojure-lsp bug indeed

@ericdallo
Copy link
Contributor

@PEZ I confirmed it's a bug on clojure-lsp, please open a issue there

@PEZ
Copy link
Collaborator

PEZ commented Apr 4, 2024

I think this is fixed upstream.

@PEZ PEZ closed this as completed Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants