Code review comment: Let's keep this since there are multiple variables assigned inside the logic.

Code under review:
public void visit(TypeDefinitionNode typeDefinitionNode) {
        int type = TokenTypes.TYPE.getId();
        int modifiers = 0;
        int refModifiers = 0;
        Node typeDescriptor = typeDefinitionNode.typeDescriptor();
        switch (typeDescriptor.kind()) {
            case OBJECT_TYPE_DESC:
                type = TokenTypes.INTERFACE.getId();
                modifiers = TokenTypeModifiers.DECLARATION.getId();
                break;
            case RECORD_TYPE_DESC:
                type = TokenTypes.STRUCT.getId();
                modifiers = TokenTypeModifiers.DECLARATION.getId();
                break;
            case INTERSECTION_TYPE_DESC:
                if (typeDescriptor instanceof IntersectionTypeDescriptorNode) {
                    IntersectionTypeDescriptorNode intSecDescriptor = (IntersectionTypeDescriptorNode) typeDescriptor;
                    SyntaxKind left = intSecDescriptor.leftTypeDesc().kind();
                    SyntaxKind right = intSecDescriptor.rightTypeDesc().kind();
                    if (left == SyntaxKind.RECORD_TYPE_DESC || right == SyntaxKind.RECORD_TYPE_DESC) {
                        type = TokenTypes.STRUCT.getId();
                    }
                    if (left == SyntaxKind.READONLY_TYPE_DESC || right == SyntaxKind.READONLY_TYPE_DESC) {
                        modifiers = TokenTypeModifiers.DECLARATION.getId() | TokenTypeModifiers.READONLY.getId();
                        refModifiers = TokenTypeModifiers.READONLY.getId();
                    } else {
                        modifiers = TokenTypeModifiers.DECLARATION.getId();
                    }
                }
                break;
            default:
                type = TokenTypes.TYPE.getId();
                modifiers = TokenTypeModifiers.DECLARATION.getId();
                break;
        }
        this.addSemanticToken(typeDefinitionNode.typeName(), type, modifiers, true, type, refModifiers);
        visitSyntaxNode(typeDefinitionNode);
    }

Line commented on: refModifiers = TokenTypeModifiers.READONLY.getId();

Revised code:
public void visit(TypeDefinitionNode typeDefinitionNode) {
        int type = TokenTypes.TYPE.getId();
        int modifiers = 0;
        int refModifiers = 0;
        Node typeDescriptor = typeDefinitionNode.typeDescriptor();
        switch (typeDescriptor.kind()) {
            case OBJECT_TYPE_DESC:
                type = TokenTypes.INTERFACE.getId();
                modifiers = TokenTypeModifiers.DECLARATION.getId();
                break;
            case RECORD_TYPE_DESC:
                type = TokenTypes.STRUCT.getId();
                modifiers = TokenTypeModifiers.DECLARATION.getId();
                break;
            case INTERSECTION_TYPE_DESC:
                if (typeDescriptor instanceof IntersectionTypeDescriptorNode) {
                    IntersectionTypeDescriptorNode intSecDescriptor = (IntersectionTypeDescriptorNode) typeDescriptor;
                    SyntaxKind left = intSecDescriptor.leftTypeDesc().kind();
                    SyntaxKind right = intSecDescriptor.rightTypeDesc().kind();
                    if (left == SyntaxKind.RECORD_TYPE_DESC || right == SyntaxKind.RECORD_TYPE_DESC) {
                        type = TokenTypes.STRUCT.getId();
                    }
                    if (left == SyntaxKind.READONLY_TYPE_DESC || right == SyntaxKind.READONLY_TYPE_DESC) {
                        modifiers = TokenTypeModifiers.DECLARATION.getId() | TokenTypeModifiers.READONLY.getId();
                        refModifiers = TokenTypeModifiers.READONLY.getId();
                    } else {
                        modifiers = TokenTypeModifiers.DECLARATION.getId();
                    }
                }
                break;
            default:
                type = TokenTypes.TYPE.getId();
                modifiers = TokenTypeModifiers.DECLARATION.getId();
                break;
        }
        this.addSemanticToken(typeDefinitionNode.typeName(), type, modifiers, true, type, refModifiers);
        visitSyntaxNode(typeDefinitionNode);
    }