-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completion improvement #31
Comments
also, the completion failed when previous file load ends with an error. |
Hi, @chantisnake Can you give me more details?
Thanks in advance! |
I think one of the way to solve the previous problem is that when you did the type check, keep the previous successful type check file in a temp location, if the current type check failed, use the previous successful type checked file to provide completion. I don't know lots of javascript, therefore I will write Pseudocode:
This is no where near a good solution, but it works. Although the performance issue is an headache. Let's just hope a "real script analyzer" will come for |
@chantisnake You solution seems doable, I will create a separator issue to track this, Thanks! |
@chantisnake On a second thought, cache previous file may not work as expected because if you want to type check a file in a project, you also need other related modules which means you have to cache the whole project which can be type checked before, so maybe a more straightforward way is to cache the previous completion items I believe. |
It is reasonable, I believe. Thank your for fixing it. |
Hi, @chantisnake I believe I have already addressed the issue you mentioned before, it can provide cached completion items when type checking failed. But for the first case that you add a function without saving the file, it is impossible to auto completion the name for it because Idris process can only interpolate the function into the module context unless you successfully type check and load the file. BTW, I will release a new version which contains this fix ASAP this week :) |
Thank you so much! |
@chantisnake No worries :) |
:repl-completions
command. Also, need to eliminate some speed overhead.Currently, it will only suggest bare strings for auto-completion without any extra information e.g. item kind which mentioned above.
For the second point, there is no external tools to analysis Idris source file currently, so a naive but straight forward way is to extract all the lexer identifier and add to the completion result list.
The text was updated successfully, but these errors were encountered: