When calling remote functions or emitting deprecation warnings
respectively Electron and Grim create a fake `Error` object to retrieve
the stack trace of the current call site.
When doing this for the first time, if the call site was located inside
a snapshotted file, previously we would parse the source map for the
snapshot and translate the position of each call in the stack trace.
However, since the snapshot source map is quite big, we were observing
major slowdowns when parsing it for the first time.
With this commit we will parse the snapshot source map while generating
the snapshot, which will allow to not pay for it during runtime.
Signed-off-by: Michelle Tilley <binarymuse@github.com>
Previously the DisplayLayer would have issues when closing tags that had
not been previously opened, requiring us to guard against mismatched
scopes at the frontier of asynchronous tokenization (see 5cfe9716 for
more information).
Now the DisplayLayer gracefully handles closing tags that had not been
opened, meaning we can eliminate this costly logic.
Signed-off-by: Nathan Sobo <nathan@github.com>
This means we may render more tiles than necessary when we have block
decorations, but it prevents changing the number of rendered tiles
during scrolling with certain combinations of line height and editor
height. If it ever becomes a problem we can get smarter about
subtracting the height of the visible block decorations from the editor
height, but for now this gives us more reliable performance for the
common case.
Previously, we were accidentally depending on the state of the display
layer when forcing it to update its index. This caused us to not index
enough content to cover the visibile area, which meant we weren't
querying enough lines to fill the screen in some situations.
This was causing problems in measurements because in that code path we
assume that text nodes are never empty. This commit also adds a test
verifying this invariant when a text decoration ending right after a
text tag is added.
This was leaving a measurement request in the map that was getting
picked up on the next frame. In some cases, the requested measurement
row was not present, causing an exception.
Some packages are interacting with this method assuming this behavior,
so this commit eliminates `screenPositionForPixelPositionSync` and
instead just performs the DOM update in `screenPositionForPixelPosition`
if it is needed.