Closed fmorroni closed 5 months ago
There's nothing inside telescope core or this extension that will change the cwd without explicitly doing so (such as the change_cwd
action).
I suspect there's something in your personal config that is managing this. Maybe some personal autocmd or some sort of project management type plugin that's using Makefile
existence for a reason to change the cwd.
There's nothing inside telescope core or this extension that will change the cwd without explicitly doing so (such as the
change_cwd
action).I suspect there's something in your personal config that is managing this. Maybe some personal autocmd or some sort of project management type plugin that's using
Makefile
existence for a reason to change the cwd.
Hmm yeah that's what I assumed at first. But the only thing I think could be responsible is the language server (clangd). But I checked the ls client's root on files inside folders with a Makefile and it seemed to be set correctly to the project's root.
I'll have to check that again.
In any case I did side step the issue by renaming all inner Makefiles to something else and now it's working as expected.
I don't think it's the language server. There's nothing in the LSP spec for automatically changing cwd. Just to make sure, I tried replicating this and I can't (with or without clangd).
I'm working on a C project with multiple Makefiles. Something like:
Of course the root of the project should be
rootDir
where the outermost Makefile is located. And I'd expect the filebrowser'scwd
to remain atrootDir
no matter which file in the project I open. For example if I openC/file4.c
it works as expected because there is no Makefile inC/
. But if I openA/file2.c
thecwd
is changed toA/
. This is annoying because now when I try to do a file search or live grep, only results from files insideA/
appear. So how can I make sure thecwd
remains at the root project?