private CodeAction fixDocumentReferenceAttribute(EventCodeActionContext context, Diagnostic diagnostic) {
        Node fieldIdentifierNode = CSTUtils.getSymbolAtPosition(context.document.getRootNode(), context.position);
        if (fieldIdentifierNode == null) return null;

        // TODO: maybe append to existing indexing script if possible
        //       Also works poorly for fields outside document, since their indexing scripts require input.
        Position insertPosition = firstPositionInBlock(fieldIdentifierNode.getParent());
        if (insertPosition == null)return null;

        CodeAction action = basicQuickFix("Set indexing to 'attribute' for field " + fieldIdentifierNode.getSymbol().getShortIdentifier(), diagnostic);

        String indentString = StringUtils.getIndentString(context.document.getCurrentContent(),fieldIdentifierNode.getParent());
        int indent = StringUtils.countSpaceIndents(indentString);

        action.setEdit(CodeActionUtils.simpleEdit(context, new Range(insertPosition, insertPosition), 
            "\n" + StringUtils.spaceIndent(indent + StringUtils.TAB_SIZE) + 
            "indexing: attribute\n" + StringUtils.spaceIndent(indent)
        ));

        return action;
    }
Provides quick fix for 'field foo type reference&lt;document&gt;' and forgot to put indexing: attribute.
@param context
@param diagnostic
@return The CodeAction providing the quick fix.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/lsp/schema/codeaction/provider/QuickFixProvider.java