apex-dev-tools / apex-ls

Apex language server library
Other
2 stars 1 forks source link

Error on private impl of interface and fix method map error handling #195

Closed kjonescertinia closed 1 year ago

kjonescertinia commented 1 year ago

This PR cover adding a diagnostic to error if a private/protected method is provided that matches an interface method.

While working on it I noticed that we were not handling method/constructor map errors correctly so have changed this so that we always report errors recorded on a method/constructor map during FullDeclaration construction, not just when the maps are created.

However I was still seeing some issues which I have tracked to the use of the 'deep hash' to determine if method/constructor maps may need to be recreated during a re-validation of a type. The deep hash is computed over the source of the type and that of its superclass/interfaces. A problem occurs though if say a parameter type is Missing as this is not included in the hash. To workaround this I have changed the code so that during revalidation we always re-create the constructors/method maps as this is safer if more costly.

I will create a ticket to investigate further if not re-creating these maps is beneficial enough to justify the cost of an expanded deep hash that could handle reference types being missing/available at different times.

kjonescertinia commented 1 year ago

Follow on ticket, https://github.com/apex-dev-tools/apex-ls/issues/196.