From 1eb4a770dd9c044cd02fc16589ce84649807ef90 Mon Sep 17 00:00:00 2001 From: XeroOl Date: Fri, 1 Mar 2024 21:36:00 -0600 Subject: [PATCH] Make the multisym splitter tiebreak the right way --- src/fennel-ls/language.fnl | 2 +- test/goto-definition.fnl | 5 ++--- test/hover.fnl | 3 +-- test/references.fnl | 3 +-- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/fennel-ls/language.fnl b/src/fennel-ls/language.fnl index 9eaedb9..6072992 100644 --- a/src/fennel-ls/language.fnl +++ b/src/fennel-ls/language.fnl @@ -161,7 +161,7 @@ a user-written file. ;; for example, if I'm searching for "foo.bar.baz", my immediate priority is to find foo, ;; and the stack has ["baz" "bar"]. "bar" is at the "top"/"end" of the stack as the next key to search. (if (sym? symbol) - (let [split (utils.multi-sym-split symbol (if ?byte (+ 1 (- ?byte symbol.bytestart)))) + (let [split (utils.multi-sym-split symbol (if ?byte (- ?byte symbol.bytestart))) stack (stack-add-split! [] split)] (case (docs.get-global-metadata (. split 1)) diff --git a/test/goto-definition.fnl b/test/goto-definition.fnl index d2361cf..35e5726 100644 --- a/test/goto-definition.fnl +++ b/test/goto-definition.fnl @@ -178,9 +178,8 @@ (check "(local a {:b {:c =={:d #\"hi\"}==}}) (a.b.|c.d)") - ;; TODO fix the multisym splitter - ; (check "(local a {:b {:c =={:d #\"hi\"}==}}) - ; (a.b.c|.d)")) + (check "(local a {:b {:c =={:d #\"hi\"}==}}) + (a.b.c|.d)") diff --git a/test/hover.fnl b/test/hover.fnl index 0a8accb..e66e12b 100644 --- a/test/hover.fnl +++ b/test/hover.fnl @@ -91,8 +91,7 @@ new message handler `msgh`.") (fn test-multisym [] (check "(local x {:foo 10}) x.foo|" "```fnl\n10\n```") (check "(local x {:foo 10}) x.|foo" "```fnl\n10\n```") - ;; TODO make it pick the other side of the multisym - ;; (check "(local x {:foo 10}) x|.foo" "```fnl\n{:foo 10}\n```") + (check "(local x {:foo 10}) x|.foo" "```fnl\n{:foo 10}\n```") (check "(local x {:foo 10}) |x.foo" "```fnl\n{:foo 10}\n```") (check "(local x {:foo \"hello\"}) x.foo|" "```fnl\n:hello\n```") diff --git a/test/references.fnl b/test/references.fnl index a130544..c8f5233 100644 --- a/test/references.fnl +++ b/test/references.fnl @@ -35,8 +35,7 @@ (check "(fn x| []) ==x==") (check "(fn x [])| x") (check "(let [x nil] ==|x.y== ==x.z==)") - ;; TODO decide this the other way - ;; (check "(let [x nil] ==x|.y== ==x.z==)") + (check "(let [x nil] ==x|.y== ==x.z==)") (check "(let [x nil] x.|y x.z)") (check "(let [x nil] x.y| x.z)") (check "(let [x| 10]