-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Improve semantic token latency, highlight function and modified variables #135
Conversation
I'm wondering how would an invalid namespace behaved? There are two possibility in my mind
The first one is actually help us to detect it then provide a new one, the second one is harder to handle (wait me modify the snippet & test). UpdateI random pick a module, insert a new definition and provide it, cannot get exception in this way. |
I guess it might throw a exception or silently produce wrong results in different cases. Because a namespace contains mappings from module names to module bindings. If a module x requires module y, we cache the namespace, then
|
Yep, maybe we can create an issue for further discussion, for now the PR is great. |
The code to identify function token was complex and has a bug that treat the expression |
Thanks! |
This PR added highlight for function and modified variables, and improved expand performance by 30% to 10x.
The details as follows:
no-check
language line before expand. It avoid type check and reduce at least one second for each expand. If error happens because of the replace, it would fallback to normal language line.This snippet is a demo. For example:
Here the second expand is faster than the first expand by reuses the namespace.
And a typed racket file without the nocheck replacement:
with nocheck replacement: