diff --git a/src/fennel-ls/language.fnl b/src/fennel-ls/language.fnl index 263f572..2aef3e8 100644 --- a/src/fennel-ls/language.fnl +++ b/src/fennel-ls/language.fnl @@ -68,7 +68,8 @@ find the definition `10`, but if `opts.stop-early?` is set, it would find (doto opts (tset :searched-through-require true)) (if (= 0 (length stack)) document - (. document.fields (. stack (length stack))) + (and document.fields + (. document.fields (. stack (length stack)))) (search-document self (. document.fields (table.remove stack)) stack opts))) (λ search-val [self file ast stack opts] diff --git a/test/hover.fnl b/test/hover.fnl index 82baf2a..0ffdc49 100644 --- a/test/hover.fnl +++ b/test/hover.fnl @@ -118,6 +118,7 @@ new message handler `msgh`.") (fn test-crash [] (check "|(local x {:foo \"hello\"}) x.foo" nil) (check "|\n(local x {:foo \"hello\"}) x.foo" nil) + (check "print.my-cool-real-field|" nil) nil) (fn test-multival []