Statement completion
Hi everyone
I would like to use the statement completion in CLion. But it does not work.
What I want is e.g.:
for
gets completed to:
for( ; ; ){
}
same for function bodies, etc.
My keymap for that is currently set to Ctrl+Shift+Enter. If I execute that only the first entry of the code completion menu is selected. Which is not what I want
Can you help me with that issue?
Moreover a really nice feature would be something like a menu of statement completions that opens similarly to the way code completion is done.
Is something like this available?
Thank you
Best
Seb
请先登录再写评论。
Hello! Is the "Show suggestion as you type" option enabled in File | Settings | Editor | General | Code Completion?
Hi
Thank you for your answer. Yes that option was already enabled.
But please note that Code completion works nicely.
Statement completion is the feature that does not work!
Do you have any other suggestions?
What do you see when you type "for"? I see the following:
So I can choose the first option to complete statement.
What behavior do you expect? What do you mean by "If I execute that only the first entry of the code completion menu is selected"? Please describe your request in more detail.
What you show is exactly the behavior I would expect.
But I only see:
Is your project a CMake-based project?
Please create a default "C++ Executable" project in CLion and check whether you see the same behavior as on my screenshot.
I build the project with catkin.
If I create a default "C++ Executable" then the behavior is as expected.
(But while loops or if...else statements are not expanded.)
Is this feature not available for catkin based projects?
Advanced code insight features are only applied if the project model is properly configured. For now, only CMake, Compilation Database and Gradle are supported.
Actually, since catkin build system is based on CMake, it should work I suppose. Is it a ROS project? Do you have a top-level CMakeLists.txt? Is the file added to any target? BTW, we have a ROS Setup Tutorial (https://www.jetbrains.com/help/clion/ros-setup-tutorial.html), please check it out.