niosus / easyclangcomplete Goto Github PK
View Code? Open in Web Editor NEW:boom: Robust C/C++ code completion for Sublime Text 3/4
Home Page: https://niosus.github.io/EasyClangComplete/
License: MIT License
:boom: Robust C/C++ code completion for Sublime Text 3/4
Home Page: https://niosus.github.io/EasyClangComplete/
License: MIT License
I know it works because it works on all machines I installed it to, but there are no unit tests for this. I believe this needs to be fixed. The travis ci comes with a strange clang instalation, so maybe there will be some magic on how to find the library, so probably this relies on issue #22
With the fixing of #44 , I see libclang
being properly loaded. However, the first time I save a C++ source file after starting Sublime Text 3dev, the plugin host crashes:
error: plugin_host has exited unexpectedly, plugin functionality won't be available until Sublime Text has been restarted
I'm not sure if it happens with every source file, but I'm seeing it consistently on some large-ish source files I have. Nothing suspicious is showing up with "verbose": true
in the config.
For now the .clang_complete
file will be read only when opening a new file. I think it would be cool to read it a add its contents to the call to clang if it has changed after the last query when completing.
Hi,
I am very grateful to you for this plugin. I have the next question: how to add some include_dirs into *.sublime-project file? It is important because the folder structures with .h files are different from project to project.
For example, I recently create plugin which uses Cling binary for linting C, C++. So, in my *.sublime-project file the settings for plugin looks like this:
{
"folders":
[
{
"follow_symlinks": true,
"path": ".",
"file_exclude_patterns": [".tags", ".tags_sorted_by_file", ".gemtags"],
}
],
"settings":
{
"clanglinter_cmd_options":
[
"-I${project_path}/source",
"-I${project_path}/source/Common",
"-I${project_path}/source/DL",
"-I${project_path}/source/BL",
"-I${project_path}/source/HAL",
"-I${project_path}/source/HAL/src-STM32F3xx",
"-I${project_path}/source/HAL/src-STM32F3xx/PLib/CMSIS/CoreSupport",
"-I${project_path}/source/ThirdParty",
"-I${project_path}/source/UL",
"-DSTM32F334x8",
"-DUSE_STDPERIPH_DRIVER",
"-DARM_MATH_CM4",
"-DHSE_VALUE=8000000",
"-std=c99",
"-Wall",
"-IE:/soft/1-ready/sublimetext/GNU Tools ARM Embedded/arm-none-eabi/include",
]
}
}
@abadcafe has pointed out
And, I suggest you supply a new option
suppress_word_completion
. In the case ofautocomplete_all = true
, people (like me :p) usually don't like any word completions because the plugin can almost always supply more exact completions.
osx packages Apple LLVM libclang. It is hard to guess which llvm version is used underneath. For now version 3.5 is hardcoded and this is bad. We probably need a table to manage this.
This seems good enough: https://gist.github.com/yamaya/2924292
Is there any possiblilty that adding a 'read project-specific setting' feature before processing a file?
Maybe the project-specific setting file is a .clang_complete file as used by vim's clang_complete plugin.
EasyClangComplete can search up from the directory tree for the setting file. If it's found, use it to add parameters passed to clang.
There are many flavors of Linux out there. If you install libclang-3.6 on Ubuntu, you will get libclang-3.6.so.1
but not libclang.so
. Arch on the contrary will have libclang.so
but not the libclang-3.6.so.1
. I guess I can remove the clang folder and replace it by just one single modified cindex file that will handle searching for a correct version on the library.
When this plugin is enabled, is there a way to still have the default Sublime Text autocomplete for example for variable names?
The completion works fine on the default setup. But the log says
INFO:EasyClangComplete.EasyClangComplete: falling back to using clang in a subprocess.
I found out that on my system I have libclang.so, not libclang-3.8.so.1
After I changed it completion stopped working
INFO:EasyClangComplete.EasyClangComplete: init completer based on libclang
INFO:EasyClangComplete.plugin.completion.base_complete: Getting version from command: `clang++ --version`
INFO:EasyClangComplete.plugin.completion.base_complete: Found clang version: 3.8
WARNING:EasyClangComplete.plugin.completion.lib_complete: cannot get default cindex with error: No module named 'EasyClangComplete.clang.cindex'
WARNING:EasyClangComplete.plugin.completion.lib_complete: using bundled one: EasyClangComplete.clang.cindex38
DEBUG:EasyClangComplete.EasyClangComplete: on_activated_async view id 4
DEBUG:EasyClangComplete.EasyClangComplete: on_activated_async view id 18
DEBUG:EasyClangComplete.EasyClangComplete:init completer for view id: 18
DEBUG:EasyClangComplete.plugin.plugin_settings: populating include dirs with current variables:
DEBUG:EasyClangComplete.plugin.plugin_settings: project_base_name =
DEBUG:EasyClangComplete.plugin.plugin_settings: project_base_folder = /home/daniel/.config/sublime-text-3/Packages/EasyClangComplete
DEBUG:EasyClangComplete.plugin.plugin_settings: file_parent_folder = /home
DEBUG:EasyClangComplete.plugin.plugin_settings: include_dirs = ['/usr/include', '/home/daniel/.config/sublime-text-3/Packages/EasyClangComplete/src', '/usr/include/c++/6.1.1', '/usr/include/c++/6.1.1/x86_64-unknown-linux-gnu', '/usr/include/c++/6.1.1/backward', '/usr/local/include', '/usr/lib/clang/3.8.0/include', '/home/daniel']
DEBUG:EasyClangComplete.plugin.completion.lib_complete: searching for .clang_complete in /home/daniel up to /home/daniel/.config/sublime-text-3/Packages/EasyClangComplete
DEBUG:EasyClangComplete.plugin.completion.lib_complete: clang flags are: ['-std=gnu++1z', '-I/usr/include', '-I/home/daniel/.config/sublime-text-3/Packages/EasyClangComplete/src', '-I/usr/include/c++/6.1.1', '-I/usr/include/c++/6.1.1/x86_64-unknown-linux-gnu', '-I/usr/include/c++/6.1.1/backward', '-I/usr/local/include', '-I/usr/lib/clang/3.8.0/include', '-I/home/daniel']
DEBUG:EasyClangComplete.plugin.completion.lib_complete: compilation started for view id: 18
DEBUG:EasyClangComplete.plugin.completion.lib_complete: compilation done in 0.4559640884399414 seconds
DEBUG:EasyClangComplete.plugin.error_vis: generating error regions for view 18
DEBUG:root: adding error {'row': '20', 'file': '/home/daniel/test.cpp', 'col': '5', 'error': "unexpected namespace name 'std': expected expression"}
DEBUG:EasyClangComplete.plugin.error_vis: 1 error regions ready
DEBUG:EasyClangComplete.plugin.error_vis: showing error regions: [(325, 328)]
DEBUG:EasyClangComplete.EasyClangComplete: on_modified_async view id 18
DEBUG:EasyClangComplete.plugin.error_vis: erasing error regions for view 18
DEBUG:EasyClangComplete.EasyClangComplete: on_query_completions view id 18
DEBUG:EasyClangComplete.EasyClangComplete: starting async auto_complete at pos: 329
DEBUG:EasyClangComplete.plugin.completion.lib_complete: started code complete for view 18
DEBUG:EasyClangComplete.plugin.completion.lib_complete: no completions
Error highlighting on save mostly doesn't work.
It seems that cindex38.codeComplete returns None at line 2606 because ptr is False for some reason.
I have Sublime Text 3114, Arch linux and clang 3.8
even with verbose set to true people see no output in console. Moving it here from #4
Thanks for the plugin! It would be cool, if ECC could read the compile_commands.json file that cmake generates if you pass -DCMAKE_EXPORT_COMPILE_COMMANDS=ON.
In this file it lists all flags that where used for every file.
The compile_commands.json output looks like this:
[
{
"directory": "/Users/me/mytool",
"command": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DAVX2 -I/Users/me/repositories/mytool/src/commons -I/Users/me/repositories/mytool/src/util -I/Users/me/repositories/mytool/lib/getoptpp -march=native -mavx2 -mfpmath=sse -std=c++0x -m64 -pedantic -Wall -Wextra -Winline -Wdisabled-optimization -Wno-unused-parameter -stdlib=libc++ -O3 -DNDEBUG -march=native -mavx2 -mfpmath=sse -O3 -DNDEBUG -ffast-math -fno-exceptions -ftree-vectorize -fno-strict-aliasing -o src/CMakeFiles/mytool.dir/mytool.cpp.o -c /Users/me/repositories/mytool/src/mytool.cpp",
"file": "/Users/me/repositories/mytool/src/mytool.cpp"
}
...
]
For example, selecting method 'substr' of std::string gives this completion:
s.substr({#size_type _Off#})
The default python bindings are working with Python 3 only (ugh). There is no reason to try to find them. I should probably remove the warning to avoid confusion and just use the cindex
files that I provide with my package.
@simonhaenisch reported this:
This is what I get now when trying to trigger a completion for a Mat variable or doing cv:: (I shortened the full paths for the -I arguments). Somehow it can't get any completions for OpenCV (maybe I use the wrong include dir?)... I use another framework and for that most completions work.
Tracking this issue here.
Hi, I just noticed that sometimes I get warning like this:
WARNING:EasyClangComplete.plugin.completion.bin_complete: completion c:\users\user\appdata\local\temp\bl.c:3:10: fatal error: 'string.h' file not found did not match pattern <_sre.SRE_Pattern object at 0x03C65578>
So, I'm just interested in. Is EasyClangComplete really create copy of edited file into the user folder?
Sometimes clang binary fails to produce autocompletions like in issue #10
I guess it would be nice to show the errors. Just need to parse them with regex. Just like completions. Should be quite easy to do.
I've been looking into getting library mode working on OS X - and it actually seems to be working just fine almost out of the box!
I had to make one small change, as I'm not using the default clang/LLVM installation that ships with Xcode, but a Homebrew installation instead. The code for that can be found in Ventero@e79556c - from what I can tell, that snippet should work for all clang installations on OS X - including the default Xcode installation.
After applying that change, autocompletion and error highlighting worked just fine with most clang versions tested - only 3.8 segfaults somewhere inside libclang, so I guess there's some kind of mismatch between that version of cindex.py and the native library.
If you think the commit above makes sense, feel free to apply it.
I have the following EasyClangComplete.sublime-settings
set:
{
"clang_binary" : "/home/moconnor/Applications/gcc-4.8.2/bin/clang++",
"use_libclang" : true,
"triggers" : [ ".", "->", "::"],
"auto_set_sublime_triggers" : true,
"include_dirs":
[
"/home/moconnor/Applications/gcc-4.8.2/include/c++/4.8.2",
"/home/moconnor/Source/carte/llvm-carte/llvm-3.8.0/include",
"/home/moconnor/Source/carte/llvm-carte/llvm-3.8.0-bld/include",
"/home/moconnor/Source/carte/llvm-carte/carte++/include"
],
"std_flag" : "-std=c++11",
}
When I start Sublime Text 3dev, I get the following in the log:
INFO:EasyClangComplete.EasyClangComplete: init completer based on libclang
INFO:EasyClangComplete.plugin.completion.base_complete: Getting version from command: `/home/moconnor/Applications/gcc-4.8.2/bin/clang++ --version`
INFO:EasyClangComplete.plugin.completion.base_complete: Found clang version: 3.8
WARNING:EasyClangComplete.plugin.completion.lib_complete: cannot get default cindex with error: No module named 'clang'
WARNING:EasyClangComplete.plugin.completion.lib_complete: using bundled one: EasyClangComplete.clang.cindex38
ERROR:EasyClangComplete.plugin.completion.lib_complete: error: libclang.so.3.8: cannot open shared object file: No such file or directory. To provide a path to libclang use Config.set_library_path() or Config.set_library_file().
ERROR:EasyClangComplete.EasyClangComplete: cannot initialize completer with libclang.
INFO:EasyClangComplete.EasyClangComplete: falling back to using clang in a subprocess.
INFO:EasyClangComplete.EasyClangComplete: init completer based on clang from cmd
INFO:EasyClangComplete.plugin.completion.base_complete: Getting version from command: `/home/moconnor/Applications/gcc-4.8.2/bin/clang++ --version`
INFO:EasyClangComplete.plugin.completion.base_complete: Found clang version: 3.8
I am not sure why libclang
is not being found.
/home/moconnor/Applications/gcc-4.8.2/bin/clang++ -print-file-name=libclang.so
is returning the correct path of /home/moconnor/Applications/gcc-4.8.2/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../libclang.so
.
When I have "autocomplete_all" set to true and "hide_default_completions" set to false, if there are no Clang completions to be shown, default Sublime completions only get shown for a split second before disappearing. This is a huge pain because Clang misses a lot of symbols from the current file that I'd like to autocomplete.
When the libclang
cannot be found output the hints to the user into the console.
@pl-ca reported:
When I launch ST3 after installing the plug-in I get an error related to some file not found. Am I missing something?
reloading plugin test-complete-plugin.script
Traceback (most recent call last):
File "./python3.3/subprocess.py", line 1104, in _execute_child
FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 78, in reload_plugin
m = importlib.import_module(modulename)
File "./python3.3/importlib/__init__.py", line 90, in import_module
File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1022, in load_module
File "<frozen importlib._bootstrap>", line 1003, in load_module
File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 868, in _load_module
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "C:\Users\Pierre-Louis\AppData\Roaming\Sublime Text 3\Packages\test-complete-plugin\script.py", line 14, in <module>
clang_dir = ClangUtils.find_libclang_dir("clang++")
File "C:\Users\Pierre-Louis\AppData\Roaming\Sublime Text 3\Packages\test-complete-plugin\clang\utils.py", line 62, in find_libclang_dir
get_library_path_cmd).decode('utf8').strip()
File "./python3.3/subprocess.py", line 576, in check_output
File "./python3.3/subprocess.py", line 819, in __init__
File "./python3.3/subprocess.py", line 1110, in _execute_child
FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable
Moving here from #4
as described. After some time of usage std=c++11
flag gets appended multiple times, e.g.
clang++ -cc1 -fsyntax-only -x c++ -std=c++11 -std=c++11 -std=c++11 -code-completion-at ...
It should be easy to start. There are people that struggle to make it work. Make the process really easy!
from Reddit. Ksecutor wrote:
When trying to complete there is an error in console:
Traceback (most recent call last): File "C:\Soft\Sublime Text 3\sublime_plugin.py", line 333, in on_activated_async callback.on_activated_async(v) File "C:\Soft\Sublime Text 3\Data\Packages\EasyClangComplete\EasyClangComplete.py", line 97, in on_activated_async file_parent_folder=parent_folder) File "C:\Soft\Sublime Text 3\Data\Packages\EasyClangComplete\plugin\plugin_settings.py", line 242, in populate_include_dirs "(\$project_base_path)", self.project_base_folder, include_dir) File "./python3.3/re.py", line 170, in sub File "./python3.3/re.py", line 309, in _subx File "./python3.3/re.py", line 296, in _compile_repl File "./python3.3/sre_parse.py", line 801, in parse_template sre_constants.error: missing group name
When introducing error in c++ and autocompleting using clang binary an error occurs:
Exception in thread Thread-12:
Traceback (most recent call last):
File "./threading.py", line 901, in _bootstrap_inner
File "./threading.py", line 858, in run
File "C:\Users\%username%\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\plugin\clang_bin_complete.py", line 205, in complete
complete_results)
File "C:\Users\%username%\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\plugin\clang_bin_complete.py", line 270, in _process_completions
comp_dict = pos_search.groupdict()
AttributeError: 'NoneType' object has no attribute 'groupdict'
Moving it here from issue #4
If there is many tabs opened after some code has been written using libclang completion in them, there is going to be a bunch of translation units saved in memory. I think it is a good idea to free this memory after some time.
This isn't really an issue, rather a question. On Windows, when I answer the dialog with "Sure!", this is what is written into my user settings file:
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
},
{
"characters": ".>:",
"selector": "source.c++, source.c - string - comment - constant.numeric"
}
]
As I couldn't find this in the plugin code I assume that ST adds this by itself (don't know why this would be necessary).
BTW wouldn't it make sense to add the triggers to the syntax specific files for C and C++ rather than the main user settings? Would maybe be more sensible in the modular ST package way, but may be harder to find/configure for the user.
Tried this plugin for the first time. I immediately got this error:
INFO:EasyClangComplete.EasyClangComplete: init completer based on libclang
INFO:EasyClangComplete.plugin.completion.base_complete: Getting version from command: `clang.exe --version`
INFO:EasyClangComplete.plugin.completion.base_complete: Found clang version: 3.8
WARNING:EasyClangComplete.plugin.completion.lib_complete: cannot get default cindex with error: No module named 'clang'
WARNING:EasyClangComplete.plugin.completion.lib_complete: using bundled one: EasyClangComplete.clang.cindex38
Package Control: Skipping automatic upgrade, last run at 2016-06-06 19:40:41, next run at 2016-06-06 20:40:41 or after
Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 333, in on_activated_async
callback.on_activated_async(v)
File "C:\Users\jordan\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\EasyClangComplete.py", line 101, in on_activated_async
settings=settings)
File "C:\Users\jordan\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\plugin\completion\lib_complete.py", line 198, in init
error_vis.FORMAT_LIBCLANG)
File "C:\Users\jordan\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\plugin\error_vis.py", line 59, in generate
self.errors_from_tu_diag(view, errors)
File "C:\Users\jordan\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\plugin\error_vis.py", line 94, in errors_from_tu_diag
location = str(diag.location)
File "C:\Users\jordan\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\clang\cindex38.py", line 239, in __repr__
filename = self.file.name
File "C:\Users\jordan\AppData\Roaming\Sublime Text 3\Packages\EasyClangComplete\clang\cindex38.py", line 2644, in name
return conf.lib.clang_getCString(conf.lib.clang_getFileName(self)).decode ('utf-8')
OSError: exception: stack overflow
Exception OSError: 'exception: access violation writing 0x0000006489000000' in
You definitely cannot call constructor with dot operator.
MyObject obj; obj.MyObject();
have no sense.
Completion proposal for classes with multiple overloaded constructors are cluttered with them.
Hi, a lot of users uses C Improved plugin. But EasyClangComplete doesn't support this syntax. I have already tested it - you need just add it to the tools.py (line 103):
syntax_regex = re.compile("\/([^\/]+)\.(?:tmLanguage|sublime-syntax)")
valid_extensions = [".c", ".cc", ".cpp", ".cxx", ".h", ".hpp", ".hxx"]
valid_syntax = ["C", "C++", "C Improved"]
It would be nice if you change EasyClangComplete plugin behavior
from:
using raw Temp user folder for storing analyzed files
to:
create EasyClangComplete folder into Temp folder and using EasyClangComplete folder for storing analyzed files.
It increase stability and lets plugin avoid situation when there are some *.c or *.h files into Temp folder.
In case something is wrong with libclang
, use clang -cc1
for auto completion. It is slower, but seems to work independent of the system. This is a nice option to have and is a must until I figure out how to fix errors on Windows as described in issue #4
the plugin doesn't work, and the console shows this:
File "/opt/sublime_text/sublime_plugin.py", line 333, in on_activated_async
callback.on_activated_async(v)
File "ccomplete_plugin in /home/dvirsky/.config/sublime-text-3/Installed Packages/CComplete.sublime-package", line 194, in on_activated_async
File "ccomplete_plugin in /home/dvirsky/.config/sublime-text-3/Installed Packages/CComplete.sublime-package", line 63, in load
File "ccomplete_plugin in /home/dvirsky/.config/sublime-text-3/Installed Packages/CComplete.sublime-package", line 81, in getProjectPaths
File "./python3.3/posixpath.py", line 151, in dirname
AttributeError: 'NoneType' object has no attribute 'rfind'
When running on windows the plugin cannot find libclang with the error EasyClangComplete: function 'clang_CXXField_isMutable'
. Moving the discussions about this here from issue #1
There is an easy way to use libclang
to highlight errors. I think it would be cool to have it.
I haven't yet set up the include_dirs, which is the crux of the problem, but this is a bit onerous for the projects I'm working with and I'm not even seeing completions based on the default settings yet (i.e. from the h files in the file folder and its parent folder).
Here are my current user settings:
{
"std_flag" : "-std=c++03",
"auto_set_sublime_triggers" : false,
"auto_complete_triggers" :
[
{
"characters": ".:>",
"selector": "source.c++ - string - comment - constant.numeric"
}
]
}
On a related note, since my project has 4 folders, where does $project_base_path point to?
proj.sublime-project looks something like this:
{
"folders":
[
{
"path": "to/src"
},
{
"path": "to/other/src"
},
{
"path": "to/yet/another/src"
}
]
}
I'm hoping to coax EasyClangComplete to give me completions, but note that my projects are probably not clang compatible. I build them using VxWorks 6.4/6.8 that run modified versions of GCC 3.4.4/4.1.2.
Title says it all. Currently not supported. Should be.
Seems that something is not working properly if the package is installed as a zip. Need to investigate it. It probably will be better for users to have the plugin as a zip to save bandwidth.
Currently, the tests that I run on travis and appveyor are not verbose. They just say that something is wrong, but not what exactly is wrong. I need that info to understand why it cannot find libclang.
During EasyClangComplete plugin working, it prints different info into the console like this:
These info is unused majority of time and just spam into the console.
How I can disable it?
Also, is there a way how to disable static code linting (analyzing) in EasyClangComplete? (I use another Clang code analyzer for this and I don't want to load CPU for analyzing code with EasyClangComplete)
With the latest version I don't get any completions anymore on Windows (not libclang). I get this in console:
Traceback (most recent call last):
File "<ST3-Path>\sublime_plugin.py", line 231, in run_callback
expr()
File "<ST3-Path>\sublime_plugin.py", line 314, in <lambda>
run_callback('on_selection_modified', callback, lambda: callback.on_selection_modified(v))
File "<ST3-Packages-Path>\EasyClangComplete\EasyClangComplete.py", line 118, in on_selection_modified
completer.error_vis.show_popup_if_needed(view, row)
AttributeError: 'NoneType' object has no attribute 'error_vis'
And a few similar ones:
(...) EasyClangComplete.py", line 129, in on_modified_async
completer.error_vis.clear(view)
AttributeError: 'NoneType' object has no attribute 'error_vis'
(...) EasyClangComplete.py", line 94, in on_activated_async
if completer.exists_for_view(view.buffer_id()):
AttributeError: 'NoneType' object has no attribute 'exists_for_view'
(...) EasyClangComplete.py", line 175, in on_query_completions
if completer.async_completions_ready:
AttributeError: 'NoneType' object has no attribute 'async_completions_ready'
Hi @niosus , I have installed the plug-in from package control and after configuring my includes I get the following errors on the console, which seems to come from the fact that completer
is not initialized. I set verbose true
but it seems to fail before it has the change to print anything. These errors happen as soon as I click anywhere or type anything. Any idea?
Traceback (most recent call last):
File "/opt/sublime_text_3/sublime_plugin.py", line 333, in on_activated_async
callback.on_activated_async(v)
File "/home/plca/.config/sublime-text-3/Packages/EasyClangComplete/EasyClangComplete.py", line 88, in on_activated_async
if completer.exists_for_view(view.id()):
AttributeError: 'NoneType' object has no attribute 'exists_for_view'
Traceback (most recent call last):
File "/opt/sublime_text_3/sublime_plugin.py", line 333, in on_activated_async
callback.on_activated_async(v)
File "/home/plca/.config/sublime-text-3/Packages/EasyClangComplete/EasyClangComplete.py", line 88, in on_activated_async
if completer.exists_for_view(view.id()):
AttributeError: 'NoneType' object has no attribute 'exists_for_view'
Traceback (most recent call last):
File "/opt/sublime_text_3/sublime_plugin.py", line 231, in run_callback
expr()
File "/opt/sublime_text_3/sublime_plugin.py", line 314, in <lambda>
run_callback('on_selection_modified', callback, lambda: callback.on_selection_modified(v))
File "/home/plca/.config/sublime-text-3/Packages/EasyClangComplete/EasyClangComplete.py", line 111, in on_selection_modified
completer.error_vis.show_popup_if_needed(view, row)
AttributeError: 'NoneType' object has no attribute 'error_vis'
It maybe will be useful to use clang-cl
for microsoft c++ compatibility. Need to check this.
The autocompletion is not working. But, the highlight works.
My configuration :
Log :
reloading plugin EasyClangComplete.EasyClangComplete
plugins loaded
INFO:EasyClangComplete.EasyClangComplete: init completer based on libclang
INFO:EasyClangComplete.plugin.completion.base_complete: Getting version from command:clang++ --version
INFO:EasyClangComplete.plugin.completion.base_complete: Found clang version: 3.6
WARNING:EasyClangComplete.plugin.completion.lib_complete: cannot get default cindex with error: No module named 'clang'
WARNING:EasyClangComplete.plugin.completion.lib_complete: using bundled one: EasyClangComplete.clang.cindex36
I've followed the instructions, and installed the packages 'clang' and 'python-clang-3.4' (Ubuntu 14.04). But it seems like I've missed something because the plugin fails to find 'clang' python bindings.
The error I get in Sublime's console is:
INFO:EasyClangComplete.EasyClangComplete: init completer based on libclang
INFO:EasyClangComplete.plugin.completion.base_complete: Getting version from command: `clang++ --version`
INFO:EasyClangComplete.plugin.completion.base_complete: Found clang version: 3.4
WARNING:EasyClangComplete.plugin.completion.lib_complete: cannot get default cindex with error: No module named 'clang'
WARNING:EasyClangComplete.plugin.completion.lib_complete: using bundled one: EasyClangComplete.clang.cindex34
However, i'm able to import the allegedly missing library manually when executing python interpreter from the terminal. I'm pretty sure it is due to the fact that Sublime runs python3, and the python bindings are installed under /usr/lib/python2.7/dist-packages/clang/
... I tried to find an official python3 package for the python bindings without success.
The README file of this plugin states that the python bindings are working fine on Ubuntu, so I'm pretty sure i did something wrong. Can you give me a hand?
Thanks ahead
Many people miss the setting where they need to configure sublime text triggers. This step is crucial to get autocompletion working.
Hi, I have noticed that EasyClangComplete automatically adds few settings into the sublime user settings. When I try to remove this new section of settings - all ok, but when I start using EasyClangComplete - this section of settings came up into user settings again.
This behavior is unacceptable. Could you please fix this bug?
EasyClangComplete adds "auto_complete_triggers" section into the user settings:
"auto_complete_triggers":
[
{
"characters": "<",
"selector": "text.html"
},
{
"characters": ".>:",
"selector": "source.c++, source.c - string - comment - constant.numeric"
}
],
This is my EasyClangComplete settings:
{
"use_libclang" : false,
"autocomplete_all" : true,
"search_clang_complete_file": false,
"errors_on_save": false,
}
If I wanted to do something like
struct Foo f = {};
This plugin doesn't give any autocompletions for the struct name.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.