Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sublime cannot find symbols if C++11 [[attribute]] specifier is placed before function. #2178

Closed
ElectricRCAircraftGuy opened this issue Feb 1, 2018 · 1 comment

Comments

@ElectricRCAircraftGuy
Copy link

ElectricRCAircraftGuy commented Feb 1, 2018

Summary

Sublime cannot find symbols if C++11 [[attribute]] specifier is placed before function. ie: it doesn't know the function is a function apparently if an attribute such as [[noreturn]] is placed before the function name.

Expected behavior

When I'm in a .hh file and place my cursor on the function name, then press F12, it should show it found it in the .cc file.

Actual behavior

Nothing happens. It cannot find the function--doesn't seem to recognize it---no popup occurs showing it is found in the other file.

Steps to reproduce

  1. File --> New Window.
  2. Create bug.hh with one line in it:
void foo();
  1. Create bug.cc with these 4 lines in it:
void foo()
{
    //do nothing
}
  1. Go to bug.hh and place your cursor on "foo". Press F12 or right-click and click on "Goto Definition". You'll see a popup showing "bug.hh:1" and "bug.cc:1".
  2. Now replace bug.hh with the following, having a C++11 attribute in front of it:
[[noreturn]] void foo();

And add the same attribute in bug.cc:

[[noreturn]] void foo()
{
    //do nothing
}
  1. And now click "foo" in "bug.hh" and hit F12 or do the right-click thing and NOTHING HAPPENS. Boom! ==BIG SCARY Bug!==

Now I have to resort to tools like git grep -i foo, assuming I've got the files in a local git repo, or grep -i -r foo . assuming I'm just working in a bare Linux directory. I'd really like Sublime to just link it for me instead like it should. Thanks!

Environment

  • Operating system and version:
    • Linux Ubuntu 14.04
  • Monitor: laptop
    • Resolution 1920x1080
    • dpi_scale used in ST ???--where do I find this?
  • Sublime Text: 3.0
    • Build 3143
    • 64 bit
@evandrocoan
Copy link

You need to find a C++11 compatible syntax for this to work. Try opening an issue on https://github.com/sublimehq/Packages/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants