Skip to content

cider-locals - false positives #3657

Description

@vemv

For the following input:

(def foo-routes
  [["/foos"
    {:get {:handler (fn [{{{:keys [archived]} :query} :parameters
                          :keys [sub]
                          :as req}]
                      {:pre [sub]}
                      (let [foo (reduce + (range 4))]
                        {:status 200}))}}]])

...if I hover over range and M-x describe-char, I'll get:

There are text properties here:
  cider-locals         ("200" "4" "range" "+" "reduce" "foos" "let" "sub" "req" "sub" "archived" "fn" "/foos" "req" "sub" "archived" "collections")
  fontified            t

A lot of those aren't locals (e.g. number/string literals, function names).

This happens because of the def x [[ format, which the cider-locals code isn't prepared for.

As a consequence, there can be subtle bugs with font locking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions