Author Topic: Finding stl tags in C++ project  (Read 305 times)

guth

  • Community Member
  • Posts: 74
  • Hero Points: 6
Finding stl tags in C++ project
« on: February 10, 2019, 02:56:24 pm »
On Linux, xubuntu 18.04 I believe, I tried to create a C++ project in Slickedit 23.0.0 latest hotfix, but when, e.g., creating a string variable a and trying to complete member methods on it, nothing is found. The compiler tags are created and ctrl-dot on the include file jumps to it. How do I enable completion of stl methods?

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2571
  • Hero Points: 386
Re: Finding stl tags in C++ project
« Reply #1 on: February 11, 2019, 11:34:49 pm »
Could you give a small source sample.

I tried adding this to the sample C++ workspace, and completion worked perfectly when I tested with my Ubuntu 18.04 VM. I was using the GCC 7.3.0 compiler configuration for my project (which was the default).  Are you trying to use clang or another installed compiler ?

std::string xxx;
xxx. <works> ;

std::vector<std::string> aaa;
aaa[0]. <works> ;

« Last Edit: February 11, 2019, 11:44:32 pm by Dennis »

guth

  • Community Member
  • Posts: 74
  • Hero Points: 6
Re: Finding stl tags in C++ project
« Reply #2 on: February 13, 2019, 03:41:47 pm »
I tried now to delete .slickedit directory and launch slickedit fresh. Loading a cpp file and generating tags for unix includes and gcc7.3 still does not give any method completion suggestions. Ctrl-. on the type std::string loads the correct file though. I think the completions did work during tagging at one point, so maybe there are other headers that confuse the look up.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2571
  • Hero Points: 386
Re: Finding stl tags in C++ project
« Reply #3 on: February 13, 2019, 05:52:17 pm »
Make sure the file you are in is in C/C++ mode, Document > Select Mode... (in case if you are in an extension less file, or using an unusual file extension for C++).

What exact completion operation are you trying to do?  Just hitting "." for auto-list-members, or hitting Atl+Dot to force list-members, or hitting Ctrl+Space to try to complete the symbol under the cursor, or something else?

Give me a complete example, exact keystrokes and settings (or default config is best), and I will find or explain the problem.

guth

  • Community Member
  • Posts: 74
  • Hero Points: 6
Re: Finding stl tags in C++ project
« Reply #4 on: February 13, 2019, 09:49:18 pm »
I have configured compiler tags as depicted in one of the pictures. When hitting ctrl-space on a. the completion suggestions are depicted in the other picture. As can be seen, not all methods on the string are shown.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2571
  • Hero Points: 386
Re: Finding stl tags in C++ project
« Reply #5 on: February 14, 2019, 05:22:02 pm »
Here's what I get:  SlickEdit 23.0.0, completely default configuration, hot fix 3 applied, selected GCC-7.3.0-x86_64-linux-gnu in quick start to build default C/C++ compiler tag file.

The picture is after hitting Ctrl+Space, resizing the list, and selecting "insert" from the list to check if member help came up.


guth

  • Community Member
  • Posts: 74
  • Hero Points: 6
Re: Finding stl tags in C++ project
« Reply #6 on: February 14, 2019, 07:19:15 pm »
I did some more investigation. It turns out that
Code: [Select]
string a;is looked up in some Python header. See first picture. If explicitly stating that std namespace shall be used, then it finds the members. See second picture. I also noticed that a string in an auto variable, as in third picture, does not give any completions.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2571
  • Hero Points: 386
Re: Finding stl tags in C++ project
« Reply #7 on: February 14, 2019, 08:23:10 pm »
The "auto" case works on my VM, so this is probably another similar case.  My guess is that if you did a Ctrl+Dot on make_shared<>, you would find two conflicting definitions.

My VM did not have the Python development headers installed, also no boost, so that explains the differences.

guth

  • Community Member
  • Posts: 74
  • Hero Points: 6
Re: Finding stl tags in C++ project
« Reply #8 on: February 15, 2019, 05:38:29 pm »
But if the file contains
Code: [Select]
using namespace std;could the lookup look there instead of in, e.g., the Python header? Or the lookup knows about which files are actually included, and then looks up tags in only those files.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2571
  • Hero Points: 386
Re: Finding stl tags in C++ project
« Reply #9 on: February 20, 2019, 03:10:00 pm »
The lookups do not depend on the include chain, for three reasons.  (1) it is usually a tangled mess and (2) context tagging needs to work even if you do not remember to #include a header, and (3) performance.