tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.74k stars 139 forks source link

Vars and namespaces with trailing quotes resolve incorrectly #344

Closed frenchy64 closed 5 years ago

frenchy64 commented 5 years ago

Key commands like K, gf, and [d do not support namespace (aliases) and vars with trailing quotes (') in their names (like clojure.core/+').

I'm going out on a limb that these problems are related enough to combine into one ticket.

I'm using + and +' as an example here because +' happens to appear before +' in clojure/core.clj which messes things up.

Minimal runnable examples:

(ns fireplace-min.plus
  (:require [clojure.core :as core]
            [clojure.pprint :as
             core' ; `gf` incorrect: resolves to `clojure.core`
             ]
            [clojure.core :as cc']))

core/+    ; `gf` incorrect: Resolves to clojure.core/+' 
core/+'   ; `[d` incorrect: looks up `core/+`
          ; `K` fails: looks up `core/+`
+'        ; `K` and `[d` incorrect: resolve to clojure.core/+
core'/pprint  ; `[d` error: Source not found
              ; `k` error: runs `:Doc core`
              ; `gf` incorrectly resolves to top of clojure.core
cc'/+     ; `[d` error: Source not found 
          ; `K` error: runs `:Doc cc`
          ; `gf` incorrectly resolves to top of clojure.core
cc'/+'    ; `[d` error (unrelated problem): Source not found 
          ; `K` error: runs `:Doc cc`
          ; `gf` incorrectly resolves to top of clojure.core
frenchy64 commented 5 years ago

Thanks! One case still doesn't work though, gf on + resolves to +'.

(ns fireplace-min.plus
  (:require [clojure.core :as core]))

core/+    ; `gf` incorrect: Resolves to `clojure.core/+'`
tpope commented 5 years ago

See #345.