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

Separate DocumentSymbols are not provided for function declaration & definition within the same file #116

Open
BigBahss opened this issue Mar 4, 2021 · 2 comments

Comments

@BigBahss
Copy link

BigBahss commented Mar 4, 2021

Observed behavior

Separate DocumentSymbols are not provided for functions with a declaration and definition in the same file.

Expected behavior

DocumentSymbols should be provided for both the function declaration and definition.

Steps to reproduce

Try this code:

int foo();

class Bar {
public:
   Bar();
};

int foo() {
    return 42;
}

Bar::Bar() { }

Symbols are only provided for the functions once each:

Screenshot_2021-03-04_07-47-19

System information

  • ccls version: 20201219-2
  • OS: Manjaro Linux 5.10
  • vscode-ccls version: 0.1.29
@FederAndInk
Copy link

I have made a PR about this here: MaskRay/ccls#674
basically, it solves hierarchical issues and other stuff like the issue you describe but symbols in macros are not seen anymore it's by design (I think we could add this by implementing the current design when we hit a macro it would then have the same problems but only in macros). IMHO we should make a macro inspector with more detailed step by step of what is happening.
At this time I haven't received a response from MaskRay

@BigBahss
Copy link
Author

BigBahss commented Mar 4, 2021

Ah, okay cool. I checked the open issues but neglected to check PR's, good to know this is already being taken care of. Fixing this issue would make it easier to develop tools that work the same for any language server.

I like the macro inspector idea. It's a little weird to see symbols provided that are inserted by macros, but in some contexts it would be useful to see that information.

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

No branches or pull requests

2 participants