Sometimes I know the name of the function I'm looking for but it isn't used anywhere in the current buffer. With the various tags utilities I was always able to just search for a definition by name, but lsp-find-definition seems to only operate on whatever symbol the cursor is currently on. Is there a way to get a prompt where I can type in a name to search for? Manually adding a use to the current buffer just so I can find the definition and then deleting it afterwards is very clunky. Would be especially nice to have something that would play well with read-completing-function so helm/ivy would work.

1 Answer 1


Nope. As best I can tell, the LSP protocol doesn't appear to have any facility for looking up definitions based on name rather than document position. In fact, an LSP client like Emacs doesn't even parse the document to get the identifier at the point. Instead it just sends the current cursor position (file name, line, and column number).

This is documented in the protocol specification.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.