-
richlowe
do any of the modern cscope-y replacements do "find assignments to" but of a type rather than a symbol? and if so, which?
-
richlowe
I feel certain libclang knows, but I have no idea of what if anything is the good consumer :)
-
toasterson
some lsp probably
-
toasterson
helix-editor uses clangd and lldb for C
-
toasterson
so helix editor should work for you
-
richlowe
does it actually do the search I want too?
-
toasterson
it can do find usages. are you looking for other symbol type searches?
-
richlowe
I'm looking for assignments to a specific type
-
toasterson
so type conversions?
-
rmustacc
Not quite.
-
richlowe
no, any assignment to a symbol of a given type.
-
toasterson
like when a type is used?
-
rmustacc
Just imagine a type called a foo_t. You're looking for all assignments in C where the computed type of the left hand size from the compiler is a foo_t.
-
rmustacc
Whether someone has a global, a local, or access it through a struct or union member.
-
toasterson
Hmmmm, is that very C specific? Other languages that would be either usage of contructor or when you build the variable of that type. Which IIRC is part of a usage search of the type itself
-
richlowe
it's kinda C specific, but clang has to know, so I was hoping something that consumed libclang for these purposes exposed it
-
richlowe
and also that someone had used one and knew which was good.
-
toasterson
i think most lsp or very c specific things are hidden deep beneath the surface and the abstracted editor functions
-
rmustacc
That's not that C specific. A similar question is often asked in rust, java, etc.
-
jlevon
richlowe: uh, maybe coccinelle/spatch?!
-
richlowe
possibly, but also aaaargh
-
richlowe
jlevon:i-believe-i-did-bob.jpg
-
jlevon
I don't think it's a query you can make in LSP at least.
-
jclulow
In Rust I think if you pick a type you can at least ask all the places that type is used in your software to define a variable or whatever. I'm not sure about assignments like that though
-
richlowe
Rust's ownership model would make this far easier, because there would be a concrete place the data _is_ and someone who owns that.
-
richlowe
if all your pointers are into the heap, you're just going to find "every possible use of this type", which is what I'm trying to avoid, there are lots and lots.
-
jclulow
mmm
-
richlowe
on the upside I found an excuse to C99-ize something.
-
richlowe
which always makes me happy
-
richlowe
please forget I said "excuse" when it comes to code review though.
-
alanc
clearly you meant to say "a strong and valid need"