EasyClangComplete icon indicating copy to clipboard operation
EasyClangComplete copied to clipboard

Completion doesn't work with clang versions prior to 4.0

Open natehawes opened this issue 9 years ago • 8 comments

Have a strange bug- may be an incorrect setup, sorry if it turns out to be easy. I'm on windows 7 and have installed LLVM 3.8 (I saw the note about 4.0 being broken). EasyClangComplete successfully runs the file and will highlight problems, but it won't autocomplete and ends up throwing an error.

I'm working on a c project for an embedded system and primarily want to autocomplete structure and unions. I've added all my includes and it seems like they're found correctly.

In this screenshot you see it picks up an implicit truncation bug just fine: image

But if I try to autocomplete (vars is a global structure defined in a different file): image

You can see that it understands what the structure is: image

Here's the log:

startup, version: 3126 windows x64 channel: stable
executable: /C/Program Files/Sublime Text 3/sublime_text.exe
working dir: /C/Program Files/Sublime Text 3
packages path: /C/Users/212349988/AppData/Roaming/Sublime Text 3/Packages
state path: /C/Users/212349988/AppData/Roaming/Sublime Text 3/Local
zip path: /C/Program Files/Sublime Text 3/Packages
zip path: /C/Users/212349988/AppData/Roaming/Sublime Text 3/Installed Packages
ignored_packages: ["Vintage"]
pre session restore time: 0.224
startup time: 0.25
first paint time: 0.25
first paint time: 0.251
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.comment
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin 0_package_control_loader.00-package_control
reloading plugin Package Control.1_reloader
reloading plugin Package Control.2_bootstrap
reloading plugin Package Control.Package Control
reloading plugin EasyClangComplete.EasyClangComplete
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', '-Ic:/ti/ccsv6/tools/compiler/c2000_15.12.3.LTS/include', '-Ic:/ti/controlSUITE/device_support/F2837xD/v160/F2837xD_common/include', '-Ic:/ti/controlSUITE/device_support/F2837xD/v160/F2837xD_headers/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++ -v`
INFO:EasyClangComplete.plugin.tools: Found clang version: 3.8.0
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.clang.utils: found libclang library file: 'C:\Program Files\LLVM\bin\libclang.dll'
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
Package Control: Skipping automatic upgrade, last run at 2017-04-11 07:48:34, next run at 2017-04-11 08:48:34 or after
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
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
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
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
INFO:EasyClangComplete.plugin.view_config: init completer based on libclang
reloading settings Packages/User/Preferences.sublime-settings
reloading settings Packages/User/Preferences.sublime-settings

Thanks for putting together such a great plugin, I can't wait to get it to work, it looks so nice.

natehawes avatar Apr 11 '17 12:04 natehawes

The clang 4.0 being broken is an outdated message. It seems now, that I have fixed that all other clangs are broken :) Please try clang 4.0 and tell me how it went.

I will most probably fix this tomorrow night.

niosus avatar Apr 11 '17 13:04 niosus

Looks like libclang bug? Could you share declaration of vars with comments?

simia avatar Apr 11 '17 15:04 simia

@simia This is clearly a bug and it was fixed in 4.0. That is why we had problems with 4.0. The inclusion of comments flag has to match when creating a translation unit and when completing the code. This was not the case before. This check was wrong before clang 4.0

niosus avatar Apr 11 '17 16:04 niosus

Niosus & Simia, thanks for the prompt replies. Unfortunately, no dice. I installed LLVM 4.0, re-started and saw the following error. I then uninstalled and reinstalled easyclangcomplete for good measure but it didn't change the error.

image

natehawes avatar Apr 12 '17 00:04 natehawes

Well, this looks like your clang is not in the path. There is a box you have to tick while installing clang to make sure it is in the PATH. I believe if you run cmd or powershell and type clang++ there it will complaint too.

niosus avatar Apr 12 '17 06:04 niosus

I have pushed the fix. Please reopen if it doesn't work. However, @natehawes the last error you reported is as I said probably because clang is not found in the path, not because of the plugin itself.

niosus avatar Apr 12 '17 07:04 niosus

This seems like it was the problem @niosus, I can swear I clicked the box when installing LLVM to add it to path. I re-installed LLVM and was sure to click the box and now easyclangcomplete works perfectly.

Thanks for helping me out here and thanks for making such a nice tool.

I'll contribute a cup of tea for you.

natehawes avatar Apr 13 '17 13:04 natehawes

Yeah, it happens. Windows is not the friendliest system for developers :wink:

I'm glad to hear that you like the plugin! :)

niosus avatar Apr 13 '17 13:04 niosus