Author Topic: Tagging does not work for Visual Studio 2017 C++ Standard Library headers  (Read 865 times)

sigmund

  • Community Member
  • Posts: 50
  • Hero Points: 5
Here is some example code:
Code: [Select]

#include "stdafx.h"

#include <iostream>
#include <string>

int main()
{
    std::string name;
    name.push_back('a');
    name.

    std::cout << name << std::endl;

    return 0;
}

When I enter the dot after "name", then no Symbols list is displayed.  If I try to hit Ctrl+Space after the dot, then SlickEdit displays this message: Unable to located definition of expression type: ''

If I hit Ctrl+. (push-tag) when the cursor is above the "push_back" member function, then I get the list of symbols shown in the attached image "SelectSymbol.png".

The Compiler Configuration Tag Files look fine (and I have rebuilt them), see attached images "TagFiles1.png" and "TagFiles2.png".

If I profile the Ctrl+Space when the cursor is after "name.", then I get the result in the attached file "profile.tsv".

Here is my "About SlickEdit" output:
Code: [Select]
SlickEdit Pro 2017 (v22.0.2.1 64-bit)

Serial number: WB943076
Licensed number of users: Single user
License file: C:\ProgramData\slickedit\22\slickedit.lic

Build Date: May 22, 2018
Emulation: CUA

OS: Windows 10 x64
OS Version: 10.00.0 
Memory: 29% Load, 9690MB/32648MB Physical, 11316MB/37512MB Page File, 932MB/134217727MB Virtual
Shell Information: C:\tools\JPSoft\TCMD22\tcc.exe /LD /LH
Screen Size: 1920 x 1080, 1920 x 1080

Project Type: Microsoft Visual Studio Visual C++
Language: .cpp (C/C++)
Encoding: Automatic

Installation Directory: C:\Program Files\SlickEdit Pro 22.0.2\ (non-removable drive,NTFS,350332MB free)
Configuration Directory: C:\Users\VikS\Documents\My SlickEdit Config\22.0.2\ (non-removable drive,NTFS,350332MB free)

Hotfixes:
C:\Users\VikS\Documents\My SlickEdit Config\22.0.2\hotfixes\hotfix_se2202_6_cumulative.zip (Revision: 6)

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2504
  • Hero Points: 363
We are making a number of (somewhat overdue) C++11 and C++14 fixes for our context tagging for the next release.

In the meantime, you can work around this problem by defining the following preprocessing (which is new with Visual Studio 2017).

Document > C/C++ Options > C/C++ Preprocessing > New...

_STL_DISABLE_CLANG_WARNINGS
_HAS_CXX17 0

I'll add these for the next rev of the 22.0.2 hot fix.
« Last Edit: May 24, 2018, 04:22:49 pm by Dennis »

sigmund

  • Community Member
  • Posts: 50
  • Hero Points: 5
Unfortunately this did not change anything.

I have attached a screen shot of my C/C++ Processing options, and I rebuilt the "C/C++ Compiler Configuration Tag Files" ("C:\Users\VikS\Documents\My SlickEdit Config\22.0.2\tagfiles\Visual Studio 2017.vtg") after making the suggested modifications.

Any other ideas?

sigmund

  • Community Member
  • Posts: 50
  • Hero Points: 5
Quote
We are making a number of (somewhat overdue) C++11 and C++14 fixes for our context tagging for the next release.

Did you ever consider using Clang AST to help with context tagging and color coding?  Judging from the lack of replies from SlickEdit team members in this thread (https://community.slickedit.com/index.php/topic,14541.msg45216.html) and based on this answer (https://community.slickedit.com/index.php/topic,15838.msg61417.html#msg61417), my guess would be no..

I am actually afraid to show other people that I code in SlickEdit because I never know when it decides to spend a second or two (or more!) to figure out some context tagging or color coding.  At the same time I *do* feel productive using SlickEdit, but it could be so much better!

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2504
  • Hero Points: 363
I am surprised that did not fix anything.  Just those two changes made all the difference on my Windows 10 box with VS 2017.  So you are saying that your original example still does not work?

Could you do this as a diagnostic for me?  Open your original example, put the cursor after "name." and then from the slickedit command line, run the command "say something", followed by "codehelp-trace-list-symbols".  (The first 'say' is just to activate the debug window).  The put focus on the debug window and type Ctrl+X.  Paste the result into a text file and attach it to a reply here.

Also, if possible, could you attach your "string" header from from your Visual Studio 2017 distro.  Maybe there is a difference in yours, different version of the SDK or something.


sigmund

  • Community Member
  • Posts: 50
  • Hero Points: 5
My original example does still not work.

I have attached the diagnostic output in "codehelp-trace-list-symbols.txt" as well as the "string" header located here:
Code: [Select]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\include\string

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2504
  • Hero Points: 363
Looked at the log, and found this:
Code: [Select]
:   :   :   :   :   :   :   :   :   :   :   :   :   //=================================================================
:   :   :   :   :   :   :   :   :   :   :   :   :   // Browse info from _c_get_type_of_matches: i=1
:   :   :   :   :   :   :   :   :   :   :   :   :   //=================================================================
:   :   :   :   :   :   :   :   :   :   :   :   :   cm.member_name=std
:   :   :   :   :   :   :   :   :   :   :   :   :   cm.class_name=
:   :   :   :   :   :   :   :   :   :   :   :   :   cm.type_name=gvar
:   :   :   :   :   :   :   :   :   :   :   :   :   cm.flags=macro
:   :   :   :   :   :   :   :   :   :   :   :   :   cm.file_name=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.14.26428\INCLUDE\array
:   :   :   :   :   :   :   :   :   :   :   :   :   cm.line_no=13
:   :   :   :   :   :   :   :   :   :   :   :   :   cm.seekpos=0
:   :   :   :   :   :   :   :   :   :   :   :   :   cm.language=c
:   :   :   :   :   :   :   :   :   :   :   :   :   cm.tag_database=C:\Users\VikS\Documents\My SlickEdit Config\22.0.2\tagfiles\Visual Studio 2017.vtg
:   :   :   :   :   :   :   :   :   :   :   :   :   [b]cm.return_type=_STL_DISABLE_CLANG_WARNINGS[/b]

This means that the tag file wasn't rebuilt correctly.  Rebuild your Visual Studio 2017 again in the following manner:

  • Tools > Tag Files... > C/C++ Compiler Configuration Tag Files
  • Select the "Visual Studio 2017.vtg" tag file.
  • Click Rebuild Tag File...
  • Uncheck "Retag modified files only"
  • Uncheck "Retag files in background when possible"

When you added preprocessing defines, it changed settings for SlickEdit, but none of the Visual Studio files changed, so what probably happened when you did a rebuild was a no-op, because none of the files appeared to have changed.

Also, the only reason I'm having you uncheck background tagging is so that you are forced to wait to try your test case until after the tag file is completely rebuilt.

sigmund

  • Community Member
  • Posts: 50
  • Hero Points: 5
Yes, I'm pretty sure I forgot to uncheck "Retag modified files only".  Tagging works now :D

codehelp-complete also works, but it is very slow.  Hitting Ctrl+space after typing "name.p" makes SlickEdit freeze for 6-7 seconds.

Cheers!

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2504
  • Hero Points: 363
Reproduced.  Something is definately trying to hard.  I'll see if I can do something about that for the next release.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2504
  • Hero Points: 363
I am attaching an experimental hot fix (in the form of a replacement tagsdb.dll for 64-bit windows).  Let me know if this improves the performance with STL tagging for you adequately.

You can install it by running SlickEdit as administrator and loading the hot fix (actually, this is the hard way).

Or you can back up your original tagsdb.dll from your SlickEdit installation directory, and extract tagsdb.dll from the zip file to replace the original under \win.

sigmund

  • Community Member
  • Posts: 50
  • Hero Points: 5
This completely fixed the codehelp-complete performance problem, thank you :D

sigmund

  • Community Member
  • Posts: 50
  • Hero Points: 5
I spoke too soon.  codehelp-complete can still take up to 3-4 seconds in the example above when hitting Ctrl+Space after "name.".  I expected the symbols list to automatically be displayed after typing "name.", but that is not the case..

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2504
  • Hero Points: 363
I am putting in even more performance improvements for the next release to help with cases like this one.