private boolean isInsideTensor(EventCompletionContext context) {
        Node lastClean = CSTUtils.getLastCleanNode(context.document.getRootNode(), context.position);

        if (!lastClean.getText().startsWith("tensor")) return false;

        String content = context.document.getCurrentContent();
        int offset = StringUtils.positionToOffset(content, context.position) - 1;
        for (int i = offset; i >= offset - 20; --i) {
            if (content.charAt(i) == '>') return false;
            if (content.charAt(i) == '<') return true;
        }
        return false;
    }
For completing types for a field, as well as type parameters in tensor types. 
Field types include user defined structs.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/lsp/schema/completion/provider/TypeCompletion.java