Comments (8)
Sounds reasonable. I will begin working on it.
from neovim-cmake.
When locally using the code for development, I copy a basic configuration file to the CMAKE_BUILD_DIR instead of copying it to each directory in which a target exists. This then results in the run command not working, since it can't load the configuration file.
Have you considered setting CMAKE_RUNTIME_OUTPUT_DIRECTORY to CMAKE_BUILD_DIR
? Since you copying configuration files there.
I would not mind adding an option to specify the startup folder, but at the moment the options are not set on a per-project. So you have to change your running path each time you change the project.
from neovim-cmake.
I have not thought about that, but I would prefer to keep my testsuite executables separate from the main executable. I understand the issue with having to do a different setup per-project. Would it be possible to do something like have a global configuration, about allow a local file maybe something like .neovim-cmake.cfg override the default settings? This way one could have project specific commands if desired, but wouldn't mess with the global setup.
from neovim-cmake.
Hm... Okay! We currently have neovim.json
file that contains run arguments and selected project.
Perhaps we could expand it to store more settings. As startup directory or cmake options. But this will require some work :)
I can do this later when I have a little free time.
But if you want to contribute - please, let me know, we could discuss implementation details.
from neovim-cmake.
I wouldn't mind contributing to the project. I would be happy to discuss implementation details.
from neovim-cmake.
Okay!
For now we have set of options here:
Lines 7 to 12 in b03fea1
But some of them could be platform-specific. So I would wrap all settings in neovim.json
(including current settings such as selected project or parameters) in a top-level dictionary that contains os name. You could get os name from this variable:
neovim-cmake/lua/cmake/utils.lua
Line 1 in b03fea1
And every time you trying to get setting - just read it from JSON, here is the function to get it content:
neovim-cmake/lua/cmake/utils.lua
Line 4 in b03fea1
And set:
neovim-cmake/lua/cmake/utils.lua
Line 11 in b03fea1
If requested setting doesn't exists - use according global setting. I would wrap this into a convenient class (table) and move into a separate file.
Also we should add the option that your requested. I think that it should be local-only. You should check for it here:
neovim-cmake/lua/cmake/init.lua
Line 52 in b03fea1
And here:
neovim-cmake/lua/cmake/init.lua
Line 41 in b03fea1
Your thoughts? Suggestions?
from neovim-cmake.
I think the first part makes sense. I would suggest modifying the get_parameters function and the set_parameters function. To first check to see if there is a neovim.json
file in the project root directory. If there is, then it should load the parameters from there. If any required settings are missing, then it should load it from the global neovim.json
or from the default values.
We would then just have to modify:
neovim-cmake/lua/cmake/utils.lua
Line 92 in b03fea1
To see if the user has the option set for a different run directory in the neovim.json file. If they have it set, then use that, otherwise use the current setup. I think that would be cleaner than doing it in both:
neovim-cmake/lua/cmake/init.lua
Line 52 in b03fea1
and here:
neovim-cmake/lua/cmake/init.lua
Line 41 in b03fea1
Since both call
utils.get_current_target(...)
Does that seem like a reasonable approach?
from neovim-cmake.
I agree! Just one thing:
If any required settings are missing, then it should load it from the global neovim.json or from the default values.
I would avoid using a global neovim.json
. I think that having a project-specific neovim.json
and default values is enough.
from neovim-cmake.
Related Issues (20)
- Allow customizing of CMake executable
- CMake select_target fails with error HOT 2
- No output after CMake Run HOT 3
- Support lazy loading with vim-plug HOT 5
- Provide a suitable command to run `cmake --install [build_dir]` within neovim HOT 5
- Support the :CTest command HOT 1
- Upon coredump (crash) plugin reports 0 return HOT 7
- execute command :CMake run, report err HOT 2
- Support for setting environment variables during launch/debug HOT 3
- Pass build_args while executing build_all command HOT 4
- Add support for CMake presets HOT 3
- Add the ability to run program in built-in terminal HOT 4
- Position of the quickfix window HOT 6
- Questions about dap configurations HOT 2
- Integration with 'trouble.nvim'
- 'CMake build_all' does not respect 'build_args' HOT 1
- Breaking change: after 23a63ffd7b709b0f9f407c47523e9bbe322cde37 HOT 7
- API For Fetching Build Targets HOT 7
- The program is not entering the directory HOT 1
- 'run_dir' is not actually missing by default
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neovim-cmake.