File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
delphi-frontend/src/main/java/au/com/integradev/delphi/symbol/resolve Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010### Added
1111
1212- Support for MSBuild item and item metadata expressions in project files.
13+ - Debug logging for name resolution failures (enabled with ` sonar-scanner -X ` ).
1314- ` ExhaustiveEnumCase ` analysis rule, which flags ` case ` statements that do not handle all values in an enumeration.
1415- ` IterationPastHighBound ` analysis rule, which flags ` for ` loops that iterate past the end of the collection.
1516- ` ExplicitBitwiseNot ` analysis rule, which flags potentially incorrect bitwise ` not ` operations.
Original file line number Diff line number Diff line change @@ -217,6 +217,18 @@ private void checkAmbiguity() {
217217 }
218218 }
219219
220+ private void checkNameResolutionFailed () {
221+ if (LOG .isDebugEnabled () && nameResolutionFailed ()) {
222+ Node location = Iterables .getLast (names ).getLocation ();
223+ LOG .debug (
224+ "Name resolution failed on symbol '{}' ({} line {}:{})" ,
225+ location .getImage (),
226+ location .getUnitName (),
227+ location .getBeginLine (),
228+ location .getBeginColumn ());
229+ }
230+ }
231+
220232 void updateType (Type type ) {
221233 currentType = type ;
222234 ScopedType scopedType = extractScopedType (currentType );
@@ -233,6 +245,7 @@ public boolean isExplicitInvocation() {
233245
234246 public void addToSymbolTable () {
235247 addResolvedDeclaration ();
248+ checkNameResolutionFailed ();
236249
237250 for (int i = 0 ; i < resolvedDeclarations .size (); ++i ) {
238251 NameOccurrenceImpl name = names .get (i );
You can’t perform that action at this time.
0 commit comments