private boolean match(EventCompletionContext context) {
        SchemaDocumentLexer lexer = context.document.lexer();
        SchemaNode match = lexer.matchBackwards(context.position, 1, false, TokenType.FIELD, TokenType.IDENTIFIER, TokenType.TYPE);
        if (match != null && match.getRange().getStart().getLine() == context.position.getLine()) {
            return true;
        }
        match = lexer.matchBackwards(context.position, 1, false, TokenType.FIELD, TokenType.IDENTIFIER, TokenType.TYPE, TokenType.IDENTIFIER);
        if (match != null && match.getRange().getStart().getLine() == context.position.getLine()) {
            return true;
        }

        for (TokenType tokenType : compoundTypes) {
            match = lexer.matchBackwards(context.position, 3, true, tokenType, TokenType.LESSTHAN);
            if (match != null && match.getRange().getStart().getLine() == context.position.getLine())return true;

            // Dirty gt symbols are inserted when incomplete type is written
            match = lexer.tokenAtOrBeforePosition(context.position, false);
            if (match != null && match.getDirtyType() == TokenType.GREATERTHAN && match.getIsDirty())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