From afc5f4e128f17b70dd6f661394da1acfd924be14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 25 Apr 2022 01:56:00 +0800 Subject: add completion and semantic for `@cast` --- test/completion/common.lua | 24 ++++++++++++++++++++++++ test/definition/luadoc.lua | 6 ++++++ 2 files changed, 30 insertions(+) (limited to 'test') diff --git a/test/completion/common.lua b/test/completion/common.lua index 1fc37bb5..613f9b0c 100644 --- a/test/completion/common.lua +++ b/test/completion/common.lua @@ -3324,3 +3324,27 @@ x.y. kind = define.CompletionItemKind.Field, } } + +TEST [[ +local xyz + +---@cast +]] +{ + { + label = 'xyz', + kind = define.CompletionItemKind.Variable, + }, +} + +TEST [[ +local xyz + +---@cast x +]] +{ + { + label = 'xyz', + kind = define.CompletionItemKind.Variable, + } +} diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua index 19b4421b..47859b15 100644 --- a/test/definition/luadoc.lua +++ b/test/definition/luadoc.lua @@ -893,3 +893,9 @@ TEST [[ ---@type XXX<> ]] + +TEST [[ +local + +---@cast integer +]] -- cgit v1.2.3