Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unintuitive overwriting of the config options by cached session config #162

Closed
extramask93 opened this issue Oct 11, 2023 · 4 comments
Closed
Labels
enhancement New feature or request

Comments

@extramask93
Copy link

Describe the problem or limitation you are having
When modifying config which is supplied to the init.setup function with a new option such as:
require("cmake-tools").setup({ ... cmake_generate_options={ ..., "-DFOO=1"}, ... })
The new option won't be loaded when there already exist a cache for a given project. Seemingly thanks to this line in init.lua:
config.base_settings = vim.tbl_deep_extend("keep", old_config.base_settings, config.base_settings)
This was confusing for a new user (me) and forced me to investigate it in the code.
Describe the solution you'd like
Don't know if it is an intended behavior, if it is really so, then it would be worth mentioning it (highlighted) in the config
section of README.

Describe alternatives you've considered
vim.tbl_deep_extend("force", old_config.base_settings, config.base_settings)

Additional context

@extramask93 extramask93 added the enhancement New feature or request label Oct 11, 2023
@rohit-kumar-j
Copy link
Contributor

Interesting. I think this might have been the real cause of the problem I was facing with windows in #146. Feel free to create a PR :D

@Civitasv
Copy link
Owner

Civitasv commented Dec 9, 2023

I understand your concern. Currently, for a new project, it will firstly initialize a session file which include generate_options, build_options, build_dir etc. Then, if you open this project again, it will reuse this session file.

Don't know if it is an intended behavior, if it is really so, then it would be worth mentioning it (highlighted) in the config
section of README.

So to say, it is an indended behaviour, I will highlight it in the config section of README.

@Civitasv
Copy link
Owner

Civitasv commented Dec 9, 2023

See the latest commit, I've add a description about this behaviour at the Configuration section.

@Civitasv
Copy link
Owner

Closing for now, feel free to open it if you still have this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants