Skip to content

Fix #193468 - Fix bug with error notification when pressing "l" on non-expandable reference item.#199996

Merged
joaomoreno merged 5 commits intomicrosoft:mainfrom
audreygao:debug-tree-widget-error-notification
Dec 20, 2023
Merged

Fix #193468 - Fix bug with error notification when pressing "l" on non-expandable reference item.#199996
joaomoreno merged 5 commits intomicrosoft:mainfrom
audreygao:debug-tree-widget-error-notification

Conversation

@audreygao
Copy link
Contributor

@audreygao audreygao commented Dec 5, 2023

Fixes #193468

  • Pressing "l" key on expandable reference item expands it. Pressing "l" on non-expandable reference item opens the reference and no longer shows error notification.
  • Fixes the same issue with pressing "l" on non-expandable items ini "Go to Implementation" list.

Cause of bug:

  • Pressing "l" key on non-expandable reference item triggers selectElement function in listCommand.ts, which calls AbstractTree's setSelection and setAnchor function. AbstractTree's setSelection function will (1) fire the given event, in this case open the selected reference item and dispose the list widget, (2) call the list widget's setSelection function. The list widget is thus empty with a list length of 0 after step (1), leading to error notification in step (2). Swapping step (1) and (2) fixes the issue.
  • AbstractTree's 'setAnchor' function also checks on the list widget's length. Calling this function after setSelection also triggers the error notification. Calling setAnchor before setSelection in selectElement function fixes the issue.

Issue fixed on "Go to Reference":

ReferenceListFix.mov

Issue Fixed on "Go to Implementations":

ImplementationsListFix.mov
@audreygao
Copy link
Contributor Author

@microsoft-github-policy-service agree

@joaomoreno joaomoreno added this to the December / January 2024 milestone Dec 20, 2023
@joaomoreno
Copy link
Member

Thanks! 🍻

@joaomoreno joaomoreno merged commit 3051ae8 into microsoft:main Dec 20, 2023
@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants