Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(suggest): file level cmds don't leak internal syms (#944)
## Summary Suggest commands related to the whole file (i.e. outline), and not cursor positions, no longer include symbols from inside template and generic routines. ## Details `semIdeForTemplateOrGenericCheck` is used to detect whether the cursor is within a generic routine or template body, before this change it didn't validate which suggest command was invoked ( `ideCmd` ). This resulted in `safeSemExpr` being run and potentially reporting symbols from inside such routines. This led to commands such as `outline` containing symbols from the routine bodies polluting module level results. `semIdeForTemplateOrGenericCheck` has now been updated to check the command against the newly added `ideLocCmds` constant, which includes commands that require cursor position tracking ( `ideSug` , `ideCon` , `ideDef` , `ideUse` , `ideDus` ), preventing the unexpected analysis and pollution of module level results. A regression test was added to ensure that accidentally providing cursor tracking information to module level commands doesn't change the results. --------- Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com> Co-authored-by: Saem Ghani <saemghani+github@gmail.com>
- Loading branch information