Closed directorscut82 closed 6 years ago
So, just to be sure. You have restarted sublime text after having this error, right?
Also, does this happen only with clang 4.0? Can you try it with an older version, like clang 3.8?
tried with clang3.8 (which is the default for ubuntu 16.04) and it works ..
Dont know if its relevant with this, but c functions are autocompleted only with "autocomplete_all" : true. Using the default [alt+/] after a function name does not trigger the engine('no available completion')
Your error looks like one that occurs if you change settings or update/install the plugin and do not restart the sublime text. Try switching back to clang 4.0 and restart sublime text. Also, I removed your log, as this contains no valuable information.
In case something still doesn't work, I will need full log. Please restart sublime text, open a file, try to compile something, copy everything from the console here. Also, to make the output readable here, please use fenced code block syntax in markdown
Closing for the lack of activity. Please try using clang 4.0 and reopen if you have more information.
Hello, i have reproduced it again (both with my desktop & laptop)
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.tools: Getting version from command: `clang++ -v`
INFO:EasyClangComplete.plugin.tools: Found clang version: 3.8.0
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
ERROR:EasyClangComplete.plugin.completion.lib_complete: error while compiling: Error parsing translation unit.
ERROR:concurrent.futures:exception calling callback for <Future at 0x7fe8e90ac690 state=finished raised AttributeError>
Traceback (most recent call last):
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/view_config.py", line 349, in load_for_view
config = ViewConfig(view, settings)
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/view_config.py", line 66, in __init__
self.completer.update(view, settings)
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/completion/lib_complete.py", line 298, in update
if self.tu.cursor.displayname != view.file_name():
AttributeError: 'NoneType' object has no attribute 'cursor'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./python3.3/concurrent/futures/_base.py", line 296, in _invoke_callbacks
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/EasyClangComplete.py", line 260, in config_updated
log.debug(" updated config: %s", future.result())
File "./python3.3/concurrent/futures/_base.py", line 394, in result
File "./python3.3/concurrent/futures/_base.py", line 353, in __get_result
File "./python3.3/concurrent/futures/thread.py", line 54, in run
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/view_config.py", line 364, in load_for_view
e.msg)
AttributeError: 'AttributeError' object has no attribute 'msg'
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
ERROR:EasyClangComplete.plugin.completion.lib_complete: error while compiling: Error parsing translation unit.
ERROR:concurrent.futures:exception calling callback for <Future at 0x7fe8e015de50 state=finished raised AttributeError>
Traceback (most recent call last):
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/view_config.py", line 349, in load_for_view
config = ViewConfig(view, settings)
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/view_config.py", line 66, in __init__
self.completer.update(view, settings)
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/completion/lib_complete.py", line 298, in update
if self.tu.cursor.displayname != view.file_name():
AttributeError: 'NoneType' object has no attribute 'cursor'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./python3.3/concurrent/futures/_base.py", line 296, in _invoke_callbacks
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/EasyClangComplete.py", line 260, in config_updated
log.debug(" updated config: %s", future.result())
File "./python3.3/concurrent/futures/_base.py", line 394, in result
File "./python3.3/concurrent/futures/_base.py", line 353, in __get_result
File "./python3.3/concurrent/futures/thread.py", line 54, in run
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/view_config.py", line 364, in load_for_view
e.msg)
AttributeError: 'AttributeError' object has no attribute 'msg'```
I understood this happens with clang 3.8. Please, try to reproduce it with 4.0
Below the log for clang4.0 version (installed from the default ubuntu 16.04x64 repo); i believe its the same kind of error:
`plugins loaded
DEBUG:EasyClangComplete.plugin.settings.settings_storage: Reading settings...
DEBUG:EasyClangComplete.plugin.settings.settings_storage: autocomplete_all <-- 'False'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: c_flags <-- '['-std=c11']'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: clang_binary <-- 'clang++-4.0'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: common_flags <-- '['-I/usr/include', '-I$project_base_path/src', '-I/usr/lib/clang/$clang_version/include']'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: cpp_flags <-- '['-std=c++11']'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: use_libclang_caching <-- 'True'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: errors_on_save <-- 'True'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: flags_sources <-- '[{'file': 'CMakeLists.txt'}, {'file': 'compile_commands.json'}, {'file': '.clang_complete'}]'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: hide_default_completions <-- 'False'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: include_file_folder <-- 'True'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: include_file_parent_folder <-- 'True'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: max_cache_age <-- '00:30:00'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: triggers <-- '['.', '->', '::']'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: use_libclang <-- 'True'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: verbose <-- 'False'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: show_type_info <-- 'True'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: libclang_path <-- '<some_path_here>'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: progress_style <-- 'Moon'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: Settings sucessfully read...
INFO:EasyClangComplete.plugin.tools: Getting version from command: clang++-4.0 -v
INFO:EasyClangComplete.plugin.tools: Found clang version: 4.0.1
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.clang.utils: found libclang library file: '/usr/lib/x86_64-linux-gnu/libclang-4.0.so'
ERROR:EasyClangComplete.plugin.completion.lib_complete: error while compiling: Error parsing translation unit.
ERROR:concurrent.futures:exception calling callback for <Future at 0x7ff4cb65e450 state=finished raised AttributeError>
Traceback (most recent call last):
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/view_config.py", line 349, in load_for_view
config = ViewConfig(view, settings)
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/view_config.py", line 66, in __init__
self.completer.update(view, settings)
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/completion/lib_complete.py", line 298, in update
if self.tu.cursor.displayname != view.file_name():
AttributeError: 'NoneType' object has no attribute 'cursor'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./python3.3/concurrent/futures/_base.py", line 296, in _invoke_callbacks
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/EasyClangComplete.py", line 260, in config_updated
log.debug(" updated config: %s", future.result())
File "./python3.3/concurrent/futures/_base.py", line 394, in result
File "./python3.3/concurrent/futures/_base.py", line 353, in __get_result
File "./python3.3/concurrent/futures/thread.py", line 54, in run
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/view_config.py", line 364, in load_for_view
e.msg)
AttributeError: 'AttributeError' object has no attribute 'msg'
Package Control: Skipping automatic upgrade, last run at 2017-05-18 12:24:23, next run at 2017-05-18 13:24:23 or after`
also the (almost same kind of) message is triggered every time the plugin tries to complete something:
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
ERROR:EasyClangComplete.plugin.completion.lib_complete: error while compiling: Error parsing translation unit.
ERROR:concurrent.futures:exception calling callback for <Future at 0x7ff4cbd294d0 state=finished raised AttributeError>
Traceback (most recent call last):
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/view_config.py", line 349, in load_for_view
config = ViewConfig(view, settings)
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/view_config.py", line 66, in __init__
self.completer.update(view, settings)
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/completion/lib_complete.py", line 298, in update
if self.tu.cursor.displayname != view.file_name():
AttributeError: 'NoneType' object has no attribute 'cursor'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./python3.3/concurrent/futures/_base.py", line 296, in _invoke_callbacks
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/EasyClangComplete.py", line 260, in config_updated
log.debug(" updated config: %s", future.result())
File "./python3.3/concurrent/futures/_base.py", line 394, in result
File "./python3.3/concurrent/futures/_base.py", line 353, in __get_result
File "./python3.3/concurrent/futures/thread.py", line 54, in run
File "/home/ekt/.config/sublime-text-3/Packages/EasyClangComplete/plugin/view_config.py", line 364, in load_for_view
e.msg)
AttributeError: 'AttributeError' object has no attribute 'msg'
This is very strange. I will try to find out what could cause this...
As a side note, please enclose big chunks of code into code braces as shown here: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code
Ok, so the issue is that libclang cannot handle something you throw at it and the translation unit cannot be parsed. On our side we should be able to not crash the plugin at least, but there is nothing we can do here to actually get your code to autocomplete for this translation unit.
Unfortunately, it doesn't seem like a problem of this plugin, but rather something that libclang cannot handle :(
Is it a big project? Are you using compile_commands.json
for it? Can you share your configuration? There is some flag in your parameters that breaks libclang here.
As a reference, see #192 There was a similar problem to yours there.
It is a medium to large project. I do use a compile_commands.json which works fine with ycmd (vim) and deoplete2 (nvim). The .json is created through bear (https://github.com/rizsotto/Bear) & never had any problems.
(item from compile_commands)
.
.
.
{
"arguments": [
"cc",
"-c",
"--sysroot=/home/ekt/.gu/platforms/ali/gcc_toolchain/arm-none-linux-gnueabi/libc",
"-I/home/ekt/Development/piper_git/piper/clients/ip4tv/linux/ali3921",
"-I/home/ekt/Development/piper_git/piper/src/generic/media_parsers/h/",
"-I/home/ekt/Development/piper_git/piper/src/generic/upnp/h/",
"-I/home/ekt/Development/piper_git/piper/src/generic/players/h/",
"-I/home/ekt/Development/piper_git/piper/src/generic/components/h/",
"-I/home/ekt/Development/piper_git/piper/src/generic/playlists/h/",
"-I/home/ekt/Development/piper_git/piper/src/generic/protocols/h/",
"-I/home/ekt/Development/piper_git/piper/src/generic/readers/h/",
"-I/home/ekt/Development/piper_git/piper/src/generic/playlists/h/",
"-I/home/ekt/Development/piper_git/piper/src/generic/drm/h/",
"-I/home/ekt/Development/piper_git/piper/src/generic/core/h/",
"-I/home/ekt/Development/piper_git/piper/src/generic/media_mgr/h/",
"-I/home/ekt/Development/piper_git/piper/src/generic/subtitles/h/",
"-I/home/ekt/Development/piper_git/piper/src/chipsets/linux/common/h/",
"-I/home/ekt/Development/piper_git/piper/libraries/chipsets/linux/ali3921/upnp/upnp-1.6.6/debug/include/",
"-I/home/ekt/Development/piper_git/piper/libraries/chipsets/linux/ali3921/expat/expat-2.0.1/debug/include",
"-I/home/ekt/Development/piper_git/piper/libraries/chipsets/linux/ali3921/scew/scew-1.1.6/debug/include",
"-I/home/ekt/Development/piper_git/piper/libraries/chipsets/linux/ali3921/curl/curl-7.21.2/debug/include",
"-I/home/ekt/Development/piper_git/piper/libraries/chipsets/linux/ali3921/openssl/openssl-1.0.2g/debug/include",
"-I/home/ekt/Development/piper_git/piper/libraries/chipsets/linux/ali3921/ffmpeg/ffmpeg-3.1.3/debug/include",
"-I/opt/ali_fs/usr/include/hal",
"-I/opt/ali_fs/usr/include/libxml2",
"-I/opt/ali_fs/usr/include/playready",
"-I/home/ekt/Development/piper_git/piper/libraries/proprietary/qarva/RRLA_Trial_MPF_full/include",
"-I/opt/ali_fs/usr/include/aui",
"-I/home/ekt/Development/piper_git/piper/src/chipsets/linux/ali3921/h/",
"-Wall",
"-Wno-unused-function",
"-Wno-unused-but-set-variable",
"-D_REENTRANT",
"-DWITH_THREADS=1",
"-D_LARGEFILE_SOURCE",
"-D_FILE_OFFSET_BITS=64",
"-fgnu89-inline",
"-fPIC",
"-D_GNU_SOURCE",
"-shared-libgcc",
"-std=gnu99",
"-mthumb-interwork",
"-mthumb",
"-DPLAYER_HW_PLATFORM=\"ALI_3733\"",
"-DFFMPEG_VERSION_3_1_3",
"-ggdb",
"-O0",
"-fPIC",
"-DPIPER_DEBUG_BUILD",
"-Wno-cpp",
"-o",
"/home/ekt/Builds/ip4tv/linux/ali3921/obj/av_renderer.o",
"../../../../src/chipsets/linux/ali3921/c/av_renderer.c"
],
"directory": "/home/ekt/Development/piper_git/piper/clients/ip4tv/linux/ali3921",
"file": "../../../../src/chipsets/linux/ali3921/c/av_renderer.c"
},
.
.
.
Hmmmm... I think I have an idea. CMake generates compilation database where there is no "arguments" entry, but a single "command"
entry. We parse it in this line of code. This is definitely an issue here, but I wonder why it fails to parse the translation unit then.
I will try to play around with Bear and see if I can break it on a small project.
The most frustrating thing is that the first time(s) i used this plugin it worked! Only after some(?) updates things got broken; that was the reason i initially commented on a closed issue. Anyway, will try with fresh installations with older versions again just to confirm.
Yeah, I feel your pain. Sorry for that experience. It is hard to nail all the things down and provide a seamless experience with so many different tools and styles that people use around. :(
It goes without saying that i am very grateful for the effort (of a very very thorny subject as autocompletion)
Ok, @directorscut82 so as described in the pull request, I have implemented proper parsing of compilation database with "arguments" entry as generated by Bear. It should work now, but please reopen if it doesn't.
thanks;) it is working again!
Hello again:) I got again the same error; i use bear from official ubuntu repo (16.04x64) for creating compile commands + latest sublime #3154.
plugins loaded
DEBUG:EasyClangComplete.plugin.settings.settings_storage: Reading settings...
DEBUG:EasyClangComplete.plugin.settings.settings_storage: autocomplete_all <-- 'False'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: c_flags <-- '['-std=c11']'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: clang_binary <-- 'clang++'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: common_flags <-- '['-I/usr/include', '-I$project_base_path/src', '-I/usr/lib/clang/$clang_version/include']'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: cpp_flags <-- '['-std=c++11']'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: use_libclang_caching <-- 'True'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: flags_sources <-- '[{'file': 'CMakeLists.txt'}, {'file': 'compile_commands.json'}, {'file': '.clang_complete'}]'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: hide_default_completions <-- 'False'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: include_file_folder <-- 'True'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: include_file_parent_folder <-- 'True'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: max_cache_age <-- '00:30:00'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: objective_c_flags <-- '['-std=c11']'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: objective_cpp_flags <-- '['-std=c++11']'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: triggers <-- '['.', '->', '::', ' ', '\t', '(', '[']'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: use_libclang <-- 'True'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: verbose <-- 'True'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: show_type_info <-- 'False'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: libclang_path <-- '<some_path_here>'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: errors_style <-- 'popups'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: progress_style <-- 'Moon'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: Settings sucessfully read...
DEBUG:EasyClangComplete.plugin.tools: file has valid syntax: `C`
DEBUG:EasyClangComplete.EasyClangComplete: on_activated_async view id 27
DEBUG:EasyClangComplete.plugin.settings.settings_manager: no settings for view 27. Reinitializing.
DEBUG:EasyClangComplete.plugin.tools: file has valid syntax: `C`
DEBUG:EasyClangComplete.plugin.settings.settings_storage: Overriding settings by project ones if needed:
DEBUG:EasyClangComplete.plugin.settings.settings_storage: Valid prefixes: ['ecc_', 'easy_clang_complete_']
DEBUG:EasyClangComplete.plugin.settings.settings_storage: Reading settings...
DEBUG:EasyClangComplete.plugin.settings.settings_storage: Settings sucessfully read...
INFO:EasyClangComplete.plugin.tools: Getting version from command: `clang++ -v`
INFO:EasyClangComplete.plugin.tools: Found clang version: 3.8.0
DEBUG:EasyClangComplete.plugin.settings.settings_storage: populating common_flags with current variables.
DEBUG:EasyClangComplete.plugin.settings.settings_storage: populated '-I$project_base_path/src' to '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/src'
DEBUG:EasyClangComplete.plugin.settings.settings_storage: populated '-I/usr/lib/clang/$clang_version/include' to '-I/usr/lib/clang/3.8.0/include'
DEBUG:EasyClangComplete.plugin.settings.settings_manager: settings initialized for view: 27
DEBUG:EasyClangComplete.plugin.utils.thread_pool:submitting job: job: 'update', args: ([<sublime.View object at 0x7fa12930c390>, <EasyClangComplete.plugin.settings.settings_storage.SettingsStorage object at 0x7fa1282af8d0>])
DEBUG:EasyClangComplete.plugin.utils.thread_pool: running 1 jobs
DEBUG:EasyClangComplete.plugin.tools: file has valid syntax: `C`
DEBUG:EasyClangComplete.plugin.view_config: generate new config for path: 27
DEBUG:EasyClangComplete.plugin.tools: file has valid syntax: `C`
DEBUG:EasyClangComplete.plugin.tools: file has valid syntax: `C`
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
DEBUG:EasyClangComplete.plugin.completion.lib_complete: using bundled cindex: EasyClangComplete.plugin.clang.cindex38
DEBUG:EasyClangComplete.plugin.clang.utils: platform: ('64bit', '')
DEBUG:EasyClangComplete.plugin.clang.utils: python version: 3.3.6
DEBUG:EasyClangComplete.plugin.clang.utils: we are on 'Linux'
DEBUG:EasyClangComplete.plugin.clang.utils: user provided libclang_path: <some_path_here>
DEBUG:EasyClangComplete.plugin.clang.utils: searching for: 'libclang-$version.so'
DEBUG:EasyClangComplete.plugin.clang.utils: libclang search output = 'libclang-3.8.so'
DEBUG:EasyClangComplete.plugin.clang.utils: real output: libclang-3.8.so
WARNING:EasyClangComplete.plugin.clang.utils: clang could not find 'libclang-3.8.so'
DEBUG:EasyClangComplete.plugin.clang.utils: searching for: 'libclang.so'
DEBUG:EasyClangComplete.plugin.clang.utils: libclang search output = 'libclang.so'
DEBUG:EasyClangComplete.plugin.clang.utils: real output: libclang.so
WARNING:EasyClangComplete.plugin.clang.utils: clang could not find 'libclang.so'
DEBUG:EasyClangComplete.plugin.clang.utils: searching for: 'libclang-$version.so.1'
DEBUG:EasyClangComplete.plugin.clang.utils: libclang search output = '/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/libclang-3.8.so.1'
DEBUG:EasyClangComplete.plugin.clang.utils: real output: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../x86_64-linux-gnu/libclang-3.8.so.1
INFO:EasyClangComplete.plugin.clang.utils: found libclang library file: '/usr/lib/x86_64-linux-gnu/libclang-3.8.so.1'
DEBUG:EasyClangComplete.plugin.flags_sources.cmake_file: [cmake]:[get]: for file /home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/update/c/hal_update.c
DEBUG:EasyClangComplete.plugin.flags_sources.cmake_file: [cmake]:[cached]: 'None'
DEBUG:EasyClangComplete.plugin.tools: searching 'CMakeLists.txt' from '/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/update/c' to '/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali'
DEBUG:EasyClangComplete.plugin.flags_sources.cmake_file: [cmake]:[current]: 'None'
DEBUG:EasyClangComplete.plugin.flags_sources.cmake_file: [cmake]:[generate new db]
DEBUG:EasyClangComplete.plugin.flags_sources.compilation_db: [db]:[get]: for file /home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/update/c/hal_update
DEBUG:EasyClangComplete.plugin.flags_sources.compilation_db: [db]:[cached]: 'None'
DEBUG:EasyClangComplete.plugin.tools: searching 'compile_commands.json' from '/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/update/c' to '/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali'
DEBUG:EasyClangComplete.plugin.tools: found 'compile_commands.json' file: /home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/compile_commands.json
DEBUG:EasyClangComplete.plugin.flags_sources.compilation_db: [db]:[current]: '/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/compile_commands.json'
DEBUG:EasyClangComplete.plugin.flags_sources.compilation_db: [db]:[load new]
DEBUG:EasyClangComplete.plugin.flags_sources.compilation_db: [db]: put into cache: '/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/compile_commands.json'
DEBUG:EasyClangComplete.plugin.tools: updating modification time for file '/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/compile_commands.json'
DEBUG:EasyClangComplete.plugin.view_config: flags generated from 'compile_commands.json'.
DEBUG:EasyClangComplete.plugin.completion.lib_complete: view is 27
DEBUG:EasyClangComplete.plugin.completion.lib_complete: translation unit does not exist. Creating.
DEBUG:EasyClangComplete.plugin.tools: file has valid syntax: `C`
DEBUG:EasyClangComplete.plugin.completion.lib_complete: clang flags are: ['-c', '-fsyntax-only', '-x', 'c', '-std=c11', '-I/usr/include', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/src', '-I/usr/lib/clang/3.8.0/include', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/update/c', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/update', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/clients', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/chipsets/linux/ali3921', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/generic/core/h', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/generic/network/h', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/generic/update/h', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/h', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/ali3921/h', '-I/usr/include/glib-2.0', '-I/usr/lib/glib-2.0/include', '-I/usr/include/libsoup-2.4', '-I/usr/include/libxml2', '-I/platform/linux/include/fd655', '-I/platform/linux/include/ct1628', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/fs/h', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/network/h', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/update/h', '-I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/ali3921/update/h', '-Wall', '-Wno-unused-function', '-D_REENTRANT', '-DWITH_THREADS=1', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-fgnu89-inline', '-fPIC', '-D_ALI_BUILD_', '-D_GNU_SOURCE', '-shared-libgcc', '-std=gnu99', '-march=armv7-a', '-mtune=cortex-a9', '-DARMV7SP', '-ggdb', '-O2', '-Werror', '-DDEVELOP', '-specs=/opt/gu/share/scratchbox2/../../share/scratchbox2/modeconf/gcc-specs.simple', '-mfpu=vfp3', '-mfloat-abi=softfp', '-Wno-poison-system-directories']
DEBUG:EasyClangComplete.plugin.completion.lib_complete: compilation started for view id: 27
ERROR:EasyClangComplete.plugin.completion.lib_complete: error while compiling: Error parsing translation unit.
DEBUG:EasyClangComplete.plugin.completion.lib_complete: compilation done in 0.012055158615112305 seconds
CRITICAL:EasyClangComplete.plugin.completion.lib_complete: cannot create translation unit. Abort.
DEBUG:EasyClangComplete.plugin.view_config: starting timer to remove old configs.
DEBUG:EasyClangComplete.plugin.view_config: [timer]: start for view: 27
DEBUG:EasyClangComplete.plugin.view_config: [timer]: active for views: dict_keys([27])
DEBUG:EasyClangComplete.EasyClangComplete: updated config: <EasyClangComplete.plugin.view_config.ViewConfig object at 0x7fa1292faf10>
DEBUG:EasyClangComplete.plugin.utils.thread_pool: Jobs still running: 0
DEBUG:EasyClangComplete.plugin.utils.thread_pool: Stopping progress animation.
ERROR:EasyClangComplete.plugin.tools: view file_name is None
my json goes like this (as you can see now the more common 'command' is used):
.
.
.
{
"command": "cc -c -I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/clients -I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/chipsets/linux/ali3921 -I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/generic/core/h -I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/generic/network/h -I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/generic/update/h -I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/h -I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/ali3921/h -I/usr/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -I/usr/include -I/platform/linux/include/fd655 -I/platform/linux/include/ct1628 -I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/h -I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/fs/h -I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/network/h -I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/common/update/h -I/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/ali3921/update/h -Wall -Wno-unused-function -D_REENTRANT -DWITH_THREADS=1 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fgnu89-inline -fPIC -D_ALI_BUILD_ -D_GNU_SOURCE -shared-libgcc -std=gnu99 -march=armv7-a -mtune=cortex-a9 -DARMV7SP -ggdb -O2 -Werror -DDEVELOP -o /home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/chipsets/linux/ali3921/../../../output/build/evo3hal/linux/ali3921/obj/hal_bluetooth.o -specs=/opt/gu/share/scratchbox2/../../share/scratchbox2/modeconf/gcc-specs.simple -mfpu=vfp3 -mfloat-abi=softfp -mtune=cortex-a9 -march=armv7-a -Wno-poison-system-directories /home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/ali3921/c/hal_bluetooth.c",
"directory": "/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/chipsets/linux/ali3921",
"file": "/home/ekt/Development/ip4tv/scratchbox/build/packages/hal/src.ali/solidHal/src/chipsets/linux/ali3921/c/hal_bluetooth.c"
},
.
.
.
This time i suspect that is not a parsing problem but rather some flags are not supported(?) However the error message is not very enlightening. Any ideas?
As a side note i managed to make it work on the latest visual studio code by replacing the "cc" with my toolchain's gcc path (along with the correct sysroot) which for some reason was not emitted with any of the automatic tools i used. However even with these changes it does not work in EasyClangComplete
The cc
part is strange. I will have a look into that.
Well, there is definitely a minor bug that there are two different std versions being used, one generated by the plugin -std=c11
and the other -std=gnu99
. This might be the cause of the error. Otherwise it can be one of the flags not being used correctly by clang. As a quick check, you could set your c_flags
setting to be equal to -std=gnu99
.
Also, I guess the -c
flag should be filtered out. Weird. Need to dig into this.
I have added a test that checks just that and it seems that the -c
flag is parsed correctly.
I'd just like to pop in here that I had similar issues, i.e. failing to parse the translation unit. Setting use_libclang to false, and making sure that all the paths in my compile_commands.json were absolute as opposed to relative got me to a working point (super excited about the compilation error highlighting!). Would be nice if the relative path issue could be fixed. In my case the paths were relative to the directory containing the compile_commands.json file, although I'm not sure if that's true in general.
As now the plugin will never use two std versions and some more tests have been added and there is not much happening here anymore, I will close this issue to streamline my attention and efforts.
I get this error when displaying the console (ubuntu x64 + clang version 4 from default repos ). Tried to use latest libclang upstream with the same results. I even tried with the default clang (also version 4.0) that ycmd downloads when compiling its server +played endlessly with path parameters to no avail..
Any suggestions?