Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completion for Qute expression doesn't work when expression is not closed. #885

Open
angelozerr opened this issue Jun 13, 2023 · 0 comments

Comments

@angelozerr
Copy link
Contributor

Given this template:

{@String[] items}
{#for item in items}
	{i|
{/for}

Open completion after {i, completions shows nothing, but LSP traces of completion returns something. I suspect it is a matter of text edit which is not computed correcty of filter text?

If exression is closed {i|} it works.

I tested that with vscode and IJ.

Here th LSP trace:

Result: {
    "isIncomplete": false,
    "items": [
        {
            "label": "config:integer(propertyName : String) : Object",
            "kind": 3,
            "sortText": "Zcconfig:integer(propertyName : String) : Object",
            "filterText": "config:integer",
            "insertTextFormat": 2,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "config:integer(${1:propertyName})$0"
            }
        },
        {
            "label": "config:property(propertyName : String) : Object",
            "kind": 3,
            "sortText": "Zcconfig:property(propertyName : String) : Object",
            "filterText": "config:property",
            "insertTextFormat": 2,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "config:property(${1:propertyName})$0"
            }
        },
        {
            "label": "item_isLast",
            "kind": 14,
            "detail": "`isLast` - true if hasNext == false",
            "sortText": "Zaitem_isLast",
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "item_isLast"
            }
        },
        {
            "label": "str:fmt(ignoredPropertyName : String, format : String, args : Object...) : String",
            "kind": 3,
            "sortText": "Zcstr:fmt(ignoredPropertyName : String, format : String, args : Object...) : String",
            "filterText": "str:fmt",
            "insertTextFormat": 2,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "str:fmt(${1:ignoredPropertyName}, ${2:format}, ${3:args})$0"
            }
        },
        {
            "label": "item_indexParity",
            "kind": 14,
            "detail": "`indexParity` - outputs `odd` or `even` based on the zero-based index value",
            "sortText": "Zaitem_indexParity",
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "item_indexParity"
            }
        },
        {
            "label": "item_count",
            "kind": 14,
            "detail": "`count` - 1-based index",
            "sortText": "Zaitem_count",
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "item_count"
            }
        },
        {
            "label": "str:fmt(ignoredPropertyName : String, locale : Locale, format : String, args : Object...) : String",
            "kind": 3,
            "sortText": "Zcstr:fmt(ignoredPropertyName : String, locale : Locale, format : String, args : Object...) : String",
            "filterText": "str:fmt",
            "insertTextFormat": 2,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "str:fmt(${1:ignoredPropertyName}, ${2:locale}, ${3:format}, ${4:args})$0"
            }
        },
        {
            "label": "time:format(dateTimeObject : Object, pattern : String, locale : Locale) : String",
            "kind": 3,
            "sortText": "Zctime:format(dateTimeObject : Object, pattern : String, locale : Locale) : String",
            "filterText": "time:format",
            "insertTextFormat": 2,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "time:format(${1:dateTimeObject}, ${2:pattern}, ${3:locale})$0"
            }
        },
        {
            "label": "item_index",
            "kind": 14,
            "detail": "`index` - zero-based index",
            "sortText": "Zaitem_index",
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "item_index"
            }
        },
        {
            "label": "config:boolean(propertyName : String) : Object",
            "kind": 3,
            "sortText": "Zcconfig:boolean(propertyName : String) : Object",
            "filterText": "config:boolean",
            "insertTextFormat": 2,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "config:boolean(${1:propertyName})$0"
            }
        },
        {
            "label": "item_even",
            "kind": 14,
            "detail": "`even` - true if the zero-based index is even",
            "sortText": "Zaitem_even",
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "item_even"
            }
        },
        {
            "label": "items",
            "kind": 18,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "items"
            }
        },
        {
            "label": "item_hasNext",
            "kind": 14,
            "detail": "`hasNext` - true if the iteration has more elements",
            "sortText": "Zaitem_hasNext",
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "item_hasNext"
            }
        },
        {
            "label": "item",
            "kind": 18,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "item"
            }
        },
        {
            "label": "time:format(dateTimeObject : Object, pattern : String) : String",
            "kind": 3,
            "sortText": "Zctime:format(dateTimeObject : Object, pattern : String) : String",
            "filterText": "time:format",
            "insertTextFormat": 2,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "time:format(${1:dateTimeObject}, ${2:pattern})$0"
            }
        },
        {
            "label": "item_isFirst",
            "kind": 14,
            "detail": "`isFirst` - true if count == 1",
            "sortText": "Zaitem_isFirst",
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "item_isFirst"
            }
        },
        {
            "label": "inject:vertxRequest",
            "kind": 5,
            "sortText": "Zbinject:vertxRequest",
            "filterText": "inject:vertxRequest",
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "inject:vertxRequest"
            }
        },
        {
            "label": "time:format(dateTimeObject : Object, pattern : String, locale : Locale, timeZone : ZoneId) : String",
            "kind": 3,
            "sortText": "Zctime:format(dateTimeObject : Object, pattern : String, locale : Locale, timeZone : ZoneId) : String",
            "filterText": "time:format",
            "insertTextFormat": 2,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "time:format(${1:dateTimeObject}, ${2:pattern}, ${3:locale}, ${4:timeZone})$0"
            }
        },
        {
            "label": "config:*(propertyName : String) : Object",
            "kind": 3,
            "sortText": "Zcconfig:*(propertyName : String) : Object",
            "filterText": "config:*",
            "insertTextFormat": 2,
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "config:${1:propertyName}$0"
            }
        },
        {
            "label": "item_odd",
            "kind": 14,
            "detail": "`odd` - true if the zero-based index is odd",
            "sortText": "Zaitem_odd",
            "textEdit": {
                "range": {
                    "start": {
                        "line": 2,
                        "character": 2
                    },
                    "end": {
                        "line": 3,
                        "character": 5
                    }
                },
                "newText": "item_odd"
            }
        }
    ]
}
@angelozerr angelozerr changed the title Completion for Qute expression doesn't work wen expression is not closed. Completion for Qute expression doesn't work when expression is not closed. Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant