scottclowe / matlab-schemer

Apply and save color schemes in MATLAB with ease.
BSD 2-Clause "Simplified" License
1.19k stars 273 forks source link

Support VRML/X3DV syntax #16

Closed scottclowe closed 8 years ago

scottclowe commented 8 years ago

New language VRML/X3DV (virtual reality modelling) syntax highlighting was added to MATLAB by MathWorks in the 2016a release.

The following steps will need to completed:

Dev-iL commented 8 years ago

VRML-related strings and their default settings:

Editor.Language.VRMLX3DV.SyntaxHighlighting=Btrue

Editor.Language.VRMLX3DV.Color.keyword=C-16776961
Editor.Language.VRMLX3DV.Color.field-keyword=C-9145228
Editor.Language.VRMLX3DV.Color.terminal-symbol=C-2196224
Editor.Language.VRMLX3DV.Color.string=C-6283024
Editor.Language.VRMLX3DV.Color.node-keyword=C-16022329
Editor.Language.VRMLX3DV.Color.data-type-keyword=C-6737152
Editor.Language.VRMLX3DV.Color.comment=C-14513374

Editor.Language.VRMLX3DV.Indenting=SSmartIndent
Editor.Language.VRMLX3DV.Extensions=Swrl;x3dv

For future reference - the easiest way to find these strings and get their defaults is to:

  1. Make a copy of matlab.prf.
  2. Go to Preferences > MATLAB > Editor/Debugger > Languages > (select desired language from the drop down) > w/o changing anything click "apply".
  3. Compare old and new .prf.
scottclowe commented 8 years ago

Thanks @Dev-iL!

Taking the diff of matlab.prf is a great suggestion. In the past I've just opened a text-editor and done a text search.

scottclowe commented 8 years ago

This is now done.

Since VRMLX3DV settings are the same as VRML, only the name has changed with the new release, I have set things up so the values imported for VRMLX3DV will come from the VRML, and the appropriate value will be exported to VRML depending on the MATLAB version number.

After creating sample.x3d (source) and sample.x3dv (source), I realised that X3D is in XML format and takes its syntax highlighting colours from there, whereas X3DV takes its colours from the VRML settings. Consequently, I changed the default value inheritance, so that VRML is based on XML if its values are undefined. This should lead to greater consistency between the X3D and X3DV syntax highlighting.