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

Code Action "Add require" for namespaced keywords

NoahTheDuke opened this issue · comments

commented

Is your feature request related to a problem? Please describe.
Currently, if you type in some-alias/some-var and then make a textDocument/codeAction request on the symbol, clojure-lsp will return a suggestion to "Add require '[long.name.example :as some-alias]". However, if you type in ::some-alias/some-keyword and then make a textDocument/codeAction request on the keyword, clojure-lsp will not return a "Add require ..." suggestion.

Describe the solution you'd like
Return two additional suggestions to the current set:

1. Add require '[long.name.example :as some-alias]
2. Add require '[long.name.example :as-alias some-alias]

Describe alternatives you've considered

  1. Do nothing.
  2. Delete the leading colons and then call codeAction and add the alias and then add the two colons back in.

Additional context

N/A