clausreinke / typescript-tools

(repo no longer active) Tools related to the TypeScript language
Apache License 2.0
266 stars 29 forks source link

Feature Request: CtrlP integration #37

Closed felixSchl closed 9 years ago

felixSchl commented 9 years ago

File navigation could be a lot smoother when integrated with CtrlP. The coupling may seem odd, but should be worth the trade off. For reference, the omnisharp guys also decided to go down that route.

clausreinke commented 9 years ago

I'm not sure what you mean: CtrlP.vim seems to be extensible, and typescript tools can be asked to list the files in the project (call TSSfiles('fetch'), to update the list cached in g:TSSfiles), so you should already be able to combine the two.

There are also our plugin's own navigation features: :TSSfile <file>, with completion and regexes, and :TSSfilesMenu, with popup menu.

felixSchl commented 9 years ago

I am aware it could be done and your functions should make integration easy. The question was more geared towards developing this integration as part of this project. Hence the talk about "odd coupling" and the reference to other projects that decided to offer CtrlP integration out of the box.

clausreinke commented 9 years ago

I have no such plans at the moment. Will leave this issue open for now.

clausreinke commented 9 years ago

Having looked into the CtrlP extension protocol again, I don't think it will be a good fit for us: it wants us to create a simple list of strings, handles the selection, then passes the selected string to our action function.

For filenames, that just about works, but I don't see the advantage against what we have.

For more general "find symbols that look like" search, which I've just added in the testing_ts1.4 branch (:TSSnavigateTo symbol), the protocol seems to be too simple: even after selecting a symbol, there are still several possible sources to jump to, so I need to preserve more information than the string used for selection.

I'm not happy with my own implementation, either (uses completion to identify the symbol to search for, then opens a menu for the remaining ambiguities), and the file and symbol queries are currently separate, but I don't think I'll add anything to our plugin specific to CtrlP support.

Note to self: if reconsidering this decision in the future, also check unite instead of ctrlp.