-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fixes for undefined names #12
Conversation
- For every undefined name, suggestions are generated for similar names in similar roles. TODO: maybe type could also be used to filter suggestions. - An elegant/efficient implementation of Levensthein distance has been made to measure edit distance. - When this approachs works, the other errors generated directly by TypePal will be reviewed for possible additions of fixes.
Great stuff! I would like to have a feature to disable this functionality if desired via the config. |
int sizea = size(a); | ||
int sizeb = size(b); | ||
|
||
@memo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we configure the memo to timeout after a few minutes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes will do
Extremely cool. I was thinking maybe the max config parameter could be part of the require* functions that ultimately produce the code actions lists. That way a language designer can tweak it per identifier role. |
Yes this is exactly what I had in mind stylistically but I'd never dreamed this could be done generically for every typepal client so quickly. Wonder what else you have up your sleeve. |
I agree with you both that an off-switch would be good for if we apply typepal in a non-interactive setting. |
Thanks both for reviewing. I will add TypePal configuration parameters
|
I've added an issue to fix the missing keyword parameter syntax issue. The only reason we don't have this is that we didn't want to change the syntax for a while. Internally all representations of function types already have keyword parameter names and types. |
A user of TypePal can now control the way similar names are generated.
This pull requests defines code fixes for undefined names. The beauty is that all users of TypePal can directly profit from this. I have implemented a Levenshtein distance metric (that closely follows the formal definition, but is still efficient), to compute the distance between a given variable in a set of possible IdRoles, with what is available in the given TModel.
My questions:
Suggestions welcome (in particular about how test this in VsCode).