Repository: clojure-lsp/clojure-lsp (clojure)

Issue:
A colon isn't recognized as a valid character in a symbol
I occasionally like to use colons as an ad hoc namespacing facility when I'm naming vars. Clojure allows this:

```
Clojure 1.10.0
user=> (defn foo:bar [x]
         (* 2 x))
#'user/foo:bar
user=> (foo:bar 3)
6
```

clojure-lsp's definition of a valid symbol doesn't seem to include colons (and perhaps other rare symbols?)

![2020-01-14-123325_541x204_scrot](https://user-images.githubusercontent.com/4909079/72367518-507ec380-36ca-11ea-88c9-86b06f757960.png)

Pull request description:
Small patch to fix #100

Patch:
diff --git a/src/clojure_lsp/parser.clj b/src/clojure_lsp/parser.clj
index 92cc58f14..3e837014e 100644
--- a/src/clojure_lsp/parser.clj
+++ b/src/clojure_lsp/parser.clj
@@ -58,7 +58,7 @@
   (z/find-next loc z/right #(not (n/printable-only? (z/node %)))))
 
 (defn ident-split [ident-str]
-  (let [ident-conformed (some-> ident-str (string/replace ":" ""))
+  (let [ident-conformed (some-> ident-str (string/replace #"^::?" ""))
         prefix (string/replace ident-str #"^(::?)?.*" "$1")
         idx (string/index-of ident-conformed "/")]
     (if (and idx (not= idx (dec (count ident-conformed))))


Test patch:
diff --git a/test/clojure_lsp/parser_test.clj b/test/clojure_lsp/parser_test.clj
index 96d43a9b1..b613ae595 100644
--- a/test/clojure_lsp/parser_test.clj
+++ b/test/clojure_lsp/parser_test.clj
@@ -557,3 +557,9 @@
         [_ _ _ _ _  x1 x2 x3] usages]
     (is (= 1 (:argc x1) (:argc x2)))
     (is (= 2 (:argc x3)))))
+
+(deftest colon-symbols
+  (let [code "(def foo:bar 12)"
+        usages (parser/find-usages code :clj {})
+        [_ foobar _] usages]
+    (is (= 'user/foo:bar (:sym foobar)))))