[kdevelop] [Bug 357774] C source files are not parsed by new Clang parser in mixed (C and C++) project

2016-03-07 Thread Sergey Kalinichev via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=357774

Sergey Kalinichev  changed:

   What|Removed |Added

  Latest Commit||http://commits.kde.org/kdev
   ||elop/70834035889654703d9b3e
   ||ca2c4951a03a0eda53
 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Sergey Kalinichev  ---
Git commit 70834035889654703d9b3eca2c4951a03a0eda53 by Sergey Kalinichev.
Committed on 08/03/2016 at 06:05.
Pushed by skalinichev into branch '5.0'.

Parse C files in C mode

Now there are 2 language profiles: one for C++, another one for C.
The language type is determined by mime type.
Since *.h files used in C and C++, by default they are parsed
in C++ mode, to change that behavior there is a "Parse *.h headers
in plain C" check-box.
Related: bug 357615, bug 57156

Differential revision: https://phabricator.kde.org/D1047

M  +1-1languages/clang/clangparsejob.cpp
M  +5-0languages/clang/clangsettings/clangsettingsmanager.cpp
M  +2-0languages/clang/clangsettings/clangsettingsmanager.h
M  +1-1languages/clang/duchain/parsesession.cpp
M  +2-1languages/clang/tests/test_duchain.cpp
M  +0-1languages/clang/tests/test_files.cpp
M  +12   -2   
languages/plugins/custom-definesandincludes/compilerprovider/compilerprovider.cpp
M  +64   -9   
languages/plugins/custom-definesandincludes/compilerprovider/settingsmanager.cpp
M  +33   -2   
languages/plugins/custom-definesandincludes/compilerprovider/settingsmanager.h
M  +15   -6   
languages/plugins/custom-definesandincludes/definesandincludesmanager.cpp
M  +1-0   
languages/plugins/custom-definesandincludes/definesandincludesmanager.h
M  +2-2   
languages/plugins/custom-definesandincludes/idefinesandincludesmanager.h
M  +57   -24  
languages/plugins/custom-definesandincludes/kcm_widget/parserwidget.cpp
M  +6-3   
languages/plugins/custom-definesandincludes/kcm_widget/parserwidget.h
M  +120  -8   
languages/plugins/custom-definesandincludes/kcm_widget/parserwidget.ui
M  +4-3   
languages/plugins/custom-definesandincludes/kcm_widget/projectpathsmodel.cpp
M  +1-1   
languages/plugins/custom-definesandincludes/kcm_widget/projectpathsmodel.h
M  +3-2   
languages/plugins/custom-definesandincludes/kcm_widget/projectpathswidget.cpp
M  +1-1   
languages/plugins/custom-definesandincludes/tests/test_definesandincludes.cpp

http://commits.kde.org/kdevelop/70834035889654703d9b3eca2c4951a03a0eda53

-- 
You are receiving this mail because:
You are watching all bug changes.


[kdevelop] [Bug 357615] C file parsed as a C++ file

2016-03-07 Thread Sergey Kalinichev via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=357615

Sergey Kalinichev  changed:

   What|Removed |Added

 Status|CONFIRMED   |RESOLVED
 Resolution|--- |FIXED
  Latest Commit||http://commits.kde.org/kdev
   ||elop/70834035889654703d9b3e
   ||ca2c4951a03a0eda53

--- Comment #16 from Sergey Kalinichev  ---
Git commit 70834035889654703d9b3eca2c4951a03a0eda53 by Sergey Kalinichev.
Committed on 08/03/2016 at 06:05.
Pushed by skalinichev into branch '5.0'.

Parse C files in C mode

Now there are 2 language profiles: one for C++, another one for C.
The language type is determined by mime type.
Since *.h files used in C and C++, by default they are parsed
in C++ mode, to change that behavior there is a "Parse *.h headers
in plain C" check-box.
Related: bug 357774, bug 57156

Differential revision: https://phabricator.kde.org/D1047

M  +1-1languages/clang/clangparsejob.cpp
M  +5-0languages/clang/clangsettings/clangsettingsmanager.cpp
M  +2-0languages/clang/clangsettings/clangsettingsmanager.h
M  +1-1languages/clang/duchain/parsesession.cpp
M  +2-1languages/clang/tests/test_duchain.cpp
M  +0-1languages/clang/tests/test_files.cpp
M  +12   -2   
languages/plugins/custom-definesandincludes/compilerprovider/compilerprovider.cpp
M  +64   -9   
languages/plugins/custom-definesandincludes/compilerprovider/settingsmanager.cpp
M  +33   -2   
languages/plugins/custom-definesandincludes/compilerprovider/settingsmanager.h
M  +15   -6   
languages/plugins/custom-definesandincludes/definesandincludesmanager.cpp
M  +1-0   
languages/plugins/custom-definesandincludes/definesandincludesmanager.h
M  +2-2   
languages/plugins/custom-definesandincludes/idefinesandincludesmanager.h
M  +57   -24  
languages/plugins/custom-definesandincludes/kcm_widget/parserwidget.cpp
M  +6-3   
languages/plugins/custom-definesandincludes/kcm_widget/parserwidget.h
M  +120  -8   
languages/plugins/custom-definesandincludes/kcm_widget/parserwidget.ui
M  +4-3   
languages/plugins/custom-definesandincludes/kcm_widget/projectpathsmodel.cpp
M  +1-1   
languages/plugins/custom-definesandincludes/kcm_widget/projectpathsmodel.h
M  +3-2   
languages/plugins/custom-definesandincludes/kcm_widget/projectpathswidget.cpp
M  +1-1   
languages/plugins/custom-definesandincludes/tests/test_definesandincludes.cpp

http://commits.kde.org/kdevelop/70834035889654703d9b3eca2c4951a03a0eda53

-- 
You are receiving this mail because:
You are watching all bug changes.


[kdevelop] [Bug 57156] Language support for plain C files

2016-03-07 Thread Sergey Kalinichev via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=57156

Sergey Kalinichev  changed:

   What|Removed |Added

  Latest Commit||http://commits.kde.org/kdev
   ||elop/70834035889654703d9b3e
   ||ca2c4951a03a0eda53
 Status|CONFIRMED   |RESOLVED
 Resolution|--- |FIXED

--- Comment #24 from Sergey Kalinichev  ---
Git commit 70834035889654703d9b3eca2c4951a03a0eda53 by Sergey Kalinichev.
Committed on 08/03/2016 at 06:05.
Pushed by skalinichev into branch '5.0'.

Parse C files in C mode

Now there are 2 language profiles: one for C++, another one for C.
The language type is determined by mime type.
Since *.h files used in C and C++, by default they are parsed
in C++ mode, to change that behavior there is a "Parse *.h headers
in plain C" check-box.
Related: bug 357774, bug 357615

Differential revision: https://phabricator.kde.org/D1047

M  +1-1languages/clang/clangparsejob.cpp
M  +5-0languages/clang/clangsettings/clangsettingsmanager.cpp
M  +2-0languages/clang/clangsettings/clangsettingsmanager.h
M  +1-1languages/clang/duchain/parsesession.cpp
M  +2-1languages/clang/tests/test_duchain.cpp
M  +0-1languages/clang/tests/test_files.cpp
M  +12   -2   
languages/plugins/custom-definesandincludes/compilerprovider/compilerprovider.cpp
M  +64   -9   
languages/plugins/custom-definesandincludes/compilerprovider/settingsmanager.cpp
M  +33   -2   
languages/plugins/custom-definesandincludes/compilerprovider/settingsmanager.h
M  +15   -6   
languages/plugins/custom-definesandincludes/definesandincludesmanager.cpp
M  +1-0   
languages/plugins/custom-definesandincludes/definesandincludesmanager.h
M  +2-2   
languages/plugins/custom-definesandincludes/idefinesandincludesmanager.h
M  +57   -24  
languages/plugins/custom-definesandincludes/kcm_widget/parserwidget.cpp
M  +6-3   
languages/plugins/custom-definesandincludes/kcm_widget/parserwidget.h
M  +120  -8   
languages/plugins/custom-definesandincludes/kcm_widget/parserwidget.ui
M  +4-3   
languages/plugins/custom-definesandincludes/kcm_widget/projectpathsmodel.cpp
M  +1-1   
languages/plugins/custom-definesandincludes/kcm_widget/projectpathsmodel.h
M  +3-2   
languages/plugins/custom-definesandincludes/kcm_widget/projectpathswidget.cpp
M  +1-1   
languages/plugins/custom-definesandincludes/tests/test_definesandincludes.cpp

http://commits.kde.org/kdevelop/70834035889654703d9b3eca2c4951a03a0eda53

-- 
You are receiving this mail because:
You are watching all bug changes.


[kdevelop] [Bug 355148] Missing function: "Code -> Move to source"

2016-02-27 Thread Sergey Kalinichev via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=355148

Sergey Kalinichev  changed:

   What|Removed |Added

 Resolution|--- |FIXED
  Latest Commit||http://commits.kde.org/kdev
   ||elop/9b001d16ff1e88dc09f402
   ||98eba82a59f5dc357b
 Status|CONFIRMED   |RESOLVED

--- Comment #4 from Sergey Kalinichev  ---
Git commit 9b001d16ff1e88dc09f40298eba82a59f5dc357b by Sergey Kalinichev.
Committed on 28/02/2016 at 06:28.
Pushed by skalinichev into branch '5.0'.

Added "move into source" helper

This mostly uses the code from oldcpp. Which I cleaned up a bit and
remove a lot of unused functionality. Also I had to introduce a couple of
changes to the code due to e.g. inconsistencies in internal vs.
function contexts with oldcpp.
Related: bug 358480

Differential revision: https://phabricator.kde.org/D1005

M  +2-0languages/clang/CMakeLists.txt
M  +10   -4languages/clang/clangsupport.cpp
M  +2-2languages/clang/clangsupport.h
A  +251  -0languages/clang/codegen/simplerefactoring.cpp [License: GPL
(v2/3)]
A  +58   -0languages/clang/codegen/simplerefactoring.h [License: GPL
(v2/3)]
A  +321  -0languages/clang/codegen/sourcemanipulation.cpp [License: GPL
(v2/3)]
A  +80   -0languages/clang/codegen/sourcemanipulation.h [License: GPL
(v2/3)]
M  +97   -0languages/clang/tests/test_assistants.cpp
M  +3-0languages/clang/tests/test_assistants.h

http://commits.kde.org/kdevelop/9b001d16ff1e88dc09f40298eba82a59f5dc357b

-- 
You are receiving this mail because:
You are watching all bug changes.


[kdevelop] [Bug 358480] "move into source" helper missing

2016-02-27 Thread Sergey Kalinichev via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=358480

Sergey Kalinichev  changed:

   What|Removed |Added

  Latest Commit||http://commits.kde.org/kdev
   ||elop/9b001d16ff1e88dc09f402
   ||98eba82a59f5dc357b
 Resolution|--- |FIXED
 Status|CONFIRMED   |RESOLVED

--- Comment #1 from Sergey Kalinichev  ---
Git commit 9b001d16ff1e88dc09f40298eba82a59f5dc357b by Sergey Kalinichev.
Committed on 28/02/2016 at 06:28.
Pushed by skalinichev into branch '5.0'.

Added "move into source" helper

This mostly uses the code from oldcpp. Which I cleaned up a bit and
remove a lot of unused functionality. Also I had to introduce a couple of
changes to the code due to e.g. inconsistencies in internal vs.
function contexts with oldcpp.
Related: bug 355148

Differential revision: https://phabricator.kde.org/D1005

M  +2-0languages/clang/CMakeLists.txt
M  +10   -4languages/clang/clangsupport.cpp
M  +2-2languages/clang/clangsupport.h
A  +251  -0languages/clang/codegen/simplerefactoring.cpp [License: GPL
(v2/3)]
A  +58   -0languages/clang/codegen/simplerefactoring.h [License: GPL
(v2/3)]
A  +321  -0languages/clang/codegen/sourcemanipulation.cpp [License: GPL
(v2/3)]
A  +80   -0languages/clang/codegen/sourcemanipulation.h [License: GPL
(v2/3)]
M  +97   -0languages/clang/tests/test_assistants.cpp
M  +3-0languages/clang/tests/test_assistants.h

http://commits.kde.org/kdevelop/9b001d16ff1e88dc09f40298eba82a59f5dc357b

-- 
You are receiving this mail because:
You are watching all bug changes.


[kdevelop] [Bug 357615] C file parsed as a C++ file

2016-02-21 Thread Sergey Kalinichev via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=357615

--- Comment #14 from Sergey Kalinichev  ---
Ok, I'm going to look into it.

Still I don't really see an easy way to integrate this feature in the UI.
E.g. should it be something like adding 2 options:
C++ profile: ...
C profile: ...

And then use given profile based on file extension.
If so, what about headers? We will parse it as C++, but what if a project is in
plain C? Yes we'll parse headers in plain C most of the time, because of TU
pinning. But this solution is far from being perfect. Maybe we should add an
option like: "parse headers in plain C"? And if this option is checked parse
all .h files under given directory in plain C mode?

 Any suggestions on how to improve it?

-- 
You are receiving this mail because:
You are watching all bug changes.


[kdevelop] [Bug 355148] Missing function: "Code -> Move to source"

2016-01-25 Thread Sergey Kalinichev via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=355148

--- Comment #3 from Sergey Kalinichev  ---
Created attachment 96837
  --> https://bugs.kde.org/attachment.cgi?id=96837&action=edit
Patch

Here is a patch that adds "move into source" support. It still missing tests,
also I noticed that there are some issues with e.g. const parameters, and
probably more.

I'm not really sure when I'll have time to fix those issues (maybe in the next
month), so I'm pasting this patch here, in case someone wants to work on it.

-- 
You are receiving this mail because:
You are watching all bug changes.


[kdevelop] [Bug 358524] KDevelop crashed when adding a custom include path

2016-01-25 Thread Sergey Kalinichev via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=358524

--- Comment #1 from Sergey Kalinichev  ---
Looking at the backtrace it seems like you're using not the latest version of
KDevelop. There were some changes in that area recently, so it's worth
updating. 

Also it's a mystery for me how you ended up at 
KDevelop::ProjectController::configureProject.
DefinesAndIncludesConfigPage::saveTo doesn't use that method (I've just tested
it under gdb to make sure)...

So I'd suggest you to rebuild both kdevplatform/kdevelop from master branch and
see if the crash persists. If so please attach an updated backtrace.

-- 
You are receiving this mail because:
You are watching all bug changes.


[kdevelop] [Bug 357615] C file parsed as a C++ file

2016-01-07 Thread Sergey Kalinichev via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=357615

--- Comment #9 from Sergey Kalinichev  ---
> but .h files are parsed as part of #include directives. 

When compiling yes, but inside IDE not necessarily (e.g. you can add a header
file and work on it, and #include it later on).

> Without wanting to sound demeaning, other IDE's don't have this problem. How 
> did they solve it?

I hardly doubt any other IDE performs such in-depth analysis as Clang does, so
most likely "other IDE's" are simply not smart enough to correctly parse your
test case.

> Setting the project settings won't work on the very common setting where a 
> project has both C and C++ files (and potentially other languages).

Like I've already mentioned you can select language type per file basis.

-- 
You are receiving this mail because:
You are watching all bug changes.


[kdevelop] [Bug 357615] C file parsed as a C++ file

2016-01-07 Thread Sergey Kalinichev via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=357615

Sergey Kalinichev  changed:

   What|Removed |Added

 CC||kalinichev.s...@gmail.com

--- Comment #5 from Sergey Kalinichev  ---
Hi,
We already had such discussion some time ago. Generally I think it's not a very
good idea to determine language type solely on file extension (consider e.g.
*.h - very popular extension used both for c and c++, and I see no reliable way
how to distinguish it).

Also you can already select language per project, directory or file:
Project->Open configuration...->Language support->C/C++ parser. 
If anything we could use build manger to provide compiler invocation arguments,
when available.

> Leaks into *every* compiler invocation afaics. Shouldn't append -std=c++11 
> for C files, though.
Could you be more specific, please? I don't really understand what is leaked
and where...

> Shouldn't append -std=c++11 for C files, though.
Again, these arguments are fully configurable.

-- 
You are receiving this mail because:
You are watching all bug changes.


[kdevelop] [Bug 355148] Missing function: "Code -> Move to source"

2015-12-13 Thread Sergey Kalinichev via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=355148

Sergey Kalinichev  changed:

   What|Removed |Added

 CC||kalinichev.s...@gmail.com,
   ||m...@milianw.de
 Status|UNCONFIRMED |CONFIRMED
 Ever confirmed|0   |1

--- Comment #1 from Sergey Kalinichev  ---
Yes, I miss this feature too. 
There was an attept to use Clang for refactoring (I guess this included move to
source too), but I'm not sure what happened to it . If we're not going to use
it, then I could port the needed code over from oldcpp to make this feature
work.

Milian, what's the status of Clang-based refactoring? Any plans on merging it
into master?

-- 
You are receiving this mail because:
You are watching all bug changes.


[kdevelop] [Bug 356572] Crash when parsing the source code of LibreOffice

2015-12-13 Thread Sergey Kalinichev via KDE Bugzilla
https://bugs.kde.org/show_bug.cgi?id=356572

Sergey Kalinichev  changed:

   What|Removed |Added

 CC||kalinichev.s...@gmail.com

--- Comment #1 from Sergey Kalinichev  ---
I'd suggest you to build the latest version of Clang from sources and see if
this assert persists. If so try to find out what file is being parsed (e.g. add
"qWarning() << m_environment.translationUnitUrl();" to ~ParseSessionData()),
and then try to build a minimally reproducible test case and attach it here.

Also you could build Clang in release mode without asserts, that should
workaround this and other asserts that we trigger in Clang code base. Or you
could disable "Schedule all project files for parsing" in Settings->Configure
KDevelop->Projects, that will probably workaround the assert too.

-- 
You are receiving this mail because:
You are watching all bug changes.