Closed asmodeus812 closed 3 months ago
coc#config
sets/overrides the configurations, but this API won't write to global/local coc-settings.json.
Yeah i am not saying it should write to global or local json config file, what i was saying is that if was using DirChanged
event after doing :tcd
, the aucmd callback would trigger call coc#config but the language server would still be out of sync and was still using the previous workspace local settings, however using BufEnter
, then navigating between the two buffers from the two workspaces, the aucmd would trigger do a coc#config of the workspace local configs and it then works, the server's config is correctly picked up from the buffer's current root workspace of the current buffer. What is the deal with DirChanged ? Is it too early of an event to use in this case ?
What is the deal with DirChanged
Have no idea about this, sorry
Result from CocInfo
Describe the bug
Updating configurations while switching from one workspace / working directory to another in a single nvim instance does not work, or is not applied or respected by the language server. Even though notifications are sent, the server would keep the old configurations and never update itself when using
coc#config
Note that if i manually go an save the settings json file for a project before i invoke the
toString
,watchman
(i guess) will trigger and correctly update the settings, however if i manually dococ#config
it will not update and apply the settings in the same wayNote2: If i save the settings file CocInfo does not register any information, even though, saving manually seems to actually be the only way to correctly apply the settings
Reproduce the bug
Create file
mini.vim
with:Start (neo)vim with command:
vim -u mini.vim
DirChanged
andcoc#config
From brief inspection of the implementation it seems that
coc#config
does an InMemory config store, but not sure if it tries to update it.The final goal here is to be able to update the settings ideally on DirChanged / Workspace folder changed, and not have to manually go and save the settings each time i visit a specific workspace.
Note: For some reason, upon further testing, if the event is not
DirChanged
, but ratherBufEnter
(for example) thecoc#config
seems to be loading correctly, and i have no idea why.