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

        Node referenceFieldNode = offendingNode.getPreviousSibling();

        if (referenceFieldNode == null)return null;
        if (!referenceFieldNode.hasSymbol()) return null;


        String newFieldName = referenceFieldNode.getSymbol().getShortIdentifier() + "_" + offendingNode.getSymbol().getShortIdentifier();

        Node rootSchemaItemNode = findRootSchemaItemNode(offendingNode);
        if (rootSchemaItemNode == null) return null; // likely inside a rootDocument, where import field is impossible

        Position insertPosition = rootSchemaItemNode.getRange().getEnd();
        String indentString = StringUtils.getIndentString(context.document.getCurrentContent(), rootSchemaItemNode);
        int indent = StringUtils.countSpaceIndents(indentString);

        if (rootSchemaItemNode.getPreviousSibling() != null)insertPosition = rootSchemaItemNode.getPreviousSibling().getRange().getEnd();

        CodeAction action = basicQuickFix("Import field " + offendingNode.getSymbol().getShortIdentifier(), diagnostic);

        action.setEdit(CodeActionUtils.simpleEditList(context, List.of(
            new TextEdit(new Range(insertPosition, insertPosition), 
                StringUtils.spaceIndent(indent) +
                "import field " + referenceFieldNode.getSymbol().getShortIdentifier() + "." + 
                                       offendingNode.getSymbol().getShortIdentifier() + " as " +
                                       newFieldName + " {} \n\n"),
            new TextEdit(CSTUtils.unionRanges(offendingNode.getRange(), referenceFieldNode.getRange()), newFieldName)
        )));

        return action;
    }
Provides quick fix for trying to do dot syntax on a reference field. 
@param context
@param diagnostic
@return A CodeAction which will provide an import field statement and rename the field access.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/lsp/schema/codeaction/provider/QuickFixProvider.java