Code review comment: What would be the consequence if we try to depend on the node kind instance of code action node kind?

Code under review:
public static CodeActionNodeType codeActionNodeType(Node node) {
        if (node == null) {
            return CodeActionNodeType.NONE;
        }
        switch (node.kind()) {
            case SERVICE_DECLARATION:
                return CodeActionNodeType.SERVICE;
            case FUNCTION_DEFINITION:
                if (node.parent().kind() == SyntaxKind.SERVICE_DECLARATION) {
                    return CodeActionNodeType.RESOURCE;
                } else {
                    return CodeActionNodeType.FUNCTION;
                }
            case TYPE_DEFINITION:
                Node typeDesc = ((TypeDefinitionNode) node).typeDescriptor();
                if (typeDesc.kind() == SyntaxKind.RECORD_TYPE_DESC) {
                    return CodeActionNodeType.RECORD;
                } else if (typeDesc.kind() == SyntaxKind.OBJECT_TYPE_DESC) {
                    return CodeActionNodeType.OBJECT;
                }
                return CodeActionNodeType.NONE;
            case METHOD_DECLARATION:
                return CodeActionNodeType.OBJECT_FUNCTION;
            case CLASS_DEFINITION:
                return CodeActionNodeType.CLASS;
            case OBJECT_METHOD_DEFINITION:
                return CodeActionNodeType.CLASS_FUNCTION;
            case IMPORT_DECLARATION:
                return CodeActionNodeType.IMPORTS;
            case LOCAL_VAR_DECL:
                return CodeActionNodeType.LOCAL_VARIABLE;
            case MODULE_VAR_DECL:
                return CodeActionNodeType.MODULE_VARIABLE;
            case ASSIGNMENT_STATEMENT:
                return CodeActionNodeType.ASSIGNMENT;
            default:
                return CodeActionNodeType.NONE;
        }
    }

Line commented on: case SERVICE_DECLARATION:

Revised code:
public static CodeActionNodeType codeActionNodeType(Node node) {
        if (node == null) {
            return CodeActionNodeType.NONE;
        }
        switch (node.kind()) {
            case SERVICE_DECLARATION:
                return CodeActionNodeType.SERVICE;
            case FUNCTION_DEFINITION:
                if (node.parent().kind() == SyntaxKind.SERVICE_DECLARATION) {
                    return CodeActionNodeType.RESOURCE;
                } else {
                    return CodeActionNodeType.FUNCTION;
                }
            case TYPE_DEFINITION:
                Node typeDesc = ((TypeDefinitionNode) node).typeDescriptor();
                if (typeDesc.kind() == SyntaxKind.RECORD_TYPE_DESC) {
                    return CodeActionNodeType.RECORD;
                } else if (typeDesc.kind() == SyntaxKind.OBJECT_TYPE_DESC) {
                    return CodeActionNodeType.OBJECT;
                }
                return CodeActionNodeType.NONE;
            case METHOD_DECLARATION:
                return CodeActionNodeType.OBJECT_FUNCTION;
            case CLASS_DEFINITION:
                return CodeActionNodeType.CLASS;
            case OBJECT_METHOD_DEFINITION:
                return CodeActionNodeType.CLASS_FUNCTION;
            case IMPORT_DECLARATION:
                return CodeActionNodeType.IMPORTS;
            case LOCAL_VAR_DECL:
                return CodeActionNodeType.LOCAL_VARIABLE;
            case MODULE_VAR_DECL:
                return CodeActionNodeType.MODULE_VARIABLE;
            case ASSIGNMENT_STATEMENT:
                return CodeActionNodeType.ASSIGNMENT;
            default:
                return CodeActionNodeType.NONE;
        }
    }