File tree 4 files changed +13
-10
lines changed
4 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
(ns hybrid.stuff
2
- (:require [#?( :clj clojure.test, :cljs cljs.test) :as t]))
2
+ (:require [clojure.test :as t]))
3
3
4
4
(defn run []
5
5
#? (:clj (prn " This is Clojure!" )
Original file line number Diff line number Diff line change 5
5
(prn " This is ClojureScript!" ))
6
6
7
7
(comment
8
- (run ))
8
+ (run )
9
+ (nope ))
9
10
10
11
(set/difference #{1 2 3 4 } #{3 4 5 6 })
Original file line number Diff line number Diff line change @@ -40,11 +40,12 @@ pub fn bootstrap() -> String {
40
40
pub fn definition ( name : & str ) -> String {
41
41
format ! (
42
42
"
43
- (when-let [loc (if-let [sym (resolve '{})]
44
- (mapv (meta sym) [:file :line :column])
45
- (when-let [syms #?(:cljs (ns-interns '{})
46
- :clj (some-> (find-ns '{}) ns-interns))]
47
- [(:file (meta (-> syms first second))) 1 1]))]
43
+ (if-let [loc (if-let [sym (and (not (find-ns '{})) (resolve '{}))]
44
+ (mapv (meta sym) [:file :line :column])
45
+ (when-let [syms #?(:cljs (ns-interns '{})
46
+ :clj (some-> (find-ns '{}) ns-interns))]
47
+ (when-let [file (:file (meta (-> syms first second)))]
48
+ [file 1 1])))]
48
49
(-> loc
49
50
(update
50
51
0
@@ -53,9 +54,10 @@ pub fn definition(name: &str) -> String {
53
54
(str)
54
55
(clojure.string/replace #\" ^jar:file\" \" zipfile\" )
55
56
(clojure.string/replace #\" \\ .jar!/\" \" .jar::\" ))))
56
- (update 2 dec)))
57
+ (update 2 dec))
58
+ :unknown)
57
59
" ,
58
- name, name, name
60
+ name, name, name, name
59
61
)
60
62
}
61
63
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ impl Connection {
81
81
go_to_definition_server
82
82
. err_writeln ( & format ! ( "Error while going to definition: {}" , msg) )
83
83
}
84
- } else {
84
+ } else if msg == ":unknown" {
85
85
go_to_definition_server. err_writeln ( "Location unknown" ) ;
86
86
} ,
87
87
Ok ( Response :: Err ( _) ) => ( ) ,
You can’t perform that action at this time.
0 commit comments