question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on hovering over variable

See original GitHub issue

I am able to use the completion when I type a trigger character, however, when I hover over a variable, the console displays the following output:

INFO:EasyClangComplete.plugin.view_config: init completer based on libclang ERROR:concurrent.futures:exception calling callback for <Future at 0x7f288d91ff10 state=finished raised ArgumentError> Traceback (most recent call last): File “./python3.3/concurrent/futures/_base.py”, line 296, in _invoke_callbacks File “/home/avidbots/.config/sublime-text-3/Packages/EasyClangComplete/EasyClangComplete.py”, line 261, in info_finished (tooltip_request, result) = 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/avidbots/.config/sublime-text-3/Packages/EasyClangComplete/plugin/completion/lib_complete.py”, line 242, in info self.tu, self.tu.get_location(view.file_name(), (row, col))) File “/home/avidbots/.config/sublime-text-3/Packages/EasyClangComplete/plugin/clang/cindex35.py”, line 2346, in get_location f = self.get_file(filename) File “/home/avidbots/.config/sublime-text-3/Packages/EasyClangComplete/plugin/clang/cindex35.py”, line 2335, in get_file return File.from_name(self, filename) File “/home/avidbots/.config/sublime-text-3/Packages/EasyClangComplete/plugin/clang/cindex35.py”, line 2531, in from_name return File(conf.lib.clang_getFile(translation_unit, file_name)) ctypes.ArgumentError: argument 2: <class ‘TypeError’>: wrong type

These are the settings I am using:

{
  "flags_sources": [
    {"file": ".clang_complete"},
    {"file": "compile_commands.json"},
    {"file": "CMakeLists.txt"},
  ],
  "common_flags" : [
    // some example includes
    "-I/usr/include",
    // this is needed to include the correct headers for clang
    "-I/usr/lib/clang/$clang_version/include",
    "-I/opt/ros/indigo/include",
    "-I/opt/ros/indigo/include/roscpp",
    "-I/usr/include/x86_64-linux-gnu/c++/4.8",
    "-I/home/avidbots/Dev/avidbots/ros_indigo/src/avidbots_library/"
  ],
  // C specific flags. Prepend common_flags for C files.
  "c_flags" : [
    "-std=c11"
  ],
  // C++ specific flags. Prepend common_flags for C++ files.
  "cpp_flags" : [
    "-std=c++11"
  ],

  "clang_binary" : "clang-3.5"
}

I’m only using the .clang_complete file. It is quite large since I am developing a robotics project with ROS and a large amount of nodes (each with different include directories).

The first 9 lines of this file is:

-I/usr/include -I/usr/include/eigen3 -I/usr/lib/clang/$clang_version/include -I/opt/ros/indigo/include -I/opt/ros/indigo/include/roscpp -I/usr/include/x86_64-linux-gnu/c++/4.8 -I/home/avidbots/Dev/avidbots/ros_indigo/src/avidbots_library -I/home/avidbots/Dev/avidbots/ros_indigo -I/home/avidbots/Dev/avidbots/ros_indigo/devel/include

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
cpagravelcommented, Feb 8, 2017

Oh it works now. I cleared my cache with EasyClangComplete: Clean current CMake cache.

I can now see the types of variables once I hover over them and I get information on functions as well. Excellent! I think this solves it. So I guess this could be wrapped up. The problem was that the wrong libclang library was being used.

Suggestion: I would suggest that for Linux, after receiving the binary you could parse the input produced by “<clangbinary> -v”. Which you already do in /plugin/tools.py as version_str except that you only need the first 2 digits separated by a dot: I.e. in regex (?<= )(\d.\d)

Then for Linux systems attempt to search first for a libclang file that has the form: libclang-<parsed_version_string>.so.1

A quick fix would be to accept an input in the settings file for the libclang library name; perhaps a good fallback.

0reactions
niosuscommented, Feb 12, 2017

Closed with the pull request.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hover over variables no longer show the debug value.
Developer Community. Hover over variables no longer show the debug value. Hello, I have a problem since 24/11/2021 where in visual studio 2022...
Read more >
c# - Datatips (mouse hover over variables in debug mode) not ...
It was only "Use legacy C# and VB expression evaluators" that allowed hover over variables AND remote debugging in my case.
Read more >
1.2.0-insiders: Hover over variables of type span ... - GitHub
Requires 1.2.0-insiders (not released yet). See the repro at #6251, then hover over a variable of type span. It shows <error-type> .
Read more >
Hovering cursor over variables in VBA when code interrupted ...
I can no longer hover the cursor over variables to display their values when VBA code is interrupted, stopped, error etc.
Read more >
Hovering mouse over a variable suddenly doesn't show ...
I got this issue in matlab 2018a. I found that one of my variable name is 'eval'. 'eval' is an inbuild function name,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found