ui: Adds multi syntax linting to the code editor #4814
Merged
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 adds multi syntax linting capabilities to the code editor.
The linting/syntax javascript files are loaded on demand, so if you don't need a certain syntax, it won't be loaded. This gives us the freedom to add more syntaxes in the future with no downsides.
Currently we've included:
The look and feel is yet to be refined, although as it is functionally 'ready', I thought people might appreciate this in the upcoming release. It also might prompt users to give us any other syntaxes they might need including.
The syntax mode loader is a little 'out of the ordinary' as it tries to use the existing CodeMirror loadMode plugin to avoid reinventing the wheel.
The syntax highlighting colors themselves keep the colors we followed from the vault ui.
Fixes #4671 , #4258 and #4256