aljazsim / vs-code-typescript-code-explorer

VS Code extension for easily navigating TypeScript code
MIT License
7 stars 1 forks source link

[Feature] Is it possible to add method sorting based on usage in file (just occurence) ? #4

Open ocoka opened 4 years ago

aljazsim commented 4 years ago

Hi Ivan.

I'm not really sure what do you mean. Could you provide me with a sample?

ocoka commented 4 years ago

Hello, thank's for quick answer, yes, I try to explain: image Main idea is to get methods or props sorted by how many times their name occurrences in file, it can be very useful for large file of unknown code, because then you can immediately understand what methods are, so to say, entry points and used by external code and how many of them, and what methods most often used in that file, so their also need to be investigated firstly. image

aljazsim commented 4 years ago

I see. For generating the tree I'm using something called AST (Abstract Syntax Tree) API. It is only a syntactic analysis of the current file. What you'd like to achieve is to actually find references across the project. I'm not really sure how you would do that. Just doing a simple search across files would not be a good way of doing that.

ocoka commented 4 years ago

Yes but no, not across a whole project just occurrence in current file, and of course just simple search not a best way, but I think it is possible while go through AST to collect all method invokes.

aljazsim commented 4 years ago

I'm not sure about the usability of this feature. I am overwhelmed by other things currently, but if you'd like to implement it yourself I'd be happy to guide you through the implementation.