private CodeAction fixImportFieldAttribute(EventCodeActionContext context, Diagnostic diagnostic) {

        Node importReferenceNode = CSTUtils.getSymbolAtPosition(context.document.getRootNode(), context.position);
        if (importReferenceNode == null) return null;

        Symbol referenceSymbol = importReferenceNode.getSymbol();

        Optional<Symbol> definitionSymbol = context.schemaIndex.getSymbolDefinition(referenceSymbol);

        if (definitionSymbol.isEmpty()) return null;

        Node definitionFieldElm = definitionSymbol.get().getNode().getParent();

        DocumentManager definitionDocument = context.scheduler.getDocument(definitionSymbol.get().getFileURI());

        Position insertPosition = firstPositionInBlock(definitionFieldElm);
        CodeAction action = basicQuickFix("Set indexing to 'attribute' for field " + definitionSymbol.get().getLongIdentifier(), diagnostic);

        String indentString = StringUtils.getIndentString(definitionDocument.getCurrentContent(), definitionFieldElm);
        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),
            definitionDocument
        ));

        return action;
    }
Provides quick fix for importing a field that is not an attribute.
@param context
@param diagnostic
@return A CodeAction that will set indexing to attribute for the original field.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/lsp/schema/codeaction/provider/QuickFixProvider.java