diff --git a/README.md b/README.md index deda5f5..bbf3dda 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ Your editor can send these settings using one of these two methods: fennel-ls is licensed under the MIT license. See LICENSE for more info. This project also contains files from other projects: * test/pl/* comes from [Penlight](https://github.com/lunarmodules/Penlight) [MIT license] -* src/json/* comes from [json.lua](https://github.com/rxi/json.lua) [MIT license] +* src/json/* is modified, but is originally from [json.lua](https://github.com/rxi/json.lua) [MIT license] * src/fennel-ls/docs/* contains information from the [lua](https://lua.org) reference [MIT license] * test/lust.lua is modified, but originially comes from from [lust](https://github.com/bjornbytes/lust) [MIT license] * fennel and src/fennel.lua are compiled from [fennel](https://git.sr.ht/~technomancy/fennel) [MIT license] diff --git a/src/fennel-ls/compiler.fnl b/src/fennel-ls/compiler.fnl index 7cf633a..c9aadbc 100644 --- a/src/fennel-ls/compiler.fnl +++ b/src/fennel-ls/compiler.fnl @@ -54,7 +54,8 @@ are declared / referenced in which places." (λ line+byte->range [self file line byte] (let [line (- line 1) - ;; TODO think about this further when upstream bug fennel#180 is fixed + ;; some errors in fennel erroneously say column -1 + ;; try compiling "(do\n" to see what I mean byte (math.max 0 byte) position (utils.pos->position file.text line byte self.position-encoding)] {:start position :end position})) diff --git a/src/fennel-ls/language.fnl b/src/fennel-ls/language.fnl index 1610c00..de660a8 100644 --- a/src/fennel-ls/language.fnl +++ b/src/fennel-ls/language.fnl @@ -243,15 +243,15 @@ Returns: (table.insert parents ast) (if (or (sequence? ast) (list? ast)) - (accumulate [(result done) nil + (accumulate [(result _parent) nil _ child (ipairs ast) &until result] (if (contains? child byte) (recurse child byte))) (and (not (sym? ast)) (not (varg? ast))) - (accumulate [(result done) nil + (accumulate [(result _parent) nil key value (pairs ast) - &until done] + &until result] (if (contains? key byte) (recurse key byte) (contains? value byte)