@Override
	public void domainObjectChanged(DomainObjectChangedEvent event) {
		if (!isVisible()) {
			return;
		}

		if (isEmpty()) {
			return; // nothing to update
		}

		if (event.contains(DomainObjectEvent.RESTORED)) {
			setStale(true);
			return;
		}

		for (int i = 0; i < event.numRecords(); i++) {
			DomainObjectChangeRecord domainObjectRecord = event.getChangeRecord(i);
			ProgramEvent eventType = (ProgramEvent) domainObjectRecord.getEventType();

			switch (eventType) {
				case MEMORY_BLOCK_MOVED:
				case MEMORY_BLOCK_REMOVED:
				case SYMBOL_ADDED:
				case SYMBOL_REMOVED:
				case REFERENCE_ADDED:
				case REFERENCE_REMOVED:
					setStale(true);
					break;
				case SYMBOL_RENAMED:
					Symbol symbol = (Symbol) ((ProgramChangeRecord) domainObjectRecord).getObject();
					if (!(symbol instanceof FunctionSymbol)) {
						break;
					}

					FunctionSymbol functionSymbol = (FunctionSymbol) symbol;
					Function function = (Function) functionSymbol.getObject();
					if (updateRootNodes(function)) {
						return; // the entire tree will be rebuilt
					}

					inTree.runTask(new UpdateFunctionNodeTask(inTree, function));
					outTree.runTask(new UpdateFunctionNodeTask(outTree, function));
					break;
				default:
					break;
			}
		}
	}
NB: This is key as well.

this is called in the doSetFunction method
Ghidra/Features/DecompilerDependent/src/main/java/ghidra/app/plugin/core/decompiler/taint/TaintSliceTreeProvider.java