This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-12
Channels
- # announcements (1)
- # babashka (79)
- # beginners (165)
- # calva (29)
- # cider (20)
- # clara (3)
- # cljdoc (1)
- # cljs-dev (52)
- # clojure (42)
- # clojure-chicago (5)
- # clojure-europe (48)
- # clojure-germany (1)
- # clojure-italy (4)
- # clojure-nl (2)
- # clojure-spec (10)
- # clojure-uk (19)
- # clojurescript (50)
- # clojureverse-ops (5)
- # conjure (8)
- # datomic (16)
- # depstar (2)
- # events (1)
- # figwheel-main (23)
- # fulcro (26)
- # girouette (41)
- # graalvm (9)
- # heroku (3)
- # honeysql (10)
- # jackdaw (20)
- # lambdaisland (6)
- # lein-figwheel (1)
- # lsp (34)
- # malli (7)
- # meander (3)
- # music (1)
- # off-topic (14)
- # polylith (7)
- # re-frame (14)
- # reitit (8)
- # reveal (15)
- # ring (3)
- # schema (1)
- # sci (15)
- # shadow-cljs (42)
- # spacemacs (1)
- # startup-in-a-month (12)
- # tools-deps (59)
- # vim (1)
- # xtdb (27)
I've set up a .dir-locals.el
for a denylist of files/folders that LSP can ignore. However, LSP still asks if I want to watch ~1500 files (way more than I'm expecting). Does Clojure LSP log which folders/files it thinks it should be watching? I'd love to be able to compare that against my directory structure and see whether I've made an error in my configuration
that's a config from lsp-mode
, clojure-lsp has no control over that, you should check if your lsp-file-watch-ignored-directories
or lsp-file-watch-ignored-files
are correct
ah gotcha, thanks Eric. yep I'm setting lsp-file-watch-ignored-directories
in dir-locals
. just wanted to see if there was a way to verify they were being picked up correctly. here's a snippet in case you see anything that stands out
((nil . ((lsp-file-watch-ignored-directories . ("/\\.git$"
"/resources/public/js$"
"/resources/public/img$"
"/resources/public/css$"
"/node_modules$"
"/functions/node_modules$"
"/functions/compiled$"
"/\\.cpcache$"
"/\\.shadow-cljs$")))))
otherwise i'll keep digging. thanks again!Yeah, I think you can suggest it on lsp-mode discord or as a issue, a command that would check what dirs would exclude or something
@UGGU8TSMC it seems lsp-mode already logs it somewhere https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-mode.el#L1732
haha nice, I think you should suggest that on https://discord.gg/swuxy5AAgT and try to understand where lsp-log
is logging on that line
haha i've been trying to figure out this lsp files watched issue for a while. turns out clj-kondo
has a hidden .cache
directory that i didnt know about and that's where most of the watched files were coming from
oh, it seems lsp-mode already ignores that folder: https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-mode.el#L336
it's odd why you needed to add the .clj-kondo/.cache
if lsp-mode already ignores the .clj-kondo
folder
hmmm interesting. After adding "/\\.clj-kondo/\\.cache$"
to my blocklist, the number of watched files went down from 1500 to 250
I'm using Doom, which is managing my package updates. Looks like my lsp-mode
is pretty recent, last commit from 15 days ago
Based on this, it does seem like the lsp-mode default ignore dirs is not working but I don't have a great intuition for this stuff 🙂
I switched from "/\\.clj-kondo/\\.cache$"
to "/\\.clj-kondo$"
and still seems to be blocking properly
Also, they answered you, the lsp-log logs to a lsp-log
buffer, but it just logs the project root dir of the watchers, not the folders itself
Is ~/.clojure/.lsp/config.edn
a valid location for a clojure-lsp configuration file?
That directory also contains an sqlite.db file.
I was ~/.lsp/config.edn
but that directory has been deleted (I think that was me, but not sure). Should I be using ~/.lsp/config.edn
or is ~/.clojure/.lsp/config.edn
okay to use (seems a bit tidier, especially as it only has cljfmt configuration in there).
If both locations are valid, I assume the ~/.clojure/.lsp/config.edn
would take preceedence over the general ~/.lsp/config.edn
configuration
you probably opened ~/.clojure/deps.edn
sometime and plugged lsp there and made ~/.clojure
as root what made clojure-lsp create the sqlite file
@U05254DQM You get a .lsp
folder in any directory that you start an editor that using LSP integration. I keep seeing them popup as new files all over the place because it’s not yet common for new project templates to .gitignore
the .lsp/sqlite.db
file (and of course no older projects exclude it).
exactly, you can have a ~/.gitignore_global
, but this is as common as a .clj-kondo/.cache
dir
Thanks. The strange thing is the configuration in ~/.clojure/.lsp/config.edn
seems to work. Either that or lsp stopped annoyingly inserting two line spaces in between comments and keywords at the same I made this change... I'll delete it again and see if I still have that issue. Never a dull moment 🙂
this is how we resolve config: https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/config.clj#L64-L90
I think I will set my XDG_CONFIG_HOME to /.config then /.clojure and /.lsp can both be in /.config along with most of the other user level config... and less likely to get deleted by mistake
> exactly, you can have a ~/.gitignore_global , but this is as common as a .clj-kondo/.cache dir
Except that clj-kondo won't ever automatically create a .clj-kondo
dir anywhere on your system.
I've had a .gitignore_global ever since I started using Git... its seems many people are missing out...