borkdude / grasp

Grep Clojure code using clojure.spec regexes
Eclipse Public License 1.0
242 stars 7 forks source link

Analyzing symbols with refer all in namespace, assume current workspace incorrectly #14

Open irotem opened 3 years ago

irotem commented 3 years ago

When analyzing a file such which has a refer all (which is known to be bad practice) the analyzer does not add the extra information to possible unresolved symbols that can match the symbol

for example in:

(ns samples.web
  (:require [compojure.core :refer :all]
            [compojure.route :as route]))
(defroutes app
           (GET "/" [] "<h1>Hello World</h1>")
           (route/not-found "<h1>Page not found</h1>"))

We receive a symbol list of

samples.web/defroutes
samples.web/GET
compojure.route/not-found

The :refer :all in clojure matches the symbol of GET with compojure.core/GET. but in grasp it does not match anything and defaults to the current namespace

I would suggest adding all possible matches shown below and adding a metadata remark on the symbol:

compujure.core/GET
samples.web/GET