fix(compass-aggregations): remove ace editor snippet completion, complete operator snippets on our end COMPASS-5683 #3048
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes our use of ace editor's
insertSnippet
command. This command was causing any items which matched the token, which was by default anything starting with$
to be removed when the stage operator was changed. This unintentional replacing was made more evident when we added the ability for the stage content not to change when the operator is changed.To fix this we are now replacing the ace snippet completion by replacing the tokens explicitly (see the
replaceOperatorSnippetTokens
function). As a result of this approach we are able to remove thefromStageOperators
flag, which, from what it looks like, was used to prevent an additional preview reload when the stage operator changed. We're also removing thesnippet
from the stage model as it is no longer needed.We could alternatively try to update how ace does its snippet completion, but I think that approach would make us more tied to ace editor internals, and might require us to keep these extra things in the state which do not need to be.
before:
before.-.token.lost.mp4
after:
token.is.kept.after.mp4