private CodeAction fixFieldArgumentMissingIndexingType(EventCodeActionContext context, Diagnostic diagnostic) {

        Node offendingNode = CSTUtils.getSymbolAtPosition(context.document.getRootNode(), context.position);
        if (offendingNode == null || !offendingNode.hasSymbol()) return null;
        Optional<Symbol> symbol = context.schemaIndex.findSymbol(offendingNode.getSymbol());
        if (symbol.isEmpty()) return null;

        Node node = symbol.get().getNode().getParent();

        Optional<Node> indexingNode = Optional.empty();
        for (Node child : node) {
            if (child.isASTInstance(fieldBodyElm.class)) {
                Node grandChild = child.get(0);
                if (grandChild != null && grandChild.isASTInstance(indexingElm.class)) {
                    indexingNode = Optional.of(grandChild);
                }
            }
        }

        CodeAction action = basicQuickFix("Add attribute as indexing attribute", diagnostic);

        if (indexingNode.isPresent()) {
            action.setEdit(CodeActionUtils.simpleEdit(context, indexingNode.get().getRange().getEnd(), " | attribute"));

        } else {
            // Add indexing node as well
            Optional<Node> rBraceNode = Optional.empty();

            for (int i = 0; i < node.size(); i++) {
                Node child = node.get(i);
                if (child.isASTInstance(RBRACE.class)) {
                    rBraceNode = Optional.of(child);
                    break;
                }
            }

            if (rBraceNode.isEmpty()) return null;

            // Calculate indent
            Node fieldKeywordNode = node.get(0);
            if (fieldKeywordNode == null) return null;

            String insertIndentString = StringUtils.getIndentString(context.document.getCurrentContent(), fieldKeywordNode);
            int indent = StringUtils.countSpaceIndents(insertIndentString);

            String newText = StringUtils.spaceIndent(StringUtils.TAB_SIZE) + "indexing: attribute\n" + StringUtils.spaceIndent(indent);

            // Check is a leading new line is necessary
            Node prevSibling = rBraceNode.get().getPrevious();
            if (prevSibling == null) return null;
            boolean newLineNecessary = false;
            if (!prevSibling.isASTInstance(NL.class)) {
                if (prevSibling.isASTInstance(openLbrace.class)) {
                    Node lastLbraceChild = prevSibling.get(prevSibling.size() - 1);
                    if (!lastLbraceChild.isASTInstance(NL.class)) {
                        newLineNecessary = true;
                    }
                } else {
                    newLineNecessary = true;
                }
            }

            if (newLineNecessary) {
                newText = "\n" + StringUtils.spaceIndent(indent) + newText;
            }

            action.setEdit(CodeActionUtils.simpleEdit(context, rBraceNode.get().getRange().getStart(), newText));
        }

        return action;
    }
Quick fix for using attribute some_name_other_than_field_name in a field. Will create a new field outside 
the document with the specified attribute, using the original field as input and type.
@param context
@param diagnostic
@param code
@return CodeAction supplying the edits.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/lsp/schema/codeaction/provider/QuickFixProvider.java