Failed attempt at injecting token colour customisations draft

Wed, 13 May 2020 15:17:53 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Wed, 13 May 2020 15:17:53 -0500
changeset 21
1dc4f331d3d5
parent 20
2f22cc1afaad
child 22
24bbbfc71c1b

Failed attempt at injecting token colour customisations

README.md file | annotate | diff | comparison | revisions
package.json file | annotate | diff | comparison | revisions
--- a/README.md	Thu May 14 17:45:50 2020 -0500
+++ b/README.md	Wed May 13 15:17:53 2020 -0500
@@ -14,15 +14,11 @@
 
   c) Highlighting of `comment` environments as comment blocks.
 
-The highlighting of todo-notes and footnotes has to be specifically configured:
-see below.
-
-### Regarding `todonotes` and `footnote` support
+## Customising `todonotes` and `footnote` colours
 
-Unfortunately, VSCode does not appear to let extensions contribute token colours
-for syntax highlighting. Therefore, to enable syntax highlighting for `\todo` and
-`\footnote`, add the following (with possibly customised colours) to your user
-`settings.json` (Cmd+Shift+P, “Open Settings (JSON)”):
+To customise syntax highlighting for `\todo` and `\footnote`, add the following
+(with possibly customised colours) to your user `settings.json`
+(Cmd+Shift+P, “Open Settings (JSON)”):
 
 ```json
 "editor.tokenColorCustomizations": {
@@ -43,6 +39,8 @@
 }
 ```
 
+## Initial-prefixed todo-notes
+
 Initial-prefixed `\XYtodo` custom todonotes commands are also supported.
 For example, `\lstodo{a latex-syntax todo}` will be highlighted if you do
 the above colour customisations and in your LaTeX source define
--- a/package.json	Thu May 14 17:45:50 2020 -0500
+++ b/package.json	Wed May 13 15:17:53 2020 -0500
@@ -83,6 +83,42 @@
                     "meta.embedded.block.latex": "latex"
                 }
             }
-        ]
+        ],
+        "configurationDefaults": {
+            "[latexplus]": {
+                "editor.tokenColorCustomizations": {
+                    "textMateRules": [
+                        {
+                            "scope": "entity.name.todo.latex",
+                            "settings": {
+                                "foreground": "#d17000",
+                                "fontStyle": "italic"
+                            }
+                        },
+                        {
+                            "scope": "support.function.todo.latex",
+                            "settings": {
+                                "foreground": "#d17000",
+                                "fontStyle": "italic"
+                            }
+                        },
+                        {
+                            "scope": "entity.name.footnote.latex",
+                            "settings": {
+                                "foreground": "#e28000",
+                                "fontStyle": "italic"
+                            }
+                        },
+                        {
+                            "scope": "support.function.footnote.latex",
+                            "settings": {
+                                "foreground": "#e28000",
+                                "fontStyle": "italic"
+                            }
+                        }
+                    ]
+                }
+            }
+        }
     }
 }
\ No newline at end of file

mercurial