Strumenta / kolasu-languageserver-library

1 stars 0 forks source link

Discuss unexpected results from findByPosition #29

Closed martin-azpillaga closed 9 months ago

martin-azpillaga commented 9 months ago

I have found an extraneous result from kolasu's findByPosition for an RPG AST Say I have a select with multiple conditions like: WHEN X = 0 and WHEN X = 1 If I run findByPosition given the first X occurrence's position, I get the expected ReferenceExpr node If I run findByPosition given the second X occurrence's position, I get the entire WhenClause node back I can't manage to access the second X any way in this configuration However, if I close the first select after X = 0 and start a new select for X = 1 then everything works It seems to fail for non-first when clauses, similarly if I add X = 2 etc The statements inside the when block resolve correctly no matter how many clauses there are I don't think I can fix it, but I wanted to write it down for future considerations