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

Only most recently started clojure-lsp server is colorizing keywords

JordanSkousen opened this issue · comments

Describe the bug
I have a workspace with multiple folders added to it. If I start the clojure-lsp servers for two or more projects at once, only the one that I started most recently will colorize keywords. By "colorize keywords", I mean they are showing as a purple color instead of white - I'm sure there's a name for this colorization, I'm not sure what it is :). Here's a screenshot of what I mean:
Screenshot 2023-11-15 153903
Screenshot 2023-11-15 153948

To Reproduce
Steps to reproduce the behavior:

  1. Open an empty VSCode window
  2. Choose File > Open Folder... and open a Clojure project (for example, calva/test-data/projects/completions)
  3. Choose File > Add Folder to Workspace... and open another Clojure project (for example, calva/test-data/projects/current-form)
  4. Open a *.clj file from each project
  5. Start the clojure-lsp server for both projects
  6. Notice the keywords in the file belonging to the latest started clojure-lsp server are colored purple, and the keywords in the file belonging to the other project are colored white (unformatted).
  7. If you restart the clojure-lsp server belonging to the project that is not formatting keywords, it will start formatting them properly, but now the other project is not formatting keywords.

Expected behavior
The keywords inside files belonging to any project with a running clojure-lsp server should be formatted.

Screenshots
Screenshot 2023-11-15 153903
Screenshot 2023-11-15 153948

Log - client <-> server
LOGS OF LATEST STARTED CLOJURE-LSP SERVER
[Trace - 3:50:36 PM] Sending request 'textDocument/documentSymbol - (34)'.
Params: {
    "textDocument": {
        "uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/completions/src/aliasing.clj"
    }
}

[Trace - 3:50:36 PM] Received response 'textDocument/documentSymbol - (34)' in 3ms.
Result: [
{
"name": "aliasing",
"kind": 3,
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 999999,
"character": 999999
}
},
"selectionRange": {
"start": {
"line": 1,
"character": 0
},
"end": {
"line": 2,
"character": 36
}
},
"children": []
}
]

[Trace - 3:50:37 PM] Sending request 'textDocument/semanticTokens/full - (35)'.
Params: {
"textDocument": {
"uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/completions/src/aliasing.clj"
}
}

[Trace - 3:50:37 PM] Sending request 'textDocument/documentSymbol - (36)'.
Params: {
"textDocument": {
"uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/completions/src/aliasing.clj"
}
}

[Trace - 3:50:37 PM] Received response 'textDocument/semanticTokens/full - (35)' in 7ms.
Result: {
"data": [
1,
4,
8,
0,
0
]
}

[Trace - 3:50:37 PM] Received response 'textDocument/documentSymbol - (36)' in 11ms.
Result: [
{
"name": "aliasing",
"kind": 3,
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 999999,
"character": 999999
}
},
"selectionRange": {
"start": {
"line": 1,
"character": 0
},
"end": {
"line": 2,
"character": 36
}
},
"children": []
}
]

[Trace - 3:50:38 PM] Sending request 'textDocument/documentSymbol - (37)'.
Params: {
"textDocument": {
"uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/completions/src/aliasing.clj"
}
}

[Trace - 3:50:38 PM] Received response 'textDocument/documentSymbol - (37)' in 7ms.
Result: [
{
"name": "aliasing",
"kind": 3,
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 999999,
"character": 999999
}
},
"selectionRange": {
"start": {
"line": 1,
"character": 0
},
"end": {
"line": 2,
"character": 36
}
},
"children": []
}
]

[Trace - 3:50:39 PM] Sending request 'textDocument/documentSymbol - (38)'.
Params: {
"textDocument": {
"uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/completions/src/aliasing.clj"
}
}

[Trace - 3:50:39 PM] Sending request 'textDocument/semanticTokens/full - (39)'.
Params: {
"textDocument": {
"uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/completions/src/aliasing.clj"
}
}

[Trace - 3:50:39 PM] Received response 'textDocument/documentSymbol - (38)' in 14ms.
Result: [
{
"name": "aliasing",
"kind": 3,
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 999999,
"character": 999999
}
},
"selectionRange": {
"start": {
"line": 1,
"character": 0
},
"end": {
"line": 2,
"character": 36
}
},
"children": []
}
]

[Trace - 3:50:39 PM] Received response 'textDocument/semanticTokens/full - (39)' in 13ms.
Result: {
"data": [
1,
4,
8,
0,
0
]
}

LOGS OF OTHER CLOJURE-LSP SERVER
[Trace - 3:52:07 PM] Sending request 'initialize - (0)'.
Params: {
"processId": 51224,
"clientInfo": {
"name": "Visual Studio Code",
"version": "1.84.2"
},
"locale": "en-us",
"rootPath": "c:\Users\Jordan\source\repos\calva\test-data\projects\completions",
"rootUri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/completions",
"capabilities": {
"workspace": {
"applyEdit": true,
"workspaceEdit": {
"documentChanges": true,
"resourceOperations": [
"create",
"rename",
"delete"
],
"failureHandling": "textOnlyTransactional",
"normalizesLineEndings": true,
"changeAnnotationSupport": {
"groupsOnLabel": true
}
},
"configuration": true,
"didChangeWatchedFiles": {
"dynamicRegistration": true,
"relativePatternSupport": true
},
"symbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"tagSupport": {
"valueSet": [
1
]
},
"resolveSupport": {
"properties": [
"location.range"
]
}
},
"codeLens": {
"refreshSupport": true
},
"executeCommand": {
"dynamicRegistration": true
},
"didChangeConfiguration": {
"dynamicRegistration": true
},
"semanticTokens": {
"refreshSupport": true
},
"fileOperations": {
"dynamicRegistration": true,
"didCreate": true,
"didRename": true,
"didDelete": true,
"willCreate": true,
"willRename": true,
"willDelete": true
},
"inlineValue": {
"refreshSupport": true
},
"inlayHint": {
"refreshSupport": true
},
"diagnostics": {
"refreshSupport": true
}
},
"textDocument": {
"publishDiagnostics": {
"relatedInformation": true,
"versionSupport": false,
"tagSupport": {
"valueSet": [
1,
2
]
},
"codeDescriptionSupport": true,
"dataSupport": true
},
"synchronization": {
"dynamicRegistration": true,
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"dynamicRegistration": true,
"contextSupport": true,
"completionItem": {
"snippetSupport": true,
"commitCharactersSupport": true,
"documentationFormat": [
"markdown",
"plaintext"
],
"deprecatedSupport": true,
"preselectSupport": true,
"tagSupport": {
"valueSet": [
1
]
},
"insertReplaceSupport": true,
"resolveSupport": {
"properties": [
"documentation",
"detail",
"additionalTextEdits"
]
},
"insertTextModeSupport": {
"valueSet": [
1,
2
]
},
"labelDetailsSupport": true
},
"insertTextMode": 2,
"completionItemKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25
]
},
"completionList": {
"itemDefaults": [
"commitCharacters",
"editRange",
"insertTextFormat",
"insertTextMode"
]
}
},
"hover": {
"dynamicRegistration": true,
"contentFormat": [
"markdown",
"plaintext"
]
},
"signatureHelp": {
"dynamicRegistration": true,
"signatureInformation": {
"documentationFormat": [
"markdown",
"plaintext"
],
"parameterInformation": {
"labelOffsetSupport": true
},
"activeParameterSupport": true
},
"contextSupport": true
},
"definition": {
"dynamicRegistration": true,
"linkSupport": true
},
"references": {
"dynamicRegistration": true
},
"documentHighlight": {
"dynamicRegistration": true
},
"documentSymbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"hierarchicalDocumentSymbolSupport": true,
"tagSupport": {
"valueSet": [
1
]
},
"labelSupport": true
},
"codeAction": {
"dynamicRegistration": true,
"isPreferredSupport": true,
"disabledSupport": true,
"dataSupport": true,
"resolveSupport": {
"properties": [
"edit"
]
},
"codeActionLiteralSupport": {
"codeActionKind": {
"valueSet": [
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
}
},
"honorsChangeAnnotations": false
},
"codeLens": {
"dynamicRegistration": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true
},
"onTypeFormatting": {
"dynamicRegistration": true
},
"rename": {
"dynamicRegistration": true,
"prepareSupport": true,
"prepareSupportDefaultBehavior": 1,
"honorsChangeAnnotations": true
},
"documentLink": {
"dynamicRegistration": true,
"tooltipSupport": true
},
"typeDefinition": {
"dynamicRegistration": true,
"linkSupport": true
},
"implementation": {
"dynamicRegistration": true,
"linkSupport": true
},
"colorProvider": {
"dynamicRegistration": true
},
"foldingRange": {
"dynamicRegistration": true,
"rangeLimit": 5000,
"lineFoldingOnly": true,
"foldingRangeKind": {
"valueSet": [
"comment",
"imports",
"region"
]
},
"foldingRange": {
"collapsedText": false
}
},
"declaration": {
"dynamicRegistration": true,
"linkSupport": true
},
"selectionRange": {
"dynamicRegistration": true
},
"callHierarchy": {
"dynamicRegistration": true
},
"semanticTokens": {
"dynamicRegistration": true,
"tokenTypes": [
"namespace",
"type",
"class",
"enum",
"interface",
"struct",
"typeParameter",
"parameter",
"variable",
"property",
"enumMember",
"event",
"function",
"method",
"macro",
"keyword",
"modifier",
"comment",
"string",
"number",
"regexp",
"operator",
"decorator"
],
"tokenModifiers": [
"declaration",
"definition",
"readonly",
"static",
"deprecated",
"abstract",
"async",
"modification",
"documentation",
"defaultLibrary"
],
"formats": [
"relative"
],
"requests": {
"range": true,
"full": {
"delta": true
}
},
"multilineTokenSupport": false,
"overlappingTokenSupport": false,
"serverCancelSupport": true,
"augmentsSyntaxTokens": true
},
"linkedEditingRange": {
"dynamicRegistration": true
},
"typeHierarchy": {
"dynamicRegistration": true
},
"inlineValue": {
"dynamicRegistration": true
},
"inlayHint": {
"dynamicRegistration": true,
"resolveSupport": {
"properties": [
"tooltip",
"textEdits",
"label.tooltip",
"label.location",
"label.command"
]
}
},
"diagnostic": {
"dynamicRegistration": true,
"relatedDocumentSupport": false
}
},
"window": {
"showMessage": {
"messageActionItem": {
"additionalPropertiesSupport": true
}
},
"showDocument": {
"support": true
},
"workDoneProgress": true
},
"general": {
"staleRequestSupport": {
"cancel": true,
"retryOnContentModified": [
"textDocument/semanticTokens/full",
"textDocument/semanticTokens/range",
"textDocument/semanticTokens/full/delta"
]
},
"regularExpressions": {
"engine": "ECMAScript",
"version": "ES2020"
},
"markdown": {
"parser": "marked",
"version": "1.1.0"
},
"positionEncodings": [
"utf-16"
]
},
"notebookDocument": {
"synchronization": {
"dynamicRegistration": true,
"executionSummarySupport": true
}
},
"experimental": {
"testTree": true
}
},
"initializationOptions": {
"dependency-scheme": "jar",
"auto-add-ns-to-new-files?": true,
"document-formatting?": false,
"document-range-formatting?": false,
"keep-require-at-start?": true
},
"trace": "verbose",
"workspaceFolders": [
{
"uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/completions",
"name": "c:\Users\Jordan\source\repos\calva\test-data\projects\completions"
}
]
}

[Trace - 3:52:08 PM] Received response 'initialize - (0)' in 1817ms.
Result: {
"capabilities": {
"documentSymbolProvider": true,
"textDocumentSync": {
"openClose": true,
"change": 1,
"save": {
"includeText": true
}
},
"declarationProvider": true,
"semanticTokensProvider": {
"legend": {
"tokenTypes": [
"namespace",
"type",
"function",
"macro",
"keyword",
"class",
"variable",
"method",
"event",
"interface"
],
"tokenModifiers": [
"definition",
"defaultLibrary",
"implementation"
]
},
"range": true,
"full": true
},
"linkedEditingRangeProvider": true,
"workspaceSymbolProvider": true,
"experimental": {
"testTree": true,
"cursorInfo": true,
"serverInfo": true,
"clojuredocs": true
},
"codeActionProvider": {
"codeActionKinds": [
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
},
"documentHighlightProvider": true,
"completionProvider": {
"resolveProvider": true,
"triggerCharacters": [
":",
"/"
]
},
"workspace": {
"fileOperations": {
"willRename": {
"filters": [
{
"scheme": "file",
"pattern": {
"glob": "**/*.{clj,cljs,cljc,cljd,edn,bb,clj_kondo}",
"matches": "file"
}
}
]
}
}
},
"implementationProvider": true,
"signatureHelpProvider": {
"triggerCharacters": []
},
"documentRangeFormattingProvider": false,
"executeCommandProvider": {
"commands": [
"add-import-to-namespace",
"add-missing-import",
"add-missing-libspec",
"add-require-suggestion",
"backward-barf",
"backward-slurp",
"change-coll",
"clean-ns",
"create-function",
"create-test",
"cycle-coll",
"cycle-keyword-auto-resolve",
"cycle-privacy",
"demote-fn",
"destructure-keys",
"drag-backward",
"drag-forward",
"drag-param-backward",
"drag-param-forward",
"expand-let",
"extract-function",
"extract-to-def",
"forward-barf",
"forward-slurp",
"get-in-all",
"get-in-less",
"get-in-more",
"get-in-none",
"inline-symbol",
"introduce-let",
"kill-sexp",
"move-coll-entry-down",
"move-coll-entry-up",
"move-form",
"move-to-let",
"promote-fn",
"raise-sexp",
"replace-refer-all-with-alias",
"replace-refer-all-with-refer",
"resolve-macro-as",
"restructure-keys",
"sort-clauses",
"sort-map",
"suppress-diagnostic",
"thread-first",
"thread-first-all",
"thread-last",
"thread-last-all",
"unwind-all",
"unwind-thread"
]
},
"referencesProvider": true,
"codeLensProvider": {
"resolveProvider": true
},
"callHierarchyProvider": true,
"documentFormattingProvider": false,
"renameProvider": {
"prepareProvider": true
},
"definitionProvider": true,
"hoverProvider": true
}
}

[Trace - 3:52:08 PM] Sending notification 'initialized'.
Params: {}

[Trace - 3:52:08 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:///c:/Users/Jordan/source/repos/calva/test-data/projects/completions/src/aliased.clj",
"diagnostics": []
}

[Trace - 3:52:08 PM] Sending request 'clojure/serverInfo/raw - (1)'.
[Trace - 3:52:08 PM] Sending notification 'textDocument/didOpen'.
Params: {
"textDocument": {
"uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/completions/src/aliasing.clj",
"languageId": "clojure",
"version": 1,
"text": ";; aliasing.clj\r\n(ns aliasing\r\n (:require [aliased :as ns-alias]))\r\n"
}
}

[Trace - 3:52:08 PM] Sending notification 'textDocument/didOpen'.
Params: {
"textDocument": {
"uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj",
"languageId": "clojure",
"version": 1,
"text": "(ns top-level\r\n (:require\r\n[foo]\r\n [bar]))\r\n\r\n(defn -main\r\n "I don't do a whole lot ... yet."\r\n {:rfc (comment\r\n ; I want to alt+enter eval this println\r\n (println "Nested RFC"))}\r\n [& _args]\r\n (println "Hello, World!"))\r\n\r\n (def x\r\n 'y)\r\n\r\n(comment\r\n (-main))"
}
}

[Trace - 3:52:08 PM] Sending notification 'workspace/didChangeConfiguration'.
Params: {
"settings": {}
}

[Trace - 3:52:08 PM] Received request 'client/registerCapability - (1)'.
Params: {
"registrations": [
{
"id": "id",
"method": "workspace/didChangeWatchedFiles",
"registerOptions": {
"watchers": [
{
"globPattern": "**/*.{clj,cljs,cljc,cljd,edn,bb,clj_kondo}"
}
]
}
}
]
}

[Trace - 3:52:08 PM] Sending response 'client/registerCapability - (1)'. Processing request took 1ms
No result returned.

[Trace - 3:52:08 PM] Sending request 'textDocument/documentSymbol - (2)'.
Params: {
"textDocument": {
"uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj"
}
}

[Trace - 3:52:08 PM] Sending request 'textDocument/codeAction - (3)'.
Params: {
"textDocument": {
"uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj"
},
"range": {
"start": {
"line": 2,
"character": 5
},
"end": {
"line": 2,
"character": 5
}
},
"context": {
"diagnostics": [],
"triggerKind": 2
}
}

[Trace - 3:52:08 PM] Received response 'clojure/serverInfo/raw - (1)' in 12ms.
Result: {
"log-path": "C:\Users\Jordan\AppData\Local\Temp\clojure-lsp.3117605718047365881.out",
"project-settings": {},
"classpath": [
"C:\Users\Jordan\.m2\repository\org\clojure\spec.alpha\0.3.218\spec.alpha-0.3.218.jar",
"src",
"C:\Users\Jordan\.m2\repository\org\clojure\clojure\1.11.1\clojure-1.11.1.jar",
"C:\Users\Jordan\.m2\repository\org\clojure\core.specs.alpha\0.2.62\core.specs.alpha-0.2.62.jar",
"test"
],
"project-root-uri": "file:///c:/Users/Jordan/source/repos/calva/test-data/projects/completions",
"analysis-summary": {
"internal": {
"namespace-usages": 1,
"namespace-alias": 1,
"namespace-definitions": 3,
"keyword-usages": 2,
"locals": 2,
"var-definitions": 4,
"var-usages": 8
},
"external": {
"namespace-definitions": 35,
"namespace-usages": 36,
"var-definitions": 1250,
"java-member-definitions": 2648,
"java-class-definitions": 201,
"protocol-impls": 139,
"namespace-alias": 30,
"keyword-definitions": 61
}
},
"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-16.25.41",
"port": "NREPL only available on :debug profile (bb debug-cli)",
"final-settings": {
"auto-add-ns-to-new-files?": true,
"document-formatting?": false,
"dependency-scheme": "jar",
"keep-require-at-start?": true,
"source-paths": [
"C:\Users\Jordan\source\repos\calva\test-data\projects\completions\src",
"C:\Users\Jordan\source\repos\calva\test-data\projects\completions\test"
],
"project-specs": [
{
"project-path": "project.clj",
"classpath-cmd": [
"lein",
"with-profile",
"+test,+dev",
"classpath"
]
},
{
"project-path": "deps.edn",
"classpath-cmd": [
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe",
"-NoProfile",
"-Command",
"clojure",
"-A:test:dev",
"-Spath"
]
},
{
"project-path": "build.boot",
"classpath-cmd": [
"boot",
"show",
"--fake-classpath"
]
},
{
"project-path": "shadow-cljs.edn",
"classpath-cmd": [
"C:\Program Files\nodejs\npx.cmd",
"shadow-cljs",
"classpath"
]
},
{
"project-path": "bb.edn",
"classpath-cmd": [
"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": "{}"
}

[Trace - 3:52:08 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:///c:/Users/Jordan/source/repos/calva/test-data/projects/completions/src/another_ns.clj",
"diagnostics": [
{
"range": {
"start": {
"line": 3,
"character": 5
},
"end": {
"line": 3,
"character": 13
}
},
"tags": [
1
],
"message": "Unused public var 'another-ns/ns-alias'",
"code": "clojure-lsp/unused-public-var",
"langs": [],
"severity": 3,
"source": "clojure-lsp"
},
{
"range": {
"start": {
"line": 5,
"character": 6
},
"end": {
"line": 5,
"character": 9
}
},
"tags": [
1
],
"message": "Unused public var 'another-ns/bar'",
"code": "clojure-lsp/unused-public-var",
"langs": [],
"severity": 3,
"source": "clojure-lsp"
},
{
"range": {
"start": {
"line": 7,
"character": 3
},
"end": {
"line": 7,
"character": 7
}
},
"tags": [],
"message": "Unresolved symbol: ns-a",
"code": "unresolved-symbol",
"langs": [],
"severity": 1,
"source": "clj-kondo"
},
{
"range": {
"start": {
"line": 9,
"character": 6
},
"end": {
"line": 9,
"character": 9
}
},
"tags": [
1
],
"message": "Unused public var 'another-ns/foo'",
"code": "clojure-lsp/unused-public-var",
"langs": [],
"severity": 3,
"source": "clojure-lsp"
},
{
"range": {
"start": {
"line": 10,
"character": 3
},
"end": {
"line": 10,
"character": 11
}
},
"tags": [
1
],
"message": "unused binding ns-alias",
"code": "unused-binding",
"langs": [],
"severity": 2,
"source": "clj-kondo"
},
{
"range": {
"start": {
"line": 11,
"character": 3
},
"end": {
"line": 11,
"character": 7
}
},
"tags": [],
"message": "Unresolved symbol: ns-a",
"code": "unresolved-symbol",
"langs": [],
"severity": 1,
"source": "clj-kondo"
},
{
"range": {
"start": {
"line": 13,
"character": 6
},
"end": {
"line": 13,
"character": 9
}
},
"tags": [
1
],
"message": "Unused public var 'another-ns/baz'",
"code": "clojure-lsp/unused-public-var",
"langs": [],
"severity": 3,
"source": "clojure-lsp"
},
{
"range": {
"start": {
"line": 15,
"character": 8
},
"end": {
"line": 15,
"character": 16
}
},
"tags": [
1
],
"message": "unused binding ns-alias",
"code": "unused-binding",
"langs": [],
"severity": 2,
"source": "clj-kondo"
},
{
"range": {
"start": {
"line": 16,
"character": 4
},
"end": {
"line": 16,
"character": 8
}
},
"tags": [],
"message": "Unresolved symbol: ns-a",
"code": "unresolved-symbol",
"langs": [],
"severity": 1,
"source": "clj-kondo"
}
]
}

[Trace - 3:52:08 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:///c:/Users/Jordan/source/repos/calva/test-data/projects/completions/src/aliasing.clj",
"diagnostics": [
{
"range": {
"start": {
"line": 2,
"character": 13
},
"end": {
"line": 2,
"character": 20
}
},
"tags": [
1
],
"message": "namespace aliased is required but never used",
"code": "unused-namespace",
"langs": [],
"severity": 2,
"source": "clj-kondo"
}
]
}

[Trace - 3:52:08 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
"uri": "file:///c:/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj",
"diagnostics": []
}

[Trace - 3:52:08 PM] Received response 'textDocument/documentSymbol - (2)' in 62ms.
Result: [
{
"name": "top-level",
"kind": 3,
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 999999,
"character": 999999
}
},
"selectionRange": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 3,
"character": 10
}
},
"children": [
{
"name": "-main",
"kind": 12,
"range": {
"start": {
"line": 5,
"character": 0
},
"end": {
"line": 11,
"character": 28
}
},
"selectionRange": {
"start": {
"line": 5,
"character": 6
},
"end": {
"line": 5,
"character": 11
}
},
"tags": []
},
{
"name": "x",
"kind": 13,
"range": {
"start": {
"line": 13,
"character": 2
},
"end": {
"line": 14,
"character": 17
}
},
"selectionRange": {
"start": {
"line": 13,
"character": 7
},
"end": {
"line": 13,
"character": 8
}
},
"tags": []
}
]
}
]

[Trace - 3:52:08 PM] Received response 'textDocument/codeAction - (3)' in 64ms.
Result: [
{
"title": "Move to let",
"kind": "refactor.extract",
"command": {
"title": "Move to let",
"command": "move-to-let",
"arguments": [
"file:///c:/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj",
2,
5,
"new-binding"
]
}
},
{
"title": "Extract to def",
"kind": "refactor.extract",
"command": {
"title": "Extract to def",
"command": "extract-to-def",
"arguments": [
"file:///c:/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj",
2,
5,
null
]
}
},
{
"title": "Sort list",
"kind": "refactor.rewrite",
"command": {
"title": "Sort list",
"command": "sort-clauses",
"arguments": [
"file:///c:/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj",
2,
5
]
}
},
{
"title": "Drag backward",
"kind": "refactor.rewrite",
"command": {
"title": "Drag backward",
"command": "drag-backward",
"arguments": [
"file:///c:/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj",
2,
5
]
}
},
{
"title": "Drag forward",
"kind": "refactor.rewrite",
"command": {
"title": "Drag forward",
"command": "drag-forward",
"arguments": [
"file:///c:/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj",
2,
5
]
}
},
{
"title": "Introduce let",
"kind": "refactor.extract",
"command": {
"title": "Introduce let",
"command": "introduce-let",
"arguments": [
"file:///c:/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj",
2,
5,
"new-binding"
]
}
},
{
"title": "Clean namespace",
"kind": "source.organizeImports",
"command": {
"title": "Clean namespace",
"command": "clean-ns",
"arguments": [
"file:///c:/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj",
2,
5
]
}
}
]

[Trace - 3:52:09 PM] Sending request 'textDocument/documentSymbol - (4)'.
Params: {
"textDocument": {
"uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj"
}
}

[Trace - 3:52:09 PM] Received response 'textDocument/documentSymbol - (4)' in 9ms.
Result: [
{
"name": "top-level",
"kind": 3,
"range": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 999999,
"character": 999999
}
},
"selectionRange": {
"start": {
"line": 0,
"character": 0
},
"end": {
"line": 3,
"character": 10
}
},
"children": [
{
"name": "-main",
"kind": 12,
"range": {
"start": {
"line": 5,
"character": 0
},
"end": {
"line": 11,
"character": 28
}
},
"selectionRange": {
"start": {
"line": 5,
"character": 6
},
"end": {
"line": 5,
"character": 11
}
},
"tags": []
},
{
"name": "x",
"kind": 13,
"range": {
"start": {
"line": 13,
"character": 2
},
"end": {
"line": 14,
"character": 17
}
},
"selectionRange": {
"start": {
"line": 13,
"character": 7
},
"end": {
"line": 13,
"character": 8
}
},
"tags": []
}
]
}
]

[Trace - 3:52:09 PM] Sending request 'textDocument/semanticTokens/full - (5)'.
Params: {
"textDocument": {
"uri": "file:///c%3A/Users/Jordan/source/repos/calva/test-data/projects/current-form/src/top_level.clj"
}
}

[Trace - 3:52:09 PM] Received response 'textDocument/semanticTokens/full - (5)' in 8ms.
Result: {
"data": [
0,
4,
9,
0,
0,
5,
1,
4,
3,
0,
0,
5,
5,
2,
1,
2,
9,
7,
3,
0,
2,
11,
7,
2,
0,
1,
5,
5,
6,
0,
1,
3,
7,
2,
0,
2,
3,
3,
3,
0,
0,
4,
1,
2,
1,
3,
1,
7,
3,
0,
1,
3,
5,
2,
0
]
}

User details (please complete the following information):

  • OS: Windows 11 Pro
  • Editor VSCode (Calva) 1.84.2
  • Version: 2023.10.30-16.25.41

Additional context
I tried to debug and find the issue myself, but I can't find where the highlighting of keywords happens (probably because I don't know what it's called). I can try fixing it and making a PR if you'd like, if you point me in the right place :)

I think this is not a clojure-lsp bug regarding semantic-tokens, but a vscode lsp client issue, I don't know much about this workspace vscode feature, but I suppose it's starting another server process with wrong root? WDYT @PEZ ?

@ericdallo Were you able to recreate the issue? Wondering if it could be something wrong with my system setup.

@JordanSkousen I can reproduce it. Looks to me like Calva is a bit weird about this. It asks all started clojure-lsp servers for semantic tokens. You are welcome to file an issue on Calva.

That said, even with the bug fixed, it is almost always better to place a deps.edn at the root of the workspace and include the sub projects as :local/root dependencies. Then only start one clojure-lsp server at the root.