apex-dev-tools / apex-ls

Apex language server library
Other
2 stars 1 forks source link

Missing handling is missing some cases #172

Closed kjonescertinia closed 1 year ago

kjonescertinia commented 1 year ago

There appears to be an issue where properties which are named the same as types can result in some confusing errors messages such as:

Screenshot 2023-06-01 at 09 34 59

Here 'configuration' is a property of a super class but also an inner type. If it is resolved to the inner type then we can get this error but note that it is an 'Error' and not a 'Missing' diagnostic so we won't revalidate due to this.

It's not known why this might resolve to a type first but it occurs during 'rush build' handling on pse/core where the super class may not be initially available. The issue goes away if you save the file.

kjonescertinia commented 1 year ago

The problem here appears to be the fieldsByName handling in TypeDeclaration. It caches superclass fields which may not be available when a class is initially validated but won't update after it does become available.