hoovercj / vscode-ghc-mod

An extension to bring ghc-mod to vs code
MIT License
31 stars 13 forks source link

Show All Symbols Performance #57

Open hoovercj opened 7 years ago

hoovercj commented 7 years ago

Per @nebtrx in #56

Go to symbol works pretty fast in my environment but Show all symbols doesn't. When you take a look at the server log, it says it finds 1911 tags, which I assume is the total amount, no matter the text you input. Shouldn't it be narrowing the amount of tags basde on the query? Hope this info helps. Thanks in advance

I've created a new issue to track this as the symbol providers are not based on ghc-mod, they use fast-tags or hasktags, depending on your settings.

The current implementation takes a naive approach of simply calling the hasktags or fast-tags executable each time the request is made and then filtering the results. As you can see, this IS fast enough (usually) for getting tags from a file, but unfortunately in your case it isn't fast enough for finding all symbols across the workspace.

The logging that you see that mentions how many symbols are found, that is how many total symbols are found by the tag provider. I then filter them so that only the matching ones are returned. AFAIK I cannot ask fast-tags or hasktags to only produce tags that match a particular string.

One potential solution would be to generate the symbols on file save instead of on request.

nebtrx commented 7 years ago

Cool. I don't see myself using Find all symbols feature that much. I wasn't sure how it was related to #56 so I just added the information just in case. Anyway, this is helpful to anyone with the same issue and eager to use the feature. Thanks for the diligence @hoovercj