Skip to content

Commit

Permalink
Allow completions for vars in '.' namespace
Browse files Browse the repository at this point in the history
Modify the regex for recognizing potential var names to allow for
namespaces starting with the '.' character. It is quite a popular choice
to put utility functions in the '.' namespace so that they are globally
available; for examples see [1] and [2]. Even though this may not be
officially supported, it is a good idea to support completions for this
namespace.

[1]: https://github.com/zcaudate/vinyasa
[2]: https://github.com/palletops/lein-shorthand
  • Loading branch information
raxod502 authored and alexander-yakushev committed Aug 8, 2016
1 parent 7c376ea commit 8d838df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compliment/sources/ns_mappings.clj
Expand Up @@ -8,7 +8,7 @@
(defn var-symbol?
"Test if prefix resembles a var name."
[x]
(re-matches #"([^\.\/\:][^\.\/]*([^\/\:]*\/[^\.\/]*)?)?" x))
(re-matches #"([^\/\:][^\.\/]*([^\/\:]*\/[^\.\/]*)?)?" x))

(defn dash-matches?
"Tests if prefix partially matches a var name with dashes as
Expand Down

0 comments on commit 8d838df

Please sign in to comment.