When completing a file path which contains ( or ) for example it does not escape them with \. Reproducible: Always
please check whether this has been fixed in the latest versions of Kdevelop.
@Barade: Which compiler supports this? Citing https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html: "However, if backslashes occur within file, they are considered ordinary text characters, not escape characters. None of the character escape sequences appropriate to string constants in C are processed. Thus, #include "x\n\\y" specifies a filename containing three backslashes. (Some systems interpret ‘\’ as a pathname separator. All of these also interpret ‘/’ the same way. It is most portable to use only ‘/’.)" Considering this invalid.
Did you even read that it is about the CMake completion tool and not about C++?
Cough, no. Sorry, I was in C++ mode here :) Reproduced the problem in a CMakeLists.txt. MWE: Create a file foo(.cpp. Then in the accompanying CMakeLists.txt file: set(FOO foo<CURSOR> ) => Will insert foo(.cpp. => CMake reports: Parse error. Function missing ending ")". End of file reached.
Hint: Have a look at CMakeCodeCompletionModel::completionInvoked in kdevelop.git
Git commit db14d0e4989e790b341a88ebc3f8c28896cc58ea by Kevin Funk, on behalf of Geetam Chawla. Committed on 13/07/2017 at 19:56. Pushed by kfunk into branch '5.1'. CMake code completion: Add missing chars to be escaped Summary: List of chars to be escaped is taken from: https://cmake.org/Wiki/CMake/Language_Syntax > To use literally any of "()#$^, escape the character with a backslash Test Plan: created a file foo"()#$^.cpp, the chars are escaped properly. Reviewers: #kdevelop, kfunk Reviewed By: #kdevelop, kfunk Subscribers: kdevelop-devel Differential Revision: https://phabricator.kde.org/D6689 M +4 -3 projectmanagers/cmake/cmakecodecompletionmodel.cpp https://commits.kde.org/kdevelop/db14d0e4989e790b341a88ebc3f8c28896cc58ea