Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » theide with libclang
Re: theide with libclang [message #59076 is a reply to message #59070] Thu, 27 October 2022 12:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Lance wrote on Wed, 26 October 2022 16:00
Not sure if this problem is unique to me: on Ubuntu 22.10+UPP.16512 (and some other recent versions),
"Find..." function cannot be used. Ctrl+F, type in string to search, won't work.


This one seems to work for me.

Any chance you are trying to search in very long file? In that case, incremental search is disabled (and you need to push "Find next" button).

If that is not the explanation:

Do you see bottom bar with text?

Can you type text into into the field?

Have you tried pressing next/previous buttons?

What about Find in files?

Mirek
Re: theide with libclang [message #59094 is a reply to message #59076] Tue, 01 November 2022 23:32 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Thank you, Mirek! Both are fixed in UPP version 16523.

Another bug I found a few weeks (maybe months) ago. I tested with version 16523 and it's still there.

To reproduce the experience, move away or rename libclang.so/dll etc so that it cannot be detected when theide starts. Or, change
bool TryLoadLibClang()
at line 120 in <ide/main.cpp> to fail the LibClang loading:

bool TryLoadLibClang()
{
        // add the following line to
	return false;  // make sure detection fails.


	String libdir = TrimBoth(Sys("llvm-config --libdir"));
	int q = FindIndex(CommandLine(), "--clangdir");
	if(q >= 0 && q + 1 < CommandLine().GetCount()) {
		libdir = CommandLine()[q + 1];
		CommandLineRemove(q, 2);
	}
	
	
	if(LoadLibClang(libdir))
		return true;
	if(LoadLibClang("/usr/lib"))
		return true;
	for(int i = 200; i >= 10; i--)
		if(LoadLibClang("/usr/lib/llvm-" + AsString(i) + "/lib"))
			return true;
	return false;
}



F5 to compile and run the modified theide, in it, open button.cpp from <examples/Button>, left click on, for example the word 'TopWindow', the assist++ will start a dialog that will never end unless cancelled.

I am not sure if there are other occassions like this when assist++ will be started by some other key combinations or mouse events, even though theide knows and even prompted the end users of "libclang detection failure". This is no longer bothering me, but could confuse a person who starts to try UPP.

[Updated on: Wed, 02 November 2022 00:22]

Report message to a moderator

Re: theide with libclang [message #59096 is a reply to message #59094] Wed, 02 November 2022 00:15 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Another more like a feature request:

Take for example, the following code:
class Person
{
	int age_;
public:
	int get_age()const { return age_; }
	void set_age(int age){ age_ = age; }
	__declspec(property(get=get_age, put = set_age)) int age;
};



theide/Assist++ will put a red rect at the beginning of __declspec, with error message ...'__declspec' attributes are not enabled; use '-fdeclspec'..., even though the flag has been turned on. This is kind of a fictitious example. The real issue here is, the flags I set in "Setup > Build Methods" for CLANG, under common c++ options
-std=c++20 -Wno-logical-op-parentheses -fdeclspec


is not respected by assist++.

So if someone wants to try some c++20 new language features, assist++ will stick to builtin option of '-std=c++14' and keep bugging him.

[Updated on: Wed, 02 November 2022 00:17]

Report message to a moderator

Re: theide with libclang [message #59097 is a reply to message #59096] Wed, 02 November 2022 01:58 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
It might be something messed up in my system.

Quote:

Any chance you are trying to search in very long file? In that case, incremental search is disabled (and you need to push "Find next" button).

No.

Quote:

Do you see bottom bar with text?

Yes.

Quote:

Can you type text into into the field?

Yes.

Quote:

Have you tried pressing next/previous buttons?

Yes, nothing happen. O occurrence, or something like that.

Quote:

What about Find in files?

This has always worked fine.

By the way, if I don't go through the menu, but use Ctrl+F instead, I receive a ding, but nothing happen afterwards, not even the text field for entering text to be searched.

I have overwritten the previous compiled version of ide. Above replies are according to my memory. I don't think they matter any more since that problem might be unique to me.
Re: theide with libclang [message #59100 is a reply to message #59096] Wed, 02 November 2022 10:21 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Lance wrote on Wed, 02 November 2022 00:15
Another more like a feature request:

Take for example, the following code:
class Person
{
	int age_;
public:
	int get_age()const { return age_; }
	void set_age(int age){ age_ = age; }
	__declspec(property(get=get_age, put = set_age)) int age;
};



theide/Assist++ will put a red rect at the beginning of __declspec, with error message ...'__declspec' attributes are not enabled; use '-fdeclspec'..., even though the flag has been turned on. This is kind of a fictitious example. The real issue here is, the flags I set in "Setup > Build Methods" for CLANG, under common c++ options
-std=c++20 -Wno-logical-op-parentheses -fdeclspec


is not respected by assist++.

So if someone wants to try some c++20 new language features, assist++ will stick to builtin option of '-std=c++14' and keep bugging him.


Well, this will be a bit complicated: We are not sure that libclang version is able to support -std=c++20.... Any ideas?

(In general, libclang is not the same thing as clang, so we cannot really use options from build method... Adding " -Wno-logical-op-parentheses -fdeclspec" as fixed options makes sense though.)

Mirek
Re: theide with libclang [message #59103 is a reply to message #59097] Wed, 02 November 2022 15:58 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Lance wrote on Wed, 02 November 2022 01:58
It might be something messed up in my system.

Quote:

Any chance you are trying to search in very long file? In that case, incremental search is disabled (and you need to push "Find next" button).

No.

Quote:

Do you see bottom bar with text?

Yes.

Quote:

Can you type text into into the field?

Yes.

Quote:

Have you tried pressing next/previous buttons?

Yes, nothing happen. O occurrence, or something like that.

Quote:

What about Find in files?

This has always worked fine.

By the way, if I don't go through the menu, but use Ctrl+F instead, I receive a ding, but nothing happen afterwards, not even the text field for entering text to be searched.

I have overwritten the previous compiled version of ide. Above replies are according to my memory. I don't think they matter any more since that problem might be unique to me.


I have installed 22.10 in Virtual Box and tested:

index.php?t=getfile&id=6701&private=0

all seems fine Sad

(On the positively negative note, theide crashed the first time I have run it. I have noticed this before in Windows, so now it is officially a new phantom bug to fix...)

[Updated on: Wed, 02 November 2022 16:00]

Report message to a moderator

Re: theide with libclang [message #59104 is a reply to message #59096] Wed, 02 November 2022 19:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Lance wrote on Wed, 02 November 2022 00:15
Another more like a feature request:

Take for example, the following code:
class Person
{
	int age_;
public:
	int get_age()const { return age_; }
	void set_age(int age){ age_ = age; }
	__declspec(property(get=get_age, put = set_age)) int age;
};



theide/Assist++ will put a red rect at the beginning of __declspec, with error message ...'__declspec' attributes are not enabled; use '-fdeclspec'..., even though the flag has been turned on. This is kind of a fictitious example. The real issue here is, the flags I set in "Setup > Build Methods" for CLANG, under common c++ options
-std=c++20 -Wno-logical-op-parentheses -fdeclspec


is not respected by assist++.

So if someone wants to try some c++20 new language features, assist++ will stick to builtin option of '-std=c++14' and keep bugging him.


Hopefully solved by adding a field for additional libclang options to Assist settings (so that you can specify -std=c++20 there...)
Re: theide with libclang [message #59106 is a reply to message #59104] Wed, 02 November 2022 22:52 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Thank you, Mirek. I will test it when github/ultimatepp is updated.

BTW, "Find" now works fine in UPP.16523 like I have reported yesterday.

And yes, I also had a mysterious theide-crash-on first-run-then-works-fine-afterwords experience. I accidently updated a upp.16470 src and built theide from there, on first run, it crashed with invalid-memory-access. Strange.
Re: theide with libclang [message #59110 is a reply to message #59106] Thu, 03 November 2022 20:06 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
additional c++ options for libclang works like a charm in most recent version 16528.

The setting is through:
Main Menu: Setup -> Settings ...
in Assist tab
Second last item "libclang additional options"

After I set it to
-Wno-logical-op-parentheses -std=c++20 -fdeclspec
the following sample code are properly understood by Assist++

class Person
{
	int age_;
public:
	int get_age()const { return age_; }
	void set_age(int age){ age_ = age; }
	__declspec(property(get=get_age, put = set_age)) int age;
};

template <class T>
concept A = requires(T t) {
	++t;
};


Wonderful! Imaging how much work it will involve if libclang is not used and we have to update the homegrown c++ parser to provide intellisense to the ever-updating c++ language.

I remember a while ago I dug into the parser while trying to add support to attribute: it is so complicated and involving that I had to give up.

It's great to see that libclang-powered assist++ becomes quite usable in rapid pace.

[Updated on: Thu, 03 November 2022 20:10]

Report message to a moderator

Re: theide with libclang [message #59195 is a reply to message #59110] Mon, 21 November 2022 16:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
In recent commit, I have tried to mitigate somewhat the performance issue when you are building with Indexer doing its thing. I cannot suspend threads in Linux unfortunately, so I have added sort of "blocking sleep" into indexer. Far from ideal as this only can take place when libclang is not compiling (means after starting the build, it might take some seconds to stop indexer), but better than nothing....
Re: theide with libclang [message #59197 is a reply to message #59195] Tue, 22 November 2022 08:28 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 697
Registered: December 2005
Location: Budapest, Hungary
Contributor
Thanks for your work.

A problem: Alt + C is not working now. It starts an endless "Parsing" and doesn't copy anything to the clipboard.
Re: theide with libclang [message #59198 is a reply to message #59197] Tue, 22 November 2022 10:28 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
zsolt wrote on Tue, 22 November 2022 08:28
Thanks for your work.

A problem: Alt + C is not working now. It starts an endless "Parsing" and doesn't copy anything to the clipboard.


Works for me. Endless "Parsing" would mean that current file parser never stops.

Does it do that always? If yes, can you post more info so that I can reproduce?

Does autocomplete work? (That is basically the same parsing thread).

Mirek
Re: theide with libclang [message #59199 is a reply to message #59198] Tue, 22 November 2022 11:21 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 697
Registered: December 2005
Location: Budapest, Hungary
Contributor
mirek wrote on Tue, 22 November 2022 10:28


Does it do that always? If yes, can you post more info so that I can reproduce?

Does autocomplete work? (That is basically the same parsing thread).

Mirek


Interesting. I can not reproduce it anymore. I restarted the IDE, maybe reindexing helped.
Re: theide with libclang [message #59200 is a reply to message #59199] Tue, 22 November 2022 11:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
zsolt wrote on Tue, 22 November 2022 11:21
mirek wrote on Tue, 22 November 2022 10:28


Does it do that always? If yes, can you post more info so that I can reproduce?

Does autocomplete work? (That is basically the same parsing thread).

Mirek


Interesting. I can not reproduce it anymore. I restarted the IDE, maybe reindexing helped.


It is not related to reindexing. Anyway, I have noticed that in rare cases, current file parse gets stuck for some reason - I have it in internal todo list. Usually clicking other file and then back helps.
Re: theide with libclang [message #59201 is a reply to message #59200] Tue, 22 November 2022 11:40 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 697
Registered: December 2005
Location: Budapest, Hungary
Contributor
Thanks.
Re: theide with libclang [message #59204 is a reply to message #59201] Wed, 23 November 2022 00:44 Go to previous messageGo to next message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
Hi Mirek:

In dark theme, the error texts is not legible.
index.php?t=getfile&id=6716&private=0

BR,
Lance
Re: theide with libclang [message #59205 is a reply to message #59204] Wed, 23 November 2022 10:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Lance wrote on Wed, 23 November 2022 00:44
Hi Mirek:

In dark theme, the error texts is not legible.
index.php?t=getfile&id=6716&private=0

BR,
Lance


Hopefully fixed, thanks for reporting.
Re: theide with libclang [message #59207 is a reply to message #59205] Thu, 24 November 2022 03:12 Go to previous message
Lance is currently offline  Lance
Messages: 526
Registered: March 2007
Contributor
mirek wrote on Wed, 23 November 2022 04:46
Lance wrote on Wed, 23 November 2022 00:44
Hi Mirek:

In dark theme, the error texts is not legible.
index.php?t=getfile&id=6716&private=0

BR,
Lance


Hopefully fixed, thanks for reporting.


Thanks for the quick response. I will check github tomorrow. Version 16566 as of now still not fixed.

PS: Just compiled ver 16575. The problem is gone. Thanks!

[Updated on: Sat, 26 November 2022 01:07]

Report message to a moderator

Previous Topic: Impressive improvement in stl::vector when dealing with raw memory.
Next Topic: about unicode supporting
Goto Forum:
  


Current Time: Sat Apr 27 22:29:43 CEST 2024

Total time taken to generate the page: 0.04876 seconds