Author Topic: Clang based CC, new CC interface  (Read 105218 times)

Offline koonschi

  • Multiple posting newcomer
  • *
  • Posts: 27
    • My personal project
Re: Clang based CC, new CC interface
« Reply #60 on: May 13, 2014, 11:59:07 am »
Hi, first of all:
Awesome work. This really gives codeblocks a boost. I particularly enjoy clang's ability to deduce the auto type and complicated templates.

Some feedback from my side:
- It would be great to have the clang parsing in a separate thread. I'm working on a big project with 1000+ files, and nearly half of my time is spent switching between those files, so I always get the parsing delay (up to 8 seconds) when opening a new file, which is distracting.
- The (parsing?) delay also occurs pretty often when I'm editing headers. When I want to type a new member function, I get a delay of 1 - 2 seconds every 2 characters.
- Showing the diagnosis warnings/errors should be configurable in some way.
- I'd love to put the "Resolve symbol (clang)" function on a hotkey.

Keep up the great work!

Edit: Working on Kubuntu 14.04, 64 bit, latest nightly.
« Last Edit: May 13, 2014, 12:03:59 pm by koonschi »
"As a general rule, the compiler is smarter than you, and working in your best interest. Do not question it." - Terry Mahaffey

#define TRUE FALSE // happy debugging suckers

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Clang based CC, new CC interface
« Reply #61 on: May 14, 2014, 04:23:02 am »
Thanks all for the feedback, I have started a todo list.

Definitely lots of performance issues to take care of.  Most of these will be mitigated by switching to a threaded model, however, I do not plan to attempt that until all major single-threaded crashes are dealt with (no need to complicate problems).

A few specific responses:
3- The '.' and '->' kicks in for almost everything like 'for./->' 'int./->' 'some_class_name./->' even when typed on their own and the list consists of almost everything too.
Hmm, I never noticed it before; I shall be working on resolving that.
- The (parsing?) delay also occurs pretty often when I'm editing headers. When I want to type a new member function, I get a delay of 1 - 2 seconds every 2 characters.
Working editing headers disables clang's internal caching ability, so that is why the delay is even more noticeable.  (This delay is unacceptable for real work; I am thinking on how to best resolve it.)
[...]
The same crash.
I made a simple wxFrame project and after i added a button on frame and set OnClick event for button... [...]
I will be looking more in depth to try to reproduce this crash on my machine (probably this weekend, or sooner if time allows).  Could you also post (an archive of) a minimal project that causes the crash?

All feedback/ideas/bug reports/feature requests welcome.  I may not be able to respond to each point, but the more ideas, the better :) .

Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 117
Re: Clang based CC, new CC interface
« Reply #62 on: May 26, 2014, 10:32:51 am »
I have installed nightly 9765 (on Windows) and currently I prefer it working with the old CC interface. The Clang one has problems when opening a project, even small ones. It sometimes makes C::B unresponsive for some seconds, and a couple of times I've had C::B crash when opening projects.

On the interface itself, I personally believe there is too much hand holding for the programmer. When your code is still being written, the errors displayed inside the code take too much room and make readability poor. Also I'd prefer not to have all parameter commas written when I am writing a function.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Clang based CC, new CC interface
« Reply #63 on: May 28, 2014, 01:52:35 am »
It sometimes makes C::B unresponsive for some seconds, and a couple of times I've had C::B crash when opening projects.
Known issues; this plugin is still in its early stages, and not intended for general use.
When your code is still being written, the errors displayed inside the code take too much room and make readability poor.
From my usage, it currently updates too quickly for sane typing, so I think changing the default to a longer timer, or only checking on save, might be better.  Also, once there is a settings page, this will become configurable to put messages in tooltips/not display at all.
Also I'd prefer not to have all parameter commas written when I am writing a function.
It looked like a good idea at the time :P , though I agree, it mostly just gets in the way (without the ability to tab between parameters, or something).

I unfortunately am currently recovering from a minor surgery, so I am unsure when I will be able to step back into work.  Soon hopefully.

Offline carra

  • Multiple posting newcomer
  • *
  • Posts: 117
Re: Clang based CC, new CC interface
« Reply #64 on: May 29, 2014, 01:02:24 pm »
I unfortunately am currently recovering from a minor surgery, so I am unsure when I will be able to step back into work.  Soon hopefully.
Don't worry there is no hurry. I just tried the plugin and thoguht it would be nice to give some feedback. But right now just concentrate on recovering  ;)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Clang based CC, new CC interface
« Reply #65 on: June 04, 2014, 03:31:20 pm »
I unfortunately am currently recovering from a minor surgery, so I am unsure when I will be able to step back into work.  Soon hopefully.
Hopefully you will be recovered soon  :).

BTW: When reviewing the CC code, one idea comes to my mind: is it possible put all the operations on the TokensTree as a "threaded task", and those tasks will only be run from the thread pool. If the user need to show the code suggestion list, we assignment a task to the pool, and it will run in the worker thread, and finally when the task finishes, we can receive an event, and show the suggestion list. It makes some kind of synchronize operations. The main idea is to remove the "lockers" in the TokensTree, and we can serialize the operations on the Tree. We can even assign some priority task, which can be put in the front of the task queue.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline edison

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Clang based CC, new CC interface
« Reply #66 on: September 01, 2014, 04:44:51 am »
The error message is hard to read when using a dark theme.
« Last Edit: September 01, 2014, 04:49:09 am by edison »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Clang based CC, new CC interface
« Reply #67 on: September 01, 2014, 04:47:35 pm »
The style used is currently hooked (hacked) into wxSmith highlighting; so you can modify it by changing the second to last entry for C++ under Settings->Editor->Syntax highlighting.

Offline edison

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Clang based CC, new CC interface
« Reply #68 on: September 01, 2014, 06:11:06 pm »
Thanks, it's much better after change the settings.

Offline edison

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Clang based CC, new CC interface
« Reply #69 on: October 13, 2014, 05:40:51 am »
The Clanglib does not work with last CB svn build (994x+).

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Clang based CC, new CC interface
« Reply #70 on: October 13, 2014, 07:41:30 am »
The Clanglib does not work with last CB svn build (994x+).
What exactly is not working?  (During my quick test, it built and ran against svn head.)

Offline edison

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Clang based CC, new CC interface
« Reply #71 on: October 13, 2014, 08:54:08 am »
Yes, it can be built but when I run the CB(svn 9966), there is a pop-up window:


Update:
I have found out what caused this problem: the libclang.dll from ClangOnWin build.
There is not such problem when using the offical build from http://llvm.org/builds/ .

« Last Edit: October 13, 2014, 10:48:50 am by edison »

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Clang based CC, new CC interface
« Reply #72 on: January 29, 2016, 08:54:50 pm »
Pushed a Windows binary compatible with C::B 16.01 ClangLib v0.2.  The main difference from previous binary is parsing is done in the background.

Note: feature development is currently here.  This release is does not include most of the new changes in order for stability on Windows.