BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.62k stars 213 forks source link

keywords not highlighted #2337

Closed evanlouie closed 9 months ago

evanlouie commented 10 months ago

Running into an issue where keywords aren't being syntax highlighted correctly. All other highlighting is working properly.

Issues:

https://github.com/BetterThanTomorrow/calva/assets/2081587/0aa40c56-7976-42ba-afb3-42e0350ab73a

PEZ commented 10 months ago

Can you reproduce this in a minimal project and share it? Easier to reason about what could be going wrong that way.

EvaMarco commented 10 months ago

https://github.com/BetterThanTomorrow/calva/assets/48989967/f561beaa-2dee-4752-bc8c-874066253d0e

This is happening to me since this morning I updated the pluggin. Once highlight goes all white it doesn't go back.

PEZ commented 10 months ago

Thanks for the report @EvaMarco! Can test with the Github Dark Default theme? That way I can compare with what I see.

EvaMarco commented 10 months ago

Screenshot from 2023-11-06 14-17-20 With that theme I see this, but I don't know if it changes or not

PEZ commented 10 months ago

Thanks! I can reproduce this in some projects, but not in others. Since the problem just recently showed up, it could be something is glitching in VS Code. We should probably check the VS Code issues for recent reports on similar things.

Since it differs between projects it could also be something with the clojure-lsp config different between the projects.

@ericdallo:

Do you have any idea what to look for in the logs or server info or lsp server config for any clues?

Tokens and scopes for a keyword in a project where it doesn't work:

image

The data from the lsp scopes request:

[13, 4, 16, 0, 0, 7, 1, 5, 3, 0, 0, 6, 13, 2, 1, 0, 15, 10, 6, 0, 1, 3, 1, 1, 0, 0, 1, 1, 8, 0, 0, 1, 3, 2, 0, 0, 5, 9, 6, 0, 0, 32, 4, 1, 0, 0, 4, 1, 8, 0, 0, 1, 7, 2, 0, 0, 9, 10, 6, 0, 1, 10, 10, 6, 0, 0, 12, 1, 1, 0, 0, 1, 1, 8, 0, 0, 1, 2, 2, 0, 0, 3, 9, 6, 0, 3, 28, 9, 7, 0, 1, 10, 6, 6, 0, 0, 8, 7, 2, 0, 0, 28, 10, 6, 0, 1, 5, 3, 3, 0, 0, 4, 6, 2,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0, 1, 1, 8, 0, 0, 1, 3, 2, 0, 0, 5, 5, 6, 0, 0, 7, 11, 2, 0, 1, 10, 7, 6, 0, 0, 9, 13, 2, 0, 1, 10, 3, 6, 0, 0, 5, 4, 2, 0, 0, 6, 2, 3, 0, 0, 4, 4, 6, 0, 0, 5, 6, 6, 0, 1, 23, 4, 6, 0, 0, 5, 6, 6, 0, 1, 20, 5, 6, 0, 0, 6, 7, 6, 0, 1, 5, 3, 3, 0, 0, 4, 3, 2, 1, 0, 4, 3, 6, 0, 1, 3, 11, 2, 0, 1, 2, 5, 2, 0, 1, 3, 13, 2, 0, 1, 3, 2, 3, 0, 0, 4, 1, 1, 0, 0, 1, 1, 8, 0, 0, 1, 3, 2, 0, 0, 4, 7, 2, 0, 1, 7, 1, 1, 0, 0, 1, 1, 8, 0, 0, 1, 4, 2, 0, 0, 7, 14, 2, 0, 0, 15, 1, 6, 0]

I pasted the same file content in a project where keywords are correctly highlighted:

image

Scopes request data:

[13, 4, 16, 0, 0, 1, 4, 7, 4, 0, 0, 19, 2, 4, 0, 1, 27, 2, 4, 0, 1, 27, 2, 4, 0, 1, 29, 2, 4, 0, 1, 25, 2, 4, 0, 2, 1, 5, 3, 0, 0, 6, 13, 2, 1, 0, 15, 10, 6, 0, 1, 3, 1, 1, 0, 0, 1, 1, 8, 0, 0, 1, 3, 2, 0, 0, 5, 9, 6, 0, 0, 11, 6, 1, 0, 0, 6, 1, 8, 0, 0, 1, 12, 2, 0, 0, 14, 4, 1, 0, 0, 4, 1, 8, 0, 0, 1, 7, 2, 0, 0, 9, 10, 6, 0, 1, 10, 10, 6, 0, 0, 12, 1, 1, 0, 0, 1, 1, 8, 0, 0, 1, 2, 2, 0, 0, 3, 9, 6, 0, 1, 27, 6, 1, 0, 0, 6, 1, 8, 0, 0, 1, 21, 2, 0, 2, 28, 9, 7, 0, 1, 10, 6, 6, 0, 0, 8, 7, 2, 0, 0, 28, 10, 6, 0, 1, 5, 3, 3, 0, 0, 4, 6, 2, 1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 1, 1, 8, 0, 0, 1, 3, 2, 0, 0, 5, 5, 6, 0, 0, 7, 11, 2, 0, 1, 10, 7, 6, 0, 0, 9, 13, 2, 0, 1, 10, 3, 6, 0, 0, 5, 4, 2, 0, 0, 6, 2, 3, 0, 0, 4, 4, 6, 0, 0, 5, 6, 6, 0, 1, 23, 4, 6, 0, 0, 5, 6, 6, 0, 1, 20, 5, 6, 0, 0, 6, 7, 6, 0, 1, 5, 3, 3, 0, 0, 4, 3, 2, 1, 0, 4, 3, 6, 0, 1, 3, 11, 2, 0, 1, 2, 5, 2, 0, 1, 3, 13, 2, 0, 1, 3, 2, 3, 0, 0, 4, 1, 1, 0, 0, 1, 1, 8, 0, 0, 1, 3, 2, 0, 0, 4, 7, 2, 0, 1, 7, 1, 1, 0, 0, 1, 1, 8, 0, 0, 1, 4, 2, 0, 0, 22, 1, 6, 0, 1, 3, 3, 4, 0]
EvaMarco commented 10 months ago

This happened to me with the last version of VSCode and the previous one.

PEZ commented 10 months ago

In the project where this is not working for me, the keywords sometimes are correctly highlighted when I activate the file. Only sometimes. Editing the file immediately breaks the highlighting. Attaching a part of the lsp message log that spans such a working->not-working transition:

log ``` 2023-11-07T13:00:46.683Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:46.683Z] Received request 'textDocument/codeAction - (3279)' Params: { "text-document" : { "uri" : "file:///Users/pez/.config/clj-kondo/config.edn" }, "range" : { "start" : { "line" : 0, "character" : 0 }, "end" : { "line" : 0, "character" : 0 } }, "context" : { "diagnostics" : [ ], "trigger-kind" : 2 } } 2023-11-07T13:00:46.684Z INFO [clojure-lsp.handlers:475] - :code-actions 0ms 2023-11-07T13:00:46.684Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:46.684Z] Sending response 'textDocument/codeAction - (3279)'. Request took 1ms. Result: [ { "title" : "Change coll to vector", "kind" : "refactor", "command" : { "title" : "Change coll", "command" : "change-coll", "arguments" : [ "file:///Users/pez/.config/clj-kondo/config.edn", 0, 0, "vector" ] } }, { "title" : "Change coll to set", "kind" : "refactor", "command" : { "title" : "Change coll", "command" : "change-coll", "arguments" : [ "file:///Users/pez/.config/clj-kondo/config.edn", 0, 0, "set" ] } }, { "title" : "Change coll to list", "kind" : "refactor", "command" : { "title" : "Change coll", "command" : "change-coll", "arguments" : [ "file:///Users/pez/.config/clj-kondo/config.edn", 0, 0, "list" ] } }, { "title" : "Move to let", "kind" : "refactor.extract", "command" : { "title" : "Move to let", "command" : "move-to-let", "arguments" : [ "file:///Users/pez/.config/clj-kondo/config.edn", 0, 0, "new-binding" ] } }, { "title" : "Extract to def", "kind" : "refactor.extract", "command" : { "title" : "Extract to def", "command" : "extract-to-def", "arguments" : [ "file:///Users/pez/.config/clj-kondo/config.edn", 0, 0, null ] } }, { "title" : "Sort map", "kind" : "refactor.rewrite", "command" : { "title" : "Sort map", "command" : "sort-clauses", "arguments" : [ "file:///Users/pez/.config/clj-kondo/config.edn", 0, 0 ] } }, { "title" : "Introduce let", "kind" : "refactor.extract", "command" : { "title" : "Introduce let", "command" : "introduce-let", "arguments" : [ "file:///Users/pez/.config/clj-kondo/config.edn", 0, 0, "new-binding" ] } }, { "title" : "Clean namespace", "kind" : "source.organizeImports", "command" : { "title" : "Clean namespace", "command" : "clean-ns", "arguments" : [ "file:///Users/pez/.config/clj-kondo/config.edn", 0, 0 ] } } ] 2023-11-07T13:00:46.931Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:46.931Z] Received request 'textDocument/codeAction - (3280)' Params: { "text-document" : { "uri" : "file:///Users/pez/.config/clj-kondo/config.edn" }, "range" : { "start" : { "line" : 3, "character" : 50 }, "end" : { "line" : 3, "character" : 50 } }, "context" : { "diagnostics" : [ ], "trigger-kind" : 2 } } 2023-11-07T13:00:46.931Z INFO [clojure-lsp.handlers:475] - :code-actions 0ms 2023-11-07T13:00:46.932Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:46.932Z] Sending response 'textDocument/codeAction - (3280)'. Request took 1ms. Result: [ { "title" : "Drag backward", "kind" : "refactor.rewrite", "command" : { "title" : "Drag backward", "command" : "drag-backward", "arguments" : [ "file:///Users/pez/.config/clj-kondo/config.edn", 3, 50 ] } }, { "title" : "Clean namespace", "kind" : "source.organizeImports", "command" : { "title" : "Clean namespace", "command" : "clean-ns", "arguments" : [ "file:///Users/pez/.config/clj-kondo/config.edn", 3, 50 ] } } ] 2023-11-07T13:00:47.129Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:47.129Z] Received request 'textDocument/semanticTokens/full - (3281)' Params: { "text-document" : { "uri" : "file:///Users/pez/.config/clj-kondo/config.edn" } } 2023-11-07T13:00:47.129Z INFO [clojure-lsp.handlers:502] - :semantic-tokens-full 0ms 2023-11-07T13:00:47.129Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:47.129Z] Sending response 'textDocument/semanticTokens/full - (3281)'. Request took 0ms. Result: { "data" : [ ] } 2023-11-07T13:00:47.518Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:47.518Z] Received request 'textDocument/codeAction - (3282)' Params: { "text-document" : { "uri" : "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs" }, "range" : { "start" : { "line" : 0, "character" : 0 }, "end" : { "line" : 0, "character" : 0 } }, "context" : { "diagnostics" : [ ], "trigger-kind" : 2 } } 2023-11-07T13:00:47.520Z INFO [clojure-lsp.handlers:475] - :code-actions 2ms 2023-11-07T13:00:47.520Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:47.520Z] Sending response 'textDocument/codeAction - (3282)'. Request took 2ms. Result: [ { "title" : "Move to let", "kind" : "refactor.extract", "command" : { "title" : "Move to let", "command" : "move-to-let", "arguments" : [ "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", 0, 0, "new-binding" ] } }, { "title" : "Extract to def", "kind" : "refactor.extract", "command" : { "title" : "Extract to def", "command" : "extract-to-def", "arguments" : [ "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", 0, 0, null ] } }, { "title" : "Drag forward", "kind" : "refactor.rewrite", "command" : { "title" : "Drag forward", "command" : "drag-forward", "arguments" : [ "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", 0, 0 ] } }, { "title" : "Introduce let", "kind" : "refactor.extract", "command" : { "title" : "Introduce let", "command" : "introduce-let", "arguments" : [ "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", 0, 0, "new-binding" ] } }, { "title" : "Clean namespace", "kind" : "source.organizeImports", "command" : { "title" : "Clean namespace", "command" : "clean-ns", "arguments" : [ "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", 0, 0 ] } } ] 2023-11-07T13:00:47.767Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:47.767Z] Received request 'textDocument/codeAction - (3283)' Params: { "text-document" : { "uri" : "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs" }, "range" : { "start" : { "line" : 24, "character" : 35 }, "end" : { "line" : 24, "character" : 35 } }, "context" : { "diagnostics" : [ ], "trigger-kind" : 2 } } 2023-11-07T13:00:47.770Z INFO [clojure-lsp.handlers:475] - :code-actions 3ms 2023-11-07T13:00:47.770Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:47.770Z] Sending response 'textDocument/codeAction - (3283)'. Request took 3ms. Result: [ { "title" : "Move to let", "kind" : "refactor.extract", "command" : { "title" : "Move to let", "command" : "move-to-let", "arguments" : [ "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", 24, 35, "new-binding" ] } }, { "title" : "Extract to def", "kind" : "refactor.extract", "command" : { "title" : "Extract to def", "command" : "extract-to-def", "arguments" : [ "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", 24, 35, null ] } }, { "title" : "Drag backward", "kind" : "refactor.rewrite", "command" : { "title" : "Drag backward", "command" : "drag-backward", "arguments" : [ "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", 24, 35 ] } }, { "title" : "Drag forward", "kind" : "refactor.rewrite", "command" : { "title" : "Drag forward", "command" : "drag-forward", "arguments" : [ "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", 24, 35 ] } }, { "title" : "Introduce let", "kind" : "refactor.extract", "command" : { "title" : "Introduce let", "command" : "introduce-let", "arguments" : [ "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", 24, 35, "new-binding" ] } }, { "title" : "Clean namespace", "kind" : "source.organizeImports", "command" : { "title" : "Clean namespace", "command" : "clean-ns", "arguments" : [ "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", 24, 35 ] } } ] 2023-11-07T13:00:47.962Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:47.962Z] Received request 'textDocument/semanticTokens/full - (3284)' Params: { "text-document" : { "uri" : "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs" } } 2023-11-07T13:00:47.963Z INFO [clojure-lsp.handlers:502] - :semantic-tokens-full 1ms 2023-11-07T13:00:47.964Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:47.964Z] Sending response 'textDocument/semanticTokens/full - (3284)'. Request took 2ms. Result: { "data" : [ 18, 4, 16, 0, 0, 1, 4, 7, 4, 0, 0, 19, 2, 4, 0, 1, 27, 2, 4, 0, 1, 27, 2, 4, 0, 1, 26, 2, 4, 0, 1, 29, 2, 4, 0, 1, 25, 2, 4, 0, 4, 1, 3, 3, 0, 0, 4, 17, 2, 1, 3, 1, 3, 3, 0, 0, 4, 9, 2, 1, 3, 1,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1, 1, 0, 0, 1, 1, 8, 0, 0, 1, 5, 2, 0, 0, 7, 2, 3, 0, 0, 4, 1, 6, 0, 1, 18, 3, 2, 0, 0, 13, 1, 6, 0, 2, 1, 4, 3, 0, 0, 5, 7, 2, 1, 1, 3, 2, 3, 0, 0, 4, 3, 3, 0, 0, 5, 4, 6, 0, 1, 9, 12, 2, 0, 0, 13, 4, 6, 0, 1, 7, 1, 1, 0, 0, 1, 1, 8, 0, 0, 1, 5, 2, 0, 0, 7, 2, 3, 0, 0, 4, 2, 6, 0, 2, 1, 7, 3, 0, 1, 3, 8, 2, 0, 1, 3, 6, 2, 0, 1, 3, 12, 2, 0, 1, 3, 12, 2, 0, 1, 3, 3, 4, 0 ] } 2023-11-07T13:00:50.300Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:50.300Z] Received notification 'textDocument/didChange' Params: { "text-document" : { "uri" : "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", "version" : 1286 }, "content-changes" : [ { "text" : ";; == Keyboard shortcuts ==\n;; Weird indent because of how comment block/selection works\n ;;{\n ;; \"key\": \"ctrl+alt+j ctrl+n\",\n ;; \"command\": \"joyride.runCode\",\n ;; \"args\": \"(next-slide-notes/prepare!)\"\n ;;},\n ;;{\n ;; \"key\": \"ctrl+alt+j alt+n\",\n ;; \"command\": \"joyride.runCode\",\n ;; \"args\": \"(next-slide-notes/print!)\"\n ;;},\n ;;{\n ;; \"key\": \"ctrl+alt+j ctrl+alt+n\",\n ;; \"command\": \"joyride.runCode\",\n ;; \"args\": \"(next-slide-notes/toggle!)\"\n ;;},\n\n(ns next-slide-notes\n (:require [\"vscode\" :as vscode]\n [joyride.core :as joyride]\n [promesa.core :as p]\n [clojure.set :as set]\n [clojure.string :as string]\n [next-slide :as next]))\n\n\n;; create this file with whatever YAML frontmatter you want\n;; (make it empty if you don't need any pandoc/TeX prelude)\n(def notes-header-path \"slides/_notes-header.md\")\n\n;; Use a font that prints something instead of nothing for missing characters\n(def main-font \"DejaVu Sans\")\n\n;; Path to speaker notes output file\n(def notes-pdf \"speaker-notes.pdf\")\n\n(defn log [& s]\n (.appendLine (joyride/output-channel) (string/join \" \" s)))\n\n(defn- slide-header+ [slide-path]\n (p/let [slide-uri (vscode/Uri.joinPath (next/ws-root) slide-path)\n slide-text (p/-> slide-uri\n vscode/workspace.fs.readFile\n js/Buffer.from\n (.toString \"utf-8\"))\n header (re-find #\"(?<=\\n)#.*(?=\\n)\" slide-text)]\n header))\n\n(defn- notes-list+ [slides]\n (p/let [notes (map (fn [slide]\n (string/replace-first slide #\"\\.md$\" \"-notes.md\"))\n slides)]\n notes))\n\n(defn- headers-list+ [slides]\n (p/let [headers (p/all (map slide-header+ slides))]\n headers))\n\n(defn- notes-and-headers+ [headers notes]\n (p/let [notes-and-headers (mapv (fn [note header]\n [note header])\n notes headers)]\n notes-and-headers))\n\n(defn- missing-notes-paths+ [notes-and-headers]\n (p/let [notes-paths (map first notes-and-headers)\n glob (str \"{\" (string/join \",\" notes-paths) \"}\")\n existing-uris (vscode/workspace.findFiles glob)\n existing-notes (p/all (map vscode/workspace.asRelativePath existing-uris))\n missing-notes (set/difference (set notes-paths) (set (js->clj existing-notes)))]\n missing-notes))\n\n(defn create-file!+ [relative-path content]\n (p/let [file-uri (vscode/Uri.joinPath (next/ws-root) relative-path)\n encoder (js/TextEncoder.)\n content-data (.encode encoder content)]\n\n (vscode.workspace.fs.writeFile file-uri content-data)))\n\n(defn create-missing-notes!+ [notes->headers missing-notes]\n (p/do (p/doseq [note missing-notes]\n (let [header (notes->headers note)\n content (str header \"\\n\\n\\\\newpage\")]\n (log \" Creating \" note \"-\" header)\n (create-file!+ note content)))\n (log \"\")))\n\n(defn prepare! []\n (-> (p/let [slides (next/slides-list+)\n notes (notes-list+ slides)\n headers (headers-list+ slides)\n nhs (notes-and-headers+ headers notes)\n notes->headers (into {} nhs)\n missing (missing-notes-paths+ nhs)]\n (log \"Creating\" (count missing) \"missing -notes.md files\")\n (create-missing-notes!+ notes->headers missing)\n (log \"Done creating missing notes\")\n (vscode/window.showInformationMessage (str \"Done creating \" (count missing) \" missing notes\")))\n (p/catch (fn [e]\n (vscode/window.showErrorMessage (str \"Error creating missing notes: \" e))))))\n\n(defn print! []\n (p/let [slides (next/slides-list+)\n notes (notes-list+ slides)\n command-line (into [\"pandoc\" notes-header-path]\n (concat notes [\"-o\" notes-pdf\n \"--pdf-engine=xelatex\"\n \"-V geometry:'landscape,a4paper,margin=2cm'\"\n \"-V\" (str \"mainfont='\" main-font \"'\")]))\n command-line-string (string/join \" \" command-line)\n _ (println command-line-string)\n button (vscode/window.showInformationMessage\n (str \"Notes printing command line\") \"Copy to clipboard\")]\n (log (str \"Notes printing command line:\\n\" command-line-string))\n (when (= \"Copy to clipboard\" button)\n (p/do (vscode/env.clipboard.writeText command-line-string)\n (vscode/window.showInformationMessage (str \"Notes printing command line copied to clipboard!\") \"OK\")))))\n\n(defn toggle-path! [path]\n (-> (when (.endsWith path \".md\")\n (p/let [uri (-> (if (.endsWith path \"-notes.md\")\n (string/replace-first path #\"-notes\\.md$\" \".md\")\n (string/replace-first path #\"\\.md$\" \"-notes.md\"))\n vscode/Uri.file)\n document (vscode/workspace.openTextDocument uri)]\n (vscode.window.showTextDocument document\n #js {:preserveFocus false})))\n (p/catch (fn [e]\n (log \"ERROR:\" e)))))\n\n(defn toggle! []\n (-> (let [path vscode/window.activeTextEditor.document.uri.fsPath]\n (toggle-path! path))\n (p/catch (fn [_e]))))\n\n(comment\n (prepare!)\n (print!)\n (toggle-path! \"/Users/pez/Projects/workshops/funnel-nov-10-2023/slides/hello.md\")\n (toggle-path! \"/Users/pez/Projects/workshops/funnel-nov-10-2023/slides/hello-notes.md\")\n :rcf)\n" } ] } 2023-11-07T13:00:50.355Z INFO [clojure-lsp.feature.file-management:250] - changes analyzed by clj-depend took 0ms 2023-11-07T13:00:50.369Z INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms 2023-11-07T13:00:50.370Z WARN [clojure-lsp.kondo:363] - Non-fatal error from clj-kondo: No configs copied. 2023-11-07T13:00:50.370Z INFO [clojure-lsp.feature.file-management:246] - changes analyzed by clj-kondo took 16ms 2023-11-07T13:00:50.370Z INFO [clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms 2023-11-07T13:00:50.371Z INFO [clojure-lsp.server:553] - :analyze-file 16ms 2023-11-07T13:00:50.371Z INFO [clojure-lsp.server:164] - :refreshing-test-tree 0ms 2023-11-07T13:00:50.373Z INFO [clojure-lsp.feature.file-management:139] - :reference-files/find 2ms 2023-11-07T13:00:50.373Z INFO [clojure-lsp.feature.file-management:137] - :notify-references 2ms 2023-11-07T13:00:50.401Z INFO [clojure-lsp.server:102] - :publish-diagnostics 0ms 2023-11-07T13:00:50.401Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:50.401Z] Sending notification 'textDocument/publishDiagnostics' Params: { "uri" : "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs", "diagnostics" : [ ] } 2023-11-07T13:00:50.552Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:50.552Z] Received request 'textDocument/semanticTokens/full - (3285)' Params: { "text-document" : { "uri" : "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs" } } 2023-11-07T13:00:50.553Z INFO [clojure-lsp.handlers:502] - :semantic-tokens-full 1ms 2023-11-07T13:00:50.553Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:50.553Z] Sending response 'textDocument/semanticTokens/full - (3285)'. Request took 1ms. Result: { "data" : [ 18, 4, 16, 0, 0, 11, 1, 3, 3, 0, 0, 4, 17, 2, 1, 3, 1, 3, 3, 0, 0, 4, 9, 2, 1, 3, 1, 3, 3, 0, 0, 4, 9, 2, 1, 2, 1, 4, 3, 0, 0, 5, 3, 2, 1, 0, 7, 1, 6, 0, 1, 3, 11, 7, 0, 0, 13, 7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 3, 0, 0, 5, 7, 2, 1, 1, 3, 2, 3, 0, 0, 4, 3, 3, 0, 0, 5, 4, 6, 0, 1, 9, 12, 2, 0, 0, 13, 4, 6, 0, 1, 7, 1, 1, 0, 0, 1, 1, 8, 0, 0, 1, 5, 2, 0, 0, 7, 2, 3, 0, 0, 4, 2, 6, 0, 2, 1, 7, 3, 0, 1, 3, 8, 2, 0, 1, 3, 6, 2, 0, 1, 3, 12, 2, 0, 1, 3, 12, 2, 0 ] } 2023-11-07T13:00:50.627Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:50.627Z] Received request 'textDocument/documentSymbol - (3286)' Params: { "text-document" : { "uri" : "file:///Users/pez/Projects/workshops/funnel-nov-10-2023/.joyride/src/next_slide_notes.cljs" } } 2023-11-07T13:00:50.627Z INFO [clojure-lsp.handlers:294] - :document-symbol 0ms 2023-11-07T13:00:50.627Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:00:50.627Z] Sending response 'textDocument/documentSymbol - (3286)'. Request took 0ms. Result: [ { "name" : "next-slide-notes", "kind" : 3, "range" : { "start" : { "line" : 0, "character" : 0 }, "end" : { "line" : 999999, "character" : 999999 } }, "selection-range" : { "start" : { "line" : 18, "character" : 0 }, "end" : { "line" : 24, "character" : 35 } }, "children" : [ { "name" : "notes-header-path", "kind" : 13, "range" : { "start" : { "line" : 29, "character" : 0 }, "end" : { "line" : 29, "character" : 49 } }, "selection-range" : { "start" : { "line" : 29, "character" : 5 }, "end" : { "line" : 29, "character" : 22 } }, "tags" : [ ] }, { "name" : "main-font", "kind" : 13, "range" : { "start" : { "line" : 32, "character" : 0 }, "end" : { "line" : 32, "character" : 29 } }, "selection-range" : { "start" : { "line" : 32, "character" : 5 }, "end" : { "line" : 32, "character" : 14 } }, "tags" : [ ] }, { "name" : "notes-pdf", "kind" : 13, "range" : { "start" : { "line" : 35, "character" : 0 }, "end" : { "line" : 35, "character" : 35 } }, "selection-range" : { "start" : { "line" : 35, "character" : 5 }, "end" : { "line" : 35, "character" : 14 } }, "tags" : [ ] }, { "name" : "log", "kind" : 12, "range" : { "start" : { "line" : 37, "character" : 0 }, "end" : { "line" : 38, "character" : 61 } }, "selection-range" : { "start" : { "line" : 37, "character" : 6 }, "end" : { "line" : 37, "character" : 9 } }, "tags" : [ ] }, { "name" : "slide-header+", "kind" : 12, "range" : { "start" : { "line" : 40, "character" : 0 }, "end" : { "line" : 47, "character" : 12 } }, "selection-range" : { "start" : { "line" : 40, "character" : 7 }, "end" : { "line" : 40, "character" : 20 } }, "tags" : [ ], "detail" : "private" }, { "name" : "notes-list+", "kind" : 12, "range" : { "start" : { "line" : 49, "character" : 0 }, "end" : { "line" : 53, "character" : 11 } }, "selection-range" : { "start" : { "line" : 49, "character" : 7 }, "end" : { "line" : 49, "character" : 18 } }, "tags" : [ ], "detail" : "private" }, { "name" : "headers-list+", "kind" : 12, "range" : { "start" : { "line" : 55, "character" : 0 }, "end" : { "line" : 57, "character" : 13 } }, "selection-range" : { "start" : { "line" : 55, "character" : 7 }, "end" : { "line" : 55, "character" : 20 } }, "tags" : [ ], "detail" : "private" }, { "name" : "notes-and-headers+", "kind" : 12, "range" : { "start" : { "line" : 59, "character" : 0 }, "end" : { "line" : 63, "character" : 23 } }, "selection-range" : { "start" : { "line" : 59, "character" : 7 }, "end" : { "line" : 59, "character" : 25 } }, "tags" : [ ], "detail" : "private" }, { "name" : "missing-notes-paths+", "kind" : 12, "range" : { "start" : { "line" : 65, "character" : 0 }, "end" : { "line" : 71, "character" : 19 } }, "selection-range" : { "start" : { "line" : 65, "character" : 7 }, "end" : { "line" : 65, "character" : 27 } }, "tags" : [ ], "detail" : "private" }, { "name" : "create-file!+", "kind" : 12, "range" : { "start" : { "line" : 73, "character" : 0 }, "end" : { "line" : 78, "character" : 59 } }, "selection-range" : { "start" : { "line" : 73, "character" : 6 }, "end" : { "line" : 73, "character" : 19 } }, "tags" : [ ] }, { "name" : "create-missing-notes!+", "kind" : 12, "range" : { "start" : { "line" : 80, "character" : 0 }, "end" : { "line" : 86, "character" : 18 } }, "selection-range" : { "start" : { "line" : 80, "character" : 6 }, "end" : { "line" : 80, "character" : 28 } }, "tags" : [ ] }, { "name" : "prepare!", "kind" : 12, "range" : { "start" : { "line" : 88, "character" : 0 }, "end" : { "line" : 100, "character" : 94 } }, "selection-range" : { "start" : { "line" : 88, "character" : 6 }, "end" : { "line" : 88, "character" : 14 } }, "tags" : [ ] }, { "name" : "print!", "kind" : 12, "range" : { "start" : { "line" : 102, "character" : 0 }, "end" : { "line" : 117, "character" : 116 } }, "selection-range" : { "start" : { "line" : 102, "character" : 6 }, "end" : { "line" : 102, "character" : 12 } }, "tags" : [ ] }, { "name" : "toggle-path!", "kind" : 12, "range" : { "start" : { "line" : 119, "character" : 0 }, "end" : { "line" : 129, "character" : 37 } }, "selection-range" : { "start" : { "line" : 119, "character" : 6 }, "end" : { "line" : 119, "character" : 18 } }, "tags" : [ ] }, { "name" : "toggle!", "kind" : 12, "range" : { "start" : { "line" : 131, "character" : 0 }, "end" : { "line" : 134, "character" : 27 } }, "selection-range" : { "start" : { "line" : 131, "character" : 6 }, "end" : { "line" : 131, "character" : 13 } }, "tags" : [ ] } ] } ] 2023-11-07T13:01:11.114Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:01:11.114Z] Received request 'clojure/serverInfo/raw - (3287)' Params: null 2023-11-07T13:01:11.139Z DEBUG [clojure-lsp.server:55] - [Trace - 2023-11-07T13:01:11.139Z] Sending response 'clojure/serverInfo/raw - (3287)'. Request took 25ms. Result: { "log-path" : "/tmp/clojure-lsp.out", "project-settings" : { "log-path" : "/tmp/clojure-lsp.out" }, "classpath" : [ "/Users/pez/.m2/repository/org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar", "src", "/Users/pez/.m2/repository/org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar", "test", "/Users/pez/.m2/repository/org/clojure/clojure/1.11.1/clojure-1.11.1.jar" ], "project-root-uri" : "file:///Users/pez/Projects/workshops/funnel-nov-10-2023", "analysis-summary" : { "internal" : { "keyword-usages" : 14, "instance-invocations" : 2, "local-usages" : 10, "namespace-alias" : 5, "namespace-usages" : 5, "var-usages" : 51, "namespace-definitions" : 1, "locals" : 7, "var-definitions" : 6 }, "external" : { "java-class-definitions" : 14927, "keyword-definitions" : 61, "instance-invocations" : 7, "protocol-impls" : 139, "local-usages" : 63, "namespace-alias" : 39, "namespace-usages" : 45, "symbols" : 8, "java-member-definitions" : 188114, "var-usages" : 129, "namespace-definitions" : 37, "locals" : 52, "var-definitions" : 1266 } }, "client-settings" : { "auto-add-ns-to-new-files?" : true, "document-formatting?" : false, "dependency-scheme" : "jar", "keep-require-at-start?" : true, "source-paths" : null, "text-document-sync-kind" : null, "source-aliases" : null, "document-range-formatting?" : false, "cljfmt-config-path" : ".cljfmt.edn" }, "clj-kondo-version" : "2023.10.21-SNAPSHOT", "server-version" : "2023.10.30-21.15.51-nightly", "port" : "NREPL only available on :debug profile (`bb debug-cli`)", "final-settings" : { "log-path" : "/tmp/clojure-lsp.out", "auto-add-ns-to-new-files?" : true, "document-formatting?" : false, "dependency-scheme" : "jar", "keep-require-at-start?" : true, "source-paths" : [ "/Users/pez/Projects/workshops/funnel-nov-10-2023/src", "/Users/pez/Projects/workshops/funnel-nov-10-2023/test" ], "project-specs" : [ { "project-path" : "project.clj", "classpath-cmd" : [ "/opt/homebrew/bin/lein", "with-profile", "+test,+dev", "classpath" ] }, { "project-path" : "deps.edn", "classpath-cmd" : [ "/opt/homebrew/bin/clojure", "-A:test:dev", "-Spath" ] }, { "project-path" : "build.boot", "classpath-cmd" : [ "boot", "show", "--fake-classpath" ] }, { "project-path" : "shadow-cljs.edn", "classpath-cmd" : [ "/opt/homebrew/bin/npx", "shadow-cljs", "classpath" ] }, { "project-path" : "bb.edn", "classpath-cmd" : [ "/opt/homebrew/bin/bb", "print-deps", "--format", "classpath" ] } ], "text-document-sync-kind" : null, "source-aliases" : [ "test", "dev" ], "uri-format" : { "upper-case-drive-letter?" : false, "encode-colons-in-path?" : false }, "document-range-formatting?" : false, "cljfmt-config-path" : ".cljfmt.edn" }, "classpath-settings" : null, "cljfmt-raw" : "{}" } ```
evanlouie commented 10 months ago

Highlighting seems works to correctly if the file is under the src directly. If the file is at the root or any other directory, the highlighting fails.

https://github.com/BetterThanTomorrow/calva/assets/2081587/541bb880-a6df-43b6-b12b-7653ca4cbf4f

Can you reproduce this in a minimal project and share it? Easier to reason about what could be going wrong that way.

@PEZ Here is a sample repo showing the bug (same one shown in the video): https://github.com/evanlouie/calva-keyword-bug

PEZ commented 10 months ago

It's not a bug that the semantic highlighting doesn't work outside the source paths, though. That's how clojure-lsp works. It limits its analysis to the source paths, which is a good thing.

You should be able to get highlighting to work in the root path there by adding a deps.edn file with this content:

{:paths ["." "src"]}

Then restart the clojure-lsp server.

@EvaMarco , that's something for you to check too. That the file you are expecting highlighting to work in, is in a project source path.

EvaMarco commented 10 months ago

The files that are failing are all under the SRC folder, but not only directly, but also inside other subfolders.

It also happens to me that sometimes when I open a file the highlight looks fine and as soon as I edit it, it fails.

PEZ commented 10 months ago

Thanks! Sub folders is fine.

I think we have a bug somewhere, but it is a bit unclear where in the stack it lives. I'll get back with more questions and things to try when I come up with theories.

PEZ commented 10 months ago

Actually...

The files that are failing

Do you see this in some files, and not in others?

EvaMarco commented 9 months ago

I just checked and no, all files in my project are falling, those under src (is where I'm working on) and the rest under folders like test or something like this. Some time when I change the theme un vscode, I can see the colors in the right way, but when I focus the file, highlight breaks again.

ericdallo commented 9 months ago

Is there any repro project? I can't repro that with emacs, so my guess is it's a vscode bug, I could test with calva and emacs in a sample project to confirm that, but one thing is to check if clojure-lsp is receiving the semanticTokens/full request and responding to that as well

PEZ commented 9 months ago

I might be able to create a repro project from the project I have where this doesn't work. As for checking if clojure-lsp is receiving the request, I've checked that. It is. It's the response that is different. It's a bit hidden in this comment: https://github.com/BetterThanTomorrow/calva/issues/2337#issuecomment-1798011645

ericdallo commented 9 months ago

Hum, can anyone test with previous clojure-lsp version?

PEZ commented 9 months ago

Right now I can't repro this with latest clojure-lsp in the project where I saw this...

PEZ commented 9 months ago

@EvaMarco how are the source paths in your project configured?

EvaMarco commented 9 months ago

You can see our Open Source project here https://github.com/penpot/penpot

PEZ commented 9 months ago

Awesome, @EvaMarco! It's so much easier to help with open source projects.

I think I see what the issue is. You are opening the repository from the repository root, right? There is no project file there for clojure-lsp to figure out the which files to analyze. This effects much more than syntax highlighting, so it is important to fix to get full leverage of Calva and clojure-lsp.

I sent a pull request with the change:

https://github.com/penpot/penpot/pull/3794

You can try it yourself by adding a deps.edn file in the reporsitory root with this content:

;; This file exists to make clojure-lsp serve the whole repository
{:deps
 {dev/frontend {:local/root "frontend"}
  dev/backend {:local/root "backend"}
  dev/common {:local/root "common"}
  dev/exporter {:local/root "exporter"}}}

Then reload the VS Code window.

An alternative way to solve the issue, which I think is not as good, is to start the clojure-lsp server in the sub-project you are working with. Say you are working with frontend. Then click the clojure-lsp button in the status bar and select the fronted directory to start a clojure-lsp serving that sub project only.

image

NB: I think it is much better to have a server serving the whole repository. So that PR is the way to go, imo. Just letting you know you have options.

EvaMarco commented 9 months ago

The second option is what I tried, stop clojure-lsp on the project and active only on frontend but then I get these errors Screenshot from 2023-11-13 15-50-45 Screenshot from 2023-11-13 15-50-51

And all code start to show errors like this Screenshot from 2023-11-13 15-51-14

I'm trying to solution in my local and let the team know about your PR¡¡ Thanks.

EvaMarco commented 9 months ago

I've tried your solution on my local and it takes a bit more time to be ready, but it's working better now¡¡¡ Thanks

PEZ commented 9 months ago

Great! Thanks for reporting back about it.

The errors you got there look like a glitch with how the OS starts VS Code (and any developer editor) that sometimes do not give them the correct environment. I always start VS Code from the command line, with the code executable (which VS Code has a command for installing).

EvaMarco commented 9 months ago

Nice to know, I used to click in the menu icon to open code, I'll try next time the command line. FYI I work on linux, maybe it has something to do with it.

PEZ commented 9 months ago

I'm closing this, as it seems it was about not providing correct configuration to clojure-lsp. Thanks all for helping in figuring this out! ❤️ 🙏