gitkraken / vscode-gitlens

Supercharge Git inside VS Code and unlock untapped knowledge within each repository — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more
http://gitkraken.com/gitlens
Other
9.01k stars 1.34k forks source link

Unexpected behaviour with C/C++ extension and typedef #425

Open Jamen1993 opened 6 years ago

Jamen1993 commented 6 years ago

I use GitLens together with Microsofts C/C++ extension and it shows file edit information before each typedef. I'm not sure whether this is intended behaviour but I don't think so.

image

image

eamodio commented 6 years ago

Can you try setting "gitlens.debug": true and then send a screen shot of those code lens again? That will give the type of symbol of that type and it can be turned off directly.

Jamen1993 commented 6 years ago

Hi eamodio,

please excuse that it took me so long to collect the requested screens.

first second

Is this what you need?

eamodio commented 6 years ago

Yes thank you. It seems a bit odd to me that the C++ language server is using SymbolKind.Class for all those (rather than SymbolKind.Enum and SymbolKind.Struct), but regardless the issue would be largely the same.

While it would affect more than just these typedefs you can turn off the code lens on the container scope by setting "gitlens.codeLens.scopes"= ["document"].

Or you add to the gitlens.codeLens.scopesByLanguage setting to only set the document scope for "language": "cpp"

{
    "language": "cpp",
    "scopes": [
        "document"
    ]
},

Or you add to the gitlens.codeLens.scopesByLanguage setting to only unset the Class symbol for "language": "cpp"

{
    "language": "cpp",
        "symbolScopes": [
            "!Class"
        ]
},

Maybe once https://github.com/Microsoft/vscode/issues/34968 lands and the language services provide more information I might be able to do more here to improve this behavior.

eamodio commented 6 years ago

Depends on: https://github.com/Microsoft/vscode/issues/57984

gajop commented 5 years ago

I'm having a similar issue with using MyFunctionType = std::function<void()>; I get author + date information above each such line.