Home Download Buy Blog Forum Support

clang (C/C++/Objective-C/Objective-C++) autocomplete

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby quarnster on Sun May 06, 2012 11:15 am

I've opened an issue for this on the SublimeClang homepage: https://github.com/quarnster/SublimeClang/issues/54

BTW, you can toggle the plugin on and off via the default keybinding alt+d,alt+t.
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby quarnster on Sun May 06, 2012 12:49 pm

This has now been fixed.
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby chc on Sun May 06, 2012 1:45 pm

Great! Thanks for the super quick fix!
chc
 
Posts: 2
Joined: Sun May 06, 2012 10:42 am

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby Gator on Sat Jun 02, 2012 3:20 am

I've been reading through this thread and am still wondering if there is a definitive answer on whether or not clang autocomplete works properly on Windows 64 Sublime 2 using MinGW for C++ STL. I have the following in my User Options for SublimeClang:

Code: Select all
{
    "options":
    [
        "-Wall",
        "-IC:\\MinGW\\include",
        "-IC:\\MinGW\\lib",
        "-IC:\\MinGW\\lib\\gcc\\mingw32\\4.6.2\\include\\c++",
        "-IC:\\MinGW\\lib\\gcc\\mingw32\\4.6.2\\include\\c++\\mingw32"
    ]
}


and while it looks like the plugin is doing something, I keep getting the following error:

C:\MinGW\include\wchar.h:26,10 - Fatal - 'stddef.h' file not found

stddef.h is sitting in C:\MinGW\lib\gcc\mingw32\4.6.2\include and when I alter the options to include that directory, the previous error goes and I am confronted with:

C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++\cwchar:145,11 - Error - no member named 'fgetws' in the global namespace
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++\cwchar:147,11 - Error - no member named 'fputws' in the global namespace
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++\cwchar:151,11 - Error - no member named 'getwc' in the global namespace
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++\cwchar:152,11 - Error - no member named 'getwchar' in the global namespace
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++\cwchar:157,11 - Error - no member named 'putwc' in the global namespace
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++\cwchar:158,11 - Error - no member named 'putwchar' in the global namespace
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++\bits/basic_ios.h:249,26 - Error - expected ')'
C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++\bits/basic_ios.h:249,17 - Note - to match this '('

Any suggestions would be greatly appreciated.
Gator
 
Posts: 1
Joined: Sat Jun 02, 2012 3:10 am

Sublime crash w/Clang plugin

Postby RyanJ on Thu Jun 21, 2012 7:26 pm

I've found a problem that if in my sublimeclang_options I include a directory with a large number of files (1249 to be exact), sublime crashes with the following error:

Image

I happen to have VS10 installed, and this is the assertion in question:
Code: Select all
_Myiter& operator++()
      {   // preincrement
#if _ITERATOR_DEBUG_LEVEL == 2
      if (this->_Getcont() == 0
         || this->_Ptr == 0
         || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
         {   // report error
         _DEBUG_ERROR("vector iterator not incrementable");
         _SCL_SECURE_OUT_OF_RANGE;
         }


The Sublime console shows the following after the crash:
Code: Select all
Exception AttributeError: "Cache instance has no attribute 'cache'" in <bound method Cache.__del__ of <translationunitcache.Cache instance at 0x000000000552F808>> ignored
Traceback (most recent call last):
  File ".\common.py", line 173, in worker
  File ".\translationunitcache.py", line 723, in task_reparse
  File ".\translationunitcache.py", line 849, in get_translation_unit
  File ".\translationunitcache.py", line 640, in __init__
  File ".\translationunitcache.py", line 108, in __init__
WindowsError: [Error -2147483645] One or more arguments are invalid


Sublime itself doesn't crash until I click 'abort', so I'm actually guessing the assertion is actually in libclang.dll.
This is with ST 2181 (Windows obviously).

Thanks.
RyanJ
 
Posts: 18
Joined: Mon Sep 26, 2011 1:59 pm

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby quarnster on Thu Jun 21, 2012 7:35 pm

I've opened up a new issue on github for this. Is your code base shareable so that I can get a copy of what you are seeing? If not, do you have a small test where this reproduces? Otherwise it's unlikely to be fixed from my side as I don't code on Windows and it's not something I've seen from my limited testing on Windows.
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby RyanJ on Fri Jun 22, 2012 3:22 pm

Thanks. I'm not able to share the codebase I'm working on, but I'll try to reproduce the problem with test code. Barring that, I can help debug it a bit for you if you have some things you'd like me to try.
RyanJ
 
Posts: 18
Joined: Mon Sep 26, 2011 1:59 pm

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby sublimator on Sat Jun 23, 2012 1:26 am

I had a quick play with this yesterday on windows and was getting lockups

I seem to recall reading that clang hardcodes visual studio/mingw paths?

Does anyone know if it's possible to steer it towards sources on a linux vm?
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby quarnster on Sat Jun 23, 2012 7:54 pm

castles_made_of_sand, if your lockups are the same as RyanJ's then maybe it has been fixed now. You could disable all the standard includes via "-nostdinc". As long as the vm sources are available as a windows file path you should be able to steer it that way.

RyanJ, I think your issue has been fixed. As issue 74 hasn't been fixed yet, could you use package control to remove SublimeClang, quit Sublime Text 2, delete the SublimeClang package folder and then re-install it via Package Control and see if the issue is gone now please?
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: clang (C/C++/Objective-C/Objective-C++) autocomplete

Postby sublimator on Sun Jun 24, 2012 2:03 am

You could disable all the standard includes via "-nostdinc". As long as the vm sources are available as a windows file path you should be able to steer it that way.


Awesome :) Thanks. I'll give it a crack.
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: Majestic-12 [Bot] and 8 guests