Improve Resyntax integration#196
Conversation
This allows break exception are handled correctly by outer handlers.
…old Racket versions
|
I was thinking to get rid of the at most 1 place worker limit, and use a place worker pool. Then I realized this is almost the same as the existing scheduler, the difference is, place worker pool executes tasks with place, and current scheduler executes tasks with threads. I'm thinking if I can generalize them, and make a more general implementation of scheduler, or reuse the scheduler. EDIT: I've decided to abandon the worker pool implementation. It's overly complex, and offers limited benefit when running multiple slow resyntax tasks in parallel, and consuming unnecessary resources. Our resyntax integration should be used for small files and fast feedback. If a file is too large or complex for resyntax to run fast, the command line is recommended. For reusing the scheduler and place worker pool design, it's not feasible. Because the place task runner requires serializable inputs and serializable outputs. The output of resyntax task, |
This PR
walk-text, becausewalk-textis only used by resyntax integration, we will no need it due to the following changesdoc-resyntaxfunction indoc.rktthat calls resyntax and return a list of code actionsdoc-walk-textfunction indoc.rktThe internal
expandis locked, resyntax's expand interfere documents' expand. By move resyntax into aplacethat is another Racket instance, documents' expand work better.This PR can also mitigate performance issue in #191
EDIT: The current design for running resyntax with
racket/placeis, when a resyntax task is created, aplaceworker is spawned to execute it. If a task is cancelled (due to a document close or document change event), the place worker cancels the task and becomes idle. Subsequent tasks then reuse the same place worker. Therefore, at most oneplaceexists at any given time.