Fork me on GitHub
#lsp
<
2022-05-13
>
skuro11:05:59

how do I tell clojure-lsp to not look into specific folders within my project?

skuro11:05:04

my use case: I have a postgres docker container which mounts its data folder from a (git ignored) ./tmp/db directory. This folder is apparently looked into by clojure-lsp since it mentions some errors due to permissions

ericdallo11:05:31

You can tell to not watch a folder, but not sure that is what you want, do you have a example?

skuro11:05:34

again, ./tmp/db contains data that should not be watched as it's irrelevant (and in my case it contains bajillion bytes worth of test data)

ericdallo11:05:46

Hum, not sure it's possible, but it'd be necessary something on client side to ignore that as server only accept files sent by client

borkdude12:05:47

Assuming you're in emacs, maybe lsp-enable-file-watchers nil will help?

ericdallo12:05:59

Yes, or just set file watch ignore to match /tmp/data @U051T4Q05

borkdude12:05:02

but why is lsp even watching that directory, it doesn't belong to a project, right?

ericdallo12:05:19

Yes, unless the project root is wrong

borkdude12:05:02

That has happened to me a lot of times with /tmp/

ericdallo12:05:23

Probably you had /tmp as project root right?

ericdallo12:05:40

Yeah, I suggest never import /tmp as root, but a specific folder like: /tmp/clojure

borkdude12:05:39

Nothing is more permanent than setting /tmp as the root...

😂 2
skuro14:05:28

sorry, just out of a 3h long meeting

skuro14:05:03

I'll try to set the ./tmp/ folder to be ignored by the watchers tnx

skuro14:05:20

(note: not /tmp but ./tmp -- the 👿 is in the detail)

😂 1
ericdallo14:05:00

@U051T4Q05 lsp-mode allows you declare regex to ignore some patterns, check lsp-file-watch-ignored-directories

👍 1
borkdude14:05:20

I haven't enabled watchers at all and I don't feel like I'm missing out (except performance problems)

ericdallo14:05:53

yes, watchers are good if you change branches a lot or have any other process that may change files outside of editor/lsp