Skip to content

Conversation

rlivings39
Copy link
Member

@rlivings39 rlivings39 commented May 24, 2023

This PR resolves 3 issues in the documentSymbol / outline support from #1:

  1. Handle new files properly. The original code wouldn't show symbols for them until edits were made after a save. We handle this by adding a way to flush the pending index queue for a document to avoid the timing issues that triggered the original bug.
  2. Be more friendly when the document temporarily has invalid syntax because the user is in the middle of an edit. The original code would return an empty set of symbols if the user was in the middle of an edit which made the code have invalid syntax. Now we stash the latest results for the document and fall back to that if the current version fails to parse.
  3. The original code would not provide document symbols if the MATLAB launch setting was never but the user manually launched MATLAB. Now we will utilize an existing MATLAB irrespective of the launch setting.

I also removed the unnecessary complexity of using an unawaited promise from the original documentSymbol request. Further experimentation showed this didn't matter.

Particularly handle new files properly and be more friendly when the document temporarily has invalid syntax because the user is in the middle of an edit.
@rlivings39
Copy link
Member Author

@jdhameli also manually tried out this version of the code to verify that the responsiveness issues he saw were addressed

@dklilley dklilley merged commit 6b8e1e1 into mathworks:main May 25, 2023
diningPhilosopher64 pushed a commit to diningPhilosopher64/MATLAB-language-server that referenced this pull request Jul 2, 2024
…cycleAndComm TypeScript <-> MATLAB communication impl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants