From e7a5b6c50d4aa5d10f565a0bbaf377560e96154d Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Thu, 17 Oct 2024 10:17:34 -0700 Subject: [PATCH] lsp --- .config/nvim/fnl/lsp.fnl | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.config/nvim/fnl/lsp.fnl b/.config/nvim/fnl/lsp.fnl index e75b83f..8c0fda4 100644 --- a/.config/nvim/fnl/lsp.fnl +++ b/.config/nvim/fnl/lsp.fnl @@ -54,14 +54,19 @@ (let [fmt #{:formatCommand $1 :formatStdin true} lint #{:lintCommand $1 :lintFormats $2 :lintStdin true} fennel [(fmt "fnlfmt /dev/stdin") - (lint (-> (iter [:fennel - :--globals - "vim,hs,spoon" - :--raw-errors - "$(realpath --relative-to . ${INPUT})" - :2>&1]) - (: :join " ")) ["%f:%l: %m"])] - js [] + (lint (let [x (iter [:fennel + "--globals vim,hs,spoon" + :--raw-errors + "$(realpath --relative-to . ${INPUT})" + :2>&1])] + (x:join " ")) ["%f:%l: %m"])] + js [{:formatCommand (let [x (iter ["prettier --stdin --stdin-filepath ${INPUT}" + "${--range-start:charStart} ${--range-end:charEnd}" + "${--tab-width:tabWidth} ${--use-tabs:!insertSpaces}"])] + (x:join " ")) + :formatStdin true + :formatCanRange true + :rootMarkers [:.prettierrc.json]}] yaml [(fmt "yamlfmt -in")]] (lspconfig.efm.setup {:init_options {:documentFormatting true :hover true @@ -75,7 +80,7 @@ : yaml} ;; since otherwise eslint goes haywire :lintDebounce 1000000000} - :filetypes [:fennel :yaml]})) + :filetypes [:fennel :typescriptreact :yaml]})) ; (fn on-attach-do [...] ; (let [fns [...]] ; https://benaiah.me/posts/everything-you-didnt-want-to-know-about-lua-multivals/