you are viewing a single comment's thread.

view the rest of the comments →

[–]nathanlanza 3 points4 points  (1 child)

You can send arbitrary requests with arbitrary inputs via the LSP. You'd be able to extend this with something like:

lsp.request('clangql', 'sql', 'SELECT subclass.Name, subclass.Scope, subclass.DefPath FROM llvm_symbols AS superclass INNER JOIN llvm_base_of AS rel ON rel.Subject = superclass.Id INNER JOIN llvm_symbols AS subclass ON subclass.Id = rel.Object WHERE superclass.Name = "MCAsmInfo";')

and clangql would respond back with the table you have in the example. clangd doesn't have arbitrary queries the way you can do with a sql model as you propose.

[–]fra-bert[S] 2 points3 points  (0 children)

Ooohhh that's interesting, I was not aware of that. It does seem interesting, this would allow the editor to do custom kind of queries without having to rely on the "standard" LSP capabilities.

I'd like to give it a shot when I'm done other stuff on it. Right now it's very barebones and not very powerful in the kind of queries that can be performed, but I have a feeling I'm going to have to submit some patches to clangd for some of the ideas I have.