jose-elias-alvarez / typescript.nvim

A Lua plugin, written in TypeScript, to write TypeScript (Lua optional).
The Unlicense
496 stars 33 forks source link

Fallback as a user-defined function for TypescriptGoToSourceDefinition #73

Open dsych opened 1 year ago

dsych commented 1 year ago

Allow users to supply the fallback function instead of assuming that they want to call the vanilla implementation.

For example, this would allow us to call telescope's implementation of go-to def:

require("typescript").goToSourceDefinition(winnr, {
    fallback = require("telescope.builtin").lsp_definitions
})

here we would simply check the type of the fallback and if it's a function, we would just call it.

jose-elias-alvarez commented 1 year ago

Sure, PR welcome.