Skip to content

Multi-file editor dirty diff indicator

Phil Hughes requested to merge multi-file-editor-dirty-diff-indicator into master

What does this MR do?

Creates our own GitLab editor library which works from the monaco editor. This allows us to extend the editor to fit our needs. With this change we now cache the different models required for each file to work with monaco, previously we would create a new model everytime a file is opened this could eventually become an expensive operation depending on how many files have been opened & closed.

In this change there is also a dirty diff indicator added into the gutter. This tells the user what lines have been added, modified & removed. This operation can become expensive depending on the amount of changes so this is sent to a web worker to calculate & also throttled as we don't need every keypress to trigger an update.

The decorations are also managed through a cacheable class. This class caches based on the model so that we can quickly re-decorate the file when switching tabs. With this class we can also add several different decorations depending on what we require in the future.

What are the relevant issue numbers?

Closes #40046 (closed)

Edited by Phil Hughes

Merge request reports