The example below shows that the symbol test`MyFunction is still in blue, which suggests that it is not defined. The color is defined in menu Edit > Preferences> Appearance > SyntaxColoring > Global symbols that have no value assigned.

context`MyFunction[x : _] := x^2
$ContextAliases["test`"] = "context`"

Symbol Coloring

How can the front-end be informed about $ContextAliases so that test`MyFunction is black instead of blue?

Note that AppendTo[$ContextPath,"context`"] does not help.


1 Answer 1


As a trying of possible solutions, there is an ad-hoc method from the definition of DeclareKnownSymbols,



enter image description here

To automate the coloring you can further build a function by

  1. get all the symbols of context`* by Names["context`*"];
  2. color them by UpdateKernelSymbolContexts;
  3. dynamically evaluate this function by monitoring Names["context`*"].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.