Clojure-lsp: Completion is not available before reader conditional

Created on 21 Feb 2021  路  2Comments  路  Source: clojure-lsp/clojure-lsp

Describe the bug
In a .cljc file that contains a reader conditional before the reader conditional, but is available after it.

To Reproduce
Create a directory containing the following files:
deps.edn:

{}
`src/repro.cljc`:
(ns repro)

#?(:clj "clojure" :cljs "clojurescript")
Steps to reproduce the behavior: 1. In Emacs open `repro.cljc`. 2. Enable `clojurec-mode` and `lsp-mode`. 3. Insert a new line below the reader conditional in `repro.cljc`. 4. Type `t r a` and observe that completion is available at this point in the file. 5. Insert a line above the reader conditional. 6. Type `t r a`. **Expected behavior** I would expect to get the same completion options as I did in step 4. **Screenshots** ![image](https://user-images.githubusercontent.com/26162/108611572-b483b900-73ad-11eb-918f-0657b00990cc.png) ![image](https://user-images.githubusercontent.com/26162/108611581-d54c0e80-73ad-11eb-859d-7a803681d83b.png)
Log - client <-> server

Here is the contents of *lsp-log*

Found the following clients for /Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc: (server-id clojure-lsp, priority 0)
The following clients were selected based on priority: (server-id clojure-lsp, priority 0)
Creating watch for /Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9
Creating watch for /Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src
Cancelling textDocument/codeAction(18) in hook after-change-functions
Cancelling textDocument/codeAction(27) in hook after-change-functions
Cancelling textDocument/codeAction(32) in hook after-change-functions
Cancelling textDocument/codeAction(47) in hook after-change-functions
Cancelling textDocument/codeAction(51) in hook after-change-functions

Interaction:

[Trace - 07:08:46 PM] Received response 'initialize - (1)' in 427ms.
Result: {
  "capabilities": {
    "semanticTokensProvider": {
      "full": true,
      "range": true,
      "legend": {
        "tokenModifiers": [],
        "tokenTypes": [
          "type",
          "function",
          "macro"
        ]
      }
    },
    "callHierarchyProvider": true,
    "executeCommandProvider": {
      "commands": [
        "add-missing-libspec",
        "add-import-to-namespace",
        "cycle-privacy",
        "change-coll",
        "thread-last-all",
        "unwind-all",
        "move-to-let",
        "clean-ns",
        "thread-last",
        "introduce-let",
        "unwind-thread",
        "thread-first-all",
        "thread-first",
        "inline-symbol",
        "extract-function",
        "cycle-coll",
        "expand-let"
      ]
    },
    "renameProvider": true,
    "documentRangeFormattingProvider": true,
    "documentFormattingProvider": true,
    "codeLensProvider": {
      "resolveProvider": true
    },
    "codeActionProvider": {
      "resolveProvider": true,
      "codeActionKinds": [
        "quickfix",
        "refactor",
        "refactor.extract",
        "refactor.inline",
        "refactor.rewrite",
        "source",
        "source.organizeImports"
      ]
    },
    "workspaceSymbolProvider": true,
    "documentSymbolProvider": true,
    "documentHighlightProvider": true,
    "referencesProvider": true,
    "definitionProvider": true,
    "completionProvider": {
      "triggerCharacters": [],
      "resolveProvider": null
    },
    "hoverProvider": true,
    "textDocumentSync": {
      "save": {
        "includeText": true
      },
      "change": 1,
      "openClose": true
    }
  }
}


[Trace - 07:08:46 PM] Sending notification 'initialized'.
Params: {
}


[Trace - 07:08:46 PM] Sending notification 'textDocument/didOpen'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
    "languageId": "clojure",
    "version": 0,
    "text": "(ns repro)\n\n\n#?(:clj \"clojure\" :cljs \"clojurescript\")\n"
  }
}


[Trace - 07:08:46 PM] Sending request 'textDocument/codeAction - (2)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 2,
      "character": 0
    },
    "end": {
      "line": 2,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:08:46 PM] Received request 'client/registerCapability - (1).
Params: {
  "registrations": [
    {
      "registerOptions": {
        "watchers": [
          {
            "globPattern": "**"
          }
        ]
      },
      "method": "workspace/didChangeWatchedFiles",
      "id": "id"
    }
  ]
}


[Trace - 07:08:46 PM] Sending response 'client/registerCapability - (1)'. Processing request took 5ms
Params: {
  "jsonrpc": "2.0",
  "id": "1",
  "result": null
}


[Trace - 07:08:46 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
}


[Trace - 07:08:46 PM] Received response 'textDocument/codeAction - (2)' in 30ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 2,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:08:46 PM] Sending request 'textDocument/codeAction - (3)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 2,
      "character": 0
    },
    "end": {
      "line": 2,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:08:46 PM] Received response 'textDocument/codeAction - (3)' in 19ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 2,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:08:49 PM] Sending notification 'textDocument/didSave'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
    "version": 1
  },
  "text": "(ns repro)\n\n#?(:clj \"clojure\" :cljs \"clojurescript\")\n"
}


[Trace - 07:08:49 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
    "version": 1
  },
  "contentChanges": [
    {
      "text": "(ns repro)\n\n#?(:clj \"clojure\" :cljs \"clojurescript\")\n"
    }
  ]
}


[Trace - 07:08:49 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
}


[Trace - 07:08:49 PM] Sending request 'textDocument/codeAction - (4)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 2,
      "character": 0
    },
    "end": {
      "line": 2,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:08:49 PM] Received response 'textDocument/codeAction - (4)' in 20ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 2,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:02 PM] Sending request 'textDocument/codeAction - (5)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 1,
      "character": 0
    },
    "end": {
      "line": 1,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:02 PM] Received response 'textDocument/codeAction - (5)' in 29ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 1,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:02 PM] Sending request 'textDocument/hover - (6)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "position": {
    "line": 0,
    "character": 0
  }
}


[Trace - 07:09:02 PM] Sending request 'textDocument/codeAction - (7)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 0,
      "character": 0
    },
    "end": {
      "line": 0,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:02 PM] Received response 'textDocument/hover - (6)' in 30ms.
Result: {
  "contents": []
}


[Trace - 07:09:02 PM] Received response 'textDocument/codeAction - (7)' in 28ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 0,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:04 PM] Sending request 'textDocument/codeAction - (8)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 1,
      "character": 0
    },
    "end": {
      "line": 1,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:04 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
    "version": 2
  },
  "contentChanges": [
    {
      "text": "(ns repro)\n\n\n#?(:clj \"clojure\" :cljs \"clojurescript\")\n"
    }
  ]
}


[Trace - 07:09:04 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
}


[Trace - 07:09:04 PM] Received response 'textDocument/codeAction - (8)' in 43ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 1,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:04 PM] Sending request 'textDocument/codeAction - (9)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 1,
      "character": 0
    },
    "end": {
      "line": 1,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:04 PM] Received response 'textDocument/codeAction - (9)' in 38ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 1,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:07 PM] Sending request 'textDocument/codeAction - (10)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 1,
      "character": 0
    },
    "end": {
      "line": 1,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:07 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
    "version": 3
  },
  "contentChanges": [
    {
      "text": "(ns repro)\n\n#?(:clj \"clojure\" :cljs \"clojurescript\")\n"
    }
  ]
}


[Trace - 07:09:07 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
}


[Trace - 07:09:07 PM] Received response 'textDocument/codeAction - (10)' in 43ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 1,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:07 PM] Sending request 'textDocument/codeAction - (11)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 1,
      "character": 0
    },
    "end": {
      "line": 1,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:07 PM] Received response 'textDocument/codeAction - (11)' in 37ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 1,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:10 PM] Sending request 'textDocument/codeAction - (12)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 4,
      "character": 0
    },
    "end": {
      "line": 4,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:10 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
    "version": 4
  },
  "contentChanges": [
    {
      "text": "(ns repro)\n\n#?(:clj \"clojure\" :cljs \"clojurescript\")\n\n"
    }
  ]
}


[Trace - 07:09:10 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
}


[Trace - 07:09:10 PM] Received response 'textDocument/codeAction - (12)' in 28ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 4,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:10 PM] Sending request 'textDocument/codeAction - (13)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 4,
      "character": 0
    },
    "end": {
      "line": 4,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:10 PM] Received response 'textDocument/codeAction - (13)' in 31ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 4,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:14 PM] Sending request 'textDocument/completion - (14)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "position": {
    "line": 4,
    "character": 3
  },
  "context": {
    "triggerKind": 1
  }
}


[Trace - 07:09:14 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
    "version": 7
  },
  "contentChanges": [
    {
      "text": "(ns repro)\n\n#?(:clj \"clojure\" :cljs \"clojurescript\")\n\ntra"
    }
  ]
}


[Trace - 07:09:14 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [
    {
      "message": "Unresolved symbol: tra",
      "source": "clj-kondo",
      "code": "unresolved-symbol",
      "severity": 1,
      "range": {
        "end": {
          "character": 3,
          "line": 4
        },
        "start": {
          "character": 0,
          "line": 4
        }
      }
    }
  ],
  "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
}


[Trace - 07:09:14 PM] Received response 'textDocument/completion - (14)' in 9ms.
Result: [
  {
    "detail": "clojure.core/trampoline",
    "label": "trampoline"
  },
  {
    "detail": "clojure.core/transduce",
    "label": "transduce"
  },
  {
    "detail": "cljs.core/transformer-iterator",
    "label": "transformer-iterator"
  },
  {
    "detail": "clojure.core/transient",
    "label": "transient"
  }
]


[Trace - 07:09:14 PM] Sending request 'textDocument/hover - (15)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "position": {
    "line": 4,
    "character": 3
  }
}


[Trace - 07:09:14 PM] Received response 'textDocument/hover - (15)' in 39ms.
Result: {
  "range": {
    "end": {
      "character": 3,
      "line": 4
    },
    "start": {
      "character": 0,
      "line": 4
    }
  },
  "contents": {
    "value": "```clojure\ntra\n```\n\n----\n*/Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc*",
    "kind": "markdown"
  }
}


[Trace - 07:09:19 PM] Sending request 'textDocument/hover - (16)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "position": {
    "line": 4,
    "character": 10
  }
}


[Trace - 07:09:19 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
    "version": 13
  },
  "contentChanges": [
    {
      "text": "(ns repro)\n\n#?(:clj \"clojure\" :cljs \"clojurescript\")\n\ntrampoline"
    }
  ]
}


[Trace - 07:09:19 PM] Sending request 'textDocument/codeAction - (17)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 4,
      "character": 10
    },
    "end": {
      "line": 4,
      "character": 10
    }
  },
  "context": {
    "diagnostics": [
      {
        "message": "Unresolved symbol: tra",
        "source": "clj-kondo",
        "code": "unresolved-symbol",
        "severity": 1,
        "range": {
          "end": {
            "character": 3,
            "line": 4
          },
          "start": {
            "character": 0,
            "line": 4
          }
        }
      }
    ]
  }
}


[Trace - 07:09:19 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
}


[Trace - 07:09:19 PM] Received response 'textDocument/hover - (16)' in 32ms.
Result: {
  "range": {
    "end": {
      "character": 10,
      "line": 4
    },
    "start": {
      "character": 0,
      "line": 4
    }
  },
  "contents": {
    "value": "```clojure\nclojure.core/trampoline\n```\n```clojure\n[f]\n[f & args]\n```\n\n----\n```clojure\ntrampoline can be used to convert algorithms requiring mutual\nrecursion without stack consumption. Calls f with supplied args, if\nany. If f returns a fn, calls that fn with no arguments, and\ncontinues to repeat, until the return value is not a fn, then\nreturns that non-fn value. Note that if you want to return a fn as a\nfinal value, you must wrap it in some data structure and unpack it\nafter trampoline returns.\n```\n----\n*/Users/zane/.m2/repository/org/clojure/clojure/1.10.2/clojure-1.10.2.jar:clojure/core.clj*",
    "kind": "markdown"
  }
}


[Trace - 07:09:19 PM] Received response 'textDocument/codeAction - (17)' in 33ms.
Result: [
  {
    "data": {
      "character": 10,
      "line": 4,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:19 PM] Sending request 'textDocument/codeAction - (18)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 4,
      "character": 10
    },
    "end": {
      "line": 4,
      "character": 10
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:19 PM] Received response 'textDocument/codeAction - (18)' in 35ms.
Result: [
  {
    "data": {
      "character": 10,
      "line": 4,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:21 PM] Sending request 'textDocument/codeAction - (19)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 4,
      "character": 9
    },
    "end": {
      "line": 4,
      "character": 9
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:21 PM] Received response 'textDocument/codeAction - (19)' in 27ms.
Result: [
  {
    "data": {
      "character": 9,
      "line": 4,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:22 PM] Sending request 'textDocument/codeAction - (20)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 2,
      "character": 9
    },
    "end": {
      "line": 2,
      "character": 9
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:22 PM] Sending request 'textDocument/hover - (21)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "position": {
    "line": 2,
    "character": 9
  }
}


[Trace - 07:09:22 PM] Received response 'textDocument/hover - (21)' in 25ms.
Result: {
  "contents": []
}


[Trace - 07:09:22 PM] Received response 'textDocument/codeAction - (20)' in 27ms.
Result: [
  {
    "data": {
      "character": 9,
      "line": 2,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:23 PM] Sending request 'textDocument/codeAction - (22)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 1,
      "character": 0
    },
    "end": {
      "line": 1,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:23 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
    "version": 14
  },
  "contentChanges": [
    {
      "text": "(ns repro)\n\n#?(:clj \"clojure\" :cljs \"clojurescript\")\n"
    }
  ]
}


[Trace - 07:09:24 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
}


[Trace - 07:09:24 PM] Received response 'textDocument/codeAction - (22)' in 29ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 1,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:24 PM] Sending request 'textDocument/codeAction - (23)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 1,
      "character": 0
    },
    "end": {
      "line": 1,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:24 PM] Received response 'textDocument/codeAction - (23)' in 34ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 1,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:25 PM] Sending request 'textDocument/codeAction - (24)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 1,
      "character": 0
    },
    "end": {
      "line": 1,
      "character": 0
    }
  },
  "context": {
    "diagnostics": []
  }
}


[Trace - 07:09:25 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
    "version": 15
  },
  "contentChanges": [
    {
      "text": "(ns repro)\n\n\n#?(:clj \"clojure\" :cljs \"clojurescript\")\n"
    }
  ]
}


[Trace - 07:09:25 PM] Sending notification '$/cancelRequest'.
Params: {
  "id": 24
}


[Trace - 07:09:25 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
}


[Trace - 07:09:25 PM] Received response 'nil - (24)' in 0ms.
Result: [
  {
    "data": {
      "character": 0,
      "line": 1,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:26 PM] Sending request 'textDocument/completion - (25)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "position": {
    "line": 2,
    "character": 3
  },
  "context": {
    "triggerKind": 1
  }
}


[Trace - 07:09:26 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
    "version": 19
  },
  "contentChanges": [
    {
      "text": "(ns repro)\n\ntra\n\n#?(:clj \"clojure\" :cljs \"clojurescript\")\n"
    }
  ]
}


[Trace - 07:09:26 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [
    {
      "message": "Unresolved symbol: tra",
      "source": "clj-kondo",
      "code": "unresolved-symbol",
      "severity": 1,
      "range": {
        "end": {
          "character": 3,
          "line": 2
        },
        "start": {
          "character": 0,
          "line": 2
        }
      }
    }
  ],
  "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
}


[Trace - 07:09:26 PM] Received response 'textDocument/completion - (25)' in 6ms.
Result: null


[Trace - 07:09:26 PM] Sending request 'textDocument/codeAction - (26)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 2,
      "character": 3
    },
    "end": {
      "line": 2,
      "character": 3
    }
  },
  "context": {
    "diagnostics": [
      {
        "message": "Unresolved symbol: tra",
        "source": "clj-kondo",
        "code": "unresolved-symbol",
        "severity": 1,
        "range": {
          "end": {
            "character": 3,
            "line": 2
          },
          "start": {
            "character": 0,
            "line": 2
          }
        }
      }
    ]
  }
}


[Trace - 07:09:26 PM] Received response 'textDocument/codeAction - (26)' in 76ms.
Result: [
  {
    "data": {
      "character": 3,
      "line": 2,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


[Trace - 07:09:28 PM] Sending request 'textDocument/hover - (27)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "position": {
    "line": 2,
    "character": 2
  }
}


[Trace - 07:09:28 PM] Sending request 'textDocument/codeAction - (28)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc"
  },
  "range": {
    "start": {
      "line": 2,
      "character": 2
    },
    "end": {
      "line": 2,
      "character": 2
    }
  },
  "context": {
    "diagnostics": [
      {
        "message": "Unresolved symbol: tra",
        "source": "clj-kondo",
        "code": "unresolved-symbol",
        "severity": 1,
        "range": {
          "end": {
            "character": 3,
            "line": 2
          },
          "start": {
            "character": 0,
            "line": 2
          }
        }
      }
    ]
  }
}


[Trace - 07:09:28 PM] Received response 'textDocument/hover - (27)' in 32ms.
Result: {
  "range": {
    "end": {
      "character": 3,
      "line": 2
    },
    "start": {
      "character": 0,
      "line": 2
    }
  },
  "contents": {
    "value": "```clojure\ntra\n```\n\n----\n*/Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc*",
    "kind": "markdown"
  }
}


[Trace - 07:09:28 PM] Received response 'textDocument/codeAction - (28)' in 33ms.
Result: [
  {
    "data": {
      "character": 2,
      "line": 2,
      "uri": "file:///Users/zane/projects/035a1e4d6d58b5e007e6854fe48f54a9/src/repro.cljc",
      "id": "clean-ns"
    },
    "kind": "source.organizeImports",
    "title": "Clean namespace"
  }
]


Log - /tmp/clojure-lsp.*.out
This file does not exist on my system.

User details (please complete the following information):

  • OS: MacOS
  • Editor GNU Emacs 27.1
  • Version: clojure-lsp 2021.02.19-23.08.40
bug

All 2 comments

Thank you for the report, I could reproduce the issue, will take a look soon

Fixed! Available on next release :)

Was this page helpful?
0 / 5 - 0 ratings