@Override
	public void fieldLocationChanged(FieldLocation location, Field field, EventTrigger trigger) {

		clearPrimaryHighlights();

		if (!(field instanceof ClangTextField)) {
			return;
		}

		ClangToken tok = ((ClangTextField) field).getToken(location);
		if (tok == null) {
			return;
		}

		String text = tok.getText();
		if (StringUtils.isBlank(text)) {
			return; // do not highlight whitespace
		}

		if (tok instanceof ClangOpToken) { // e.g., '='
			return;
		}

		if (tok instanceof ClangSyntaxToken) {

			int type = tok.getSyntaxType();
			if (type == ClangToken.GLOBAL_COLOR) {
				// namespaces can fit this case sometimes
				addPrimaryHighlight(tok, defaultHighlightColor);
			}

			addPrimaryHighlightToTokensForParenthesis((ClangSyntaxToken) tok, defaultParenColor);
			addPrimaryHighlightToTokensForBrace((ClangSyntaxToken) tok, defaultParenColor);
		}
		else {
			addPrimaryHighlight(tok, defaultHighlightColor);
		}
	}
Class to handle location based highlights for a decompiled function.
Ghidra/Features/Decompiler/src/main/java/ghidra/app/decompiler/component/LocationClangHighlightController.java