, LuaDocTyStub {
24 | val visibility: Visibility
25 | val isDeprecated: Boolean
26 | }
--------------------------------------------------------------------------------
/src/main/java/com/korioz/intellij/lua/stubs/LuaDocTyStub.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022. Korioz(45950144+Korioz@users.noreply.github.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.korioz.intellij.lua.stubs
18 |
19 | import com.korioz.intellij.lua.ty.ITy
20 |
21 | interface LuaDocTyStub {
22 | val docTy: ITy?
23 | }
--------------------------------------------------------------------------------
/src/main/java/com/korioz/intellij/lua/ty/LuaTypeInfer.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022. Korioz(45950144+Korioz@users.noreply.github.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.korioz.intellij.lua.ty
18 |
19 | import com.korioz.intellij.lua.ext.ILuaTypeInfer
20 | import com.korioz.intellij.lua.psi.LuaTypeGuessable
21 | import com.korioz.intellij.lua.search.SearchContext
22 |
23 | class LuaTypeInfer : ILuaTypeInfer {
24 | override fun inferType(target: LuaTypeGuessable, context: SearchContext): ITy {
25 | return inferInner(target, context)
26 | }
27 | }
--------------------------------------------------------------------------------
/src/main/resources/!!DONT_UNZIP_ME!!.txt:
--------------------------------------------------------------------------------
1 | Don't unzip me! Please install EmmyLua plugin use this whole zip file.
--------------------------------------------------------------------------------
/src/main/resources/META-INF/emmylua-project.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/main/resources/codeStyle/preview/preview.lua.template:
--------------------------------------------------------------------------------
1 | local inlineEmmy = { name = "Emmy", age = 7, longLongProperty = 123 }
2 | local emmy = {
3 | name = "Emmy",
4 | age = 7,
5 | longLongProperty = 123
6 | }
7 | local a = 1
8 | local b, c = 2, "3"
9 | local var = 1 -- a short comment
10 | --- doc comment
11 | --- @param par1 Par1Type @some strings
12 | function var:testFun(par1, par2, par3, par4, par5)
13 | print('hello')
14 | return self.len + 2
15 | end
16 |
17 | var:testFun('par1Value', 'par2Value', 'par3Value', 'par4Value', 'par5Value')
18 |
19 | function globalFun()
20 | return "string" .. var
21 | end
22 |
23 | if true then return 123 end
24 |
25 | if true then print("123") return 123 end
--------------------------------------------------------------------------------
/src/main/resources/debugger/emmy/linux/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/debugger/emmy/linux/.gitkeep
--------------------------------------------------------------------------------
/src/main/resources/debugger/emmy/mac/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/debugger/emmy/mac/.gitkeep
--------------------------------------------------------------------------------
/src/main/resources/debugger/emmy/unix/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/debugger/emmy/unix/.gitkeep
--------------------------------------------------------------------------------
/src/main/resources/debugger/emmy/windows/x64/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/debugger/emmy/windows/x64/.gitkeep
--------------------------------------------------------------------------------
/src/main/resources/debugger/emmy/windows/x86/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/debugger/emmy/windows/x86/.gitkeep
--------------------------------------------------------------------------------
/src/main/resources/debugger/windows/x64/EasyHook.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/debugger/windows/x64/EasyHook.dll
--------------------------------------------------------------------------------
/src/main/resources/debugger/windows/x64/dbghelp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/debugger/windows/x64/dbghelp.dll
--------------------------------------------------------------------------------
/src/main/resources/debugger/windows/x86/EasyHook.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/debugger/windows/x86/EasyHook.dll
--------------------------------------------------------------------------------
/src/main/resources/debugger/windows/x86/dbghelp.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/debugger/windows/x86/dbghelp.dll
--------------------------------------------------------------------------------
/src/main/resources/errorreporting/report-bundle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2022. Korioz(45950144+Korioz@users.noreply.github.com)
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 | #
16 |
17 | report.error.to.plugin.vendor=Report on GitHub
18 | report.error.progress.dialog.text=Submitting error report...
19 | report.error.connection.failure=Could not communicate with GitHub
20 |
21 | git.issue.title=[auto-generated:{0}] {1}
22 | git.issue.label=auto-generated
23 | git.issue.text=Created issue {1}. Thanks for your feedback!
24 | git.issue.duplicate.text=A similar issues was already reported (#{1}). Thanks for your feedback!
25 |
26 |
--------------------------------------------------------------------------------
/src/main/resources/errorreporting/token.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/errorreporting/token.bin
--------------------------------------------------------------------------------
/src/main/resources/fileTemplates/j2ee/NewLua.lua.ft:
--------------------------------------------------------------------------------
1 | ---
2 | --- Generated by EmmyLua(https://github.com/EmmyLua)
3 | --- Created by ${USER}.
4 | --- DateTime: ${DATE} ${TIME}
5 | ---
--------------------------------------------------------------------------------
/src/main/resources/icons/annotation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/annotation.png
--------------------------------------------------------------------------------
/src/main/resources/icons/annotation@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/annotation@2x.png
--------------------------------------------------------------------------------
/src/main/resources/icons/console.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/icons/console_dark.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/icons/cpp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/cpp.png
--------------------------------------------------------------------------------
/src/main/resources/icons/cpp.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/main/resources/icons/cpp@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/cpp@2x.png
--------------------------------------------------------------------------------
/src/main/resources/icons/csharp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/csharp.png
--------------------------------------------------------------------------------
/src/main/resources/icons/csharp.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/src/main/resources/icons/csharp@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/csharp@2x.png
--------------------------------------------------------------------------------
/src/main/resources/icons/frame.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/src/main/resources/icons/frame_dark.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/src/main/resources/icons/lua.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/lua.png
--------------------------------------------------------------------------------
/src/main/resources/icons/lua.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/main/resources/icons/lua@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/lua@2x.png
--------------------------------------------------------------------------------
/src/main/resources/icons/lua_layer.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
--------------------------------------------------------------------------------
/src/main/resources/icons/lua_module.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
--------------------------------------------------------------------------------
/src/main/resources/icons/lua_project.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
20 |
--------------------------------------------------------------------------------
/src/main/resources/icons/lua_root.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
16 |
--------------------------------------------------------------------------------
/src/main/resources/icons/meta.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/meta.png
--------------------------------------------------------------------------------
/src/main/resources/icons/meta.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/src/main/resources/icons/meta@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/meta@2x.png
--------------------------------------------------------------------------------
/src/main/resources/icons/module.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/module.png
--------------------------------------------------------------------------------
/src/main/resources/icons/module@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/module@2x.png
--------------------------------------------------------------------------------
/src/main/resources/icons/tail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/tail.png
--------------------------------------------------------------------------------
/src/main/resources/icons/tail@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/main/resources/icons/tail@2x.png
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/AssignTypeInspection.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Assign type
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/DuplicateClassDeclaration.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Duplicate class
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/EmptyBody.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Write your description here.
20 |
21 | Text after this comment will not be shown in tooltips.
22 |
23 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/GlobalNameCanbeLocal.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Global name can be local
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/LanguageLevelInspection.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | The following binary/unary operators only available Lua 5.2 or above.
20 |
21 | binary operators: '|', '&', '>>', '<<', '~', '//'
22 |
23 | unary operators: '~'
24 |
25 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/LocalNameShadowed.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/LuaDeprecationInspection.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/MatchFunctionSignatureInspection.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Type safety
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/RemoveUnusedLocal.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Write your description here.
20 |
21 | Text after this comment will not be shown in tooltips.
22 |
23 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/ReturnTypeInspection.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Return type
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/SimplifyLocalAssignment.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Local Assign can be simpler
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/UndeclaredVariableInspection.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Undeclared variable
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/inspectionDescriptions/UnresolvedClassInspection.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Unresolved type in emmy doc
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/AppendCallParenIntention/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Append paren to call expression
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/ComputeConstantValueIntention/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Compute Constant Value
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/CreateFieldFromParameterIntention/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Write your description here.
20 |
21 | Text after this comment will not be shown in tooltips.
22 |
23 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/CreateFunctionDocIntention/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Create Doc For Method
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/CreateFunctionReturnAnnotationIntention/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | CreateFunctionReturnAnnotationIntentionAction
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/CreateMethodIntention/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Create method.
20 |
21 | Create method.
22 |
23 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/CreateParameterAnnotationIntention/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Create doc for param
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/CreateTypeAnnotationIntention/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Create type declaration
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/InvertBooleanIntention/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Invert boolean value
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/RemoveCallParenIntention/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Remove paren from call expression
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/SetVisibilityIntention/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaCheckIfNotNilPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | if expr ~= nil then
2 |
3 | end
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaCheckIfNotNilPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaCheckIfNotNilPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | if expr ~= nil then
20 | end
21 |
22 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaCheckNilPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | if expr == nil then
2 |
3 | end
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaCheckNilPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaCheckNilPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | if expr == nil then
20 | end
21 |
22 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaDecreasePostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | expr = expr - 1
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaDecreasePostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaDecreasePostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Decrease values "expr = expr - 1"
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaForAPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | for i = 1, expr do
2 |
3 | end
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaForAPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaForAPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | for i = 1, expr do end
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaForIPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | for i, v in ipairs(expr) do
2 |
3 | end
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaForIPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaForIPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | for i, v in ipairs(expr) do
20 | end
21 |
22 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaForPPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | for k, v in pairs(expr) do
2 |
3 | end
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaForPPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaForPPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | for i, v in pairs(expr) do
20 | end
21 |
22 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaIfNotPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | if not expr then
2 |
3 | end
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaIfNotPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaIfNotPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | if not expr then
20 | end
21 |
22 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaIfPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | if expr then
2 |
3 | end
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaIfPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaIfPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | if expr then
20 | end
21 |
22 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaIncreasePostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | expr = expr + 1
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaIncreasePostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaIncreasePostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Increase values, "expr = expr + 1"
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaLocalPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | local test = expr
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaLocalPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaLocalPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Creates variable from given expression.
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaParPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | (expr)
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaParPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaParPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | Parenthesizes expression.
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaPrintPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | print(expr)
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaPrintPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaPrintPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | print(expr)
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaReturnPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | return expr
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaReturnPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaReturnPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | return expr
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaToNumberPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | tonumber(expr)
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaToNumberPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaToNumberPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | tonumber(expr)
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaToStringPostfixTemplate/after.lua.template:
--------------------------------------------------------------------------------
1 | tostring(expr)
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaToStringPostfixTemplate/before.lua.template:
--------------------------------------------------------------------------------
1 | expr$key
--------------------------------------------------------------------------------
/src/main/resources/postfixTemplates/LuaToStringPostfixTemplate/description.html:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 | tostring(expr)
20 |
21 |
--------------------------------------------------------------------------------
/src/main/resources/spellchecker/lua.dic:
--------------------------------------------------------------------------------
1 | acos
2 | asin
3 | atan
4 | collectgarbage
5 | coroutine
6 | cpath
7 | difftime
8 | dofile
9 | fmod
10 | frexp
11 | getfenv
12 | gethook
13 | getinfo
14 | getmetatable
15 | getregistry
16 | getupvalue
17 | gmatch
18 | gsub
19 | ipairs
20 | ldexp
21 | loadfile
22 | loadlib
23 | loadstring
24 | maxn
25 | metatable
26 | modf
27 | newindex
28 | pcall
29 | popen
30 | randomseed
31 | rawequal
32 | rawget
33 | rawset
34 | seeall
35 | setfenv
36 | sethook
37 | setlocal
38 | setlocale
39 | setmetatable
40 | setupvalue
41 | setuservalue
42 | setvbuf
43 | sinh
44 | tanh
45 | tmpfile
46 | tmpname
47 | tonumber
48 | tostring
49 | tostring
50 | traceback
51 | upvalueid
52 | upvaluejoin
53 | xpcall
--------------------------------------------------------------------------------
/src/test/kotlin/com/korioz/intellij/test/completion/TestArgHistory.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022. Korioz(45950144+Korioz@users.noreply.github.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.korioz.intellij.test.completion
18 |
19 | class TestArgHistory : TestCompletionBase() {
20 |
21 | fun `test arg history 1`() {
22 | doTest("""
23 | --- test_arg_history_1.lua
24 |
25 | local function test(strArg1, strArg2)
26 | end
27 |
28 | test("his1")
29 | test("his2")
30 | test("--[[caret]]")
31 | """) {
32 | assertTrue(it.containsAll(listOf("his1", "his2")))
33 | }
34 | }
35 |
36 | }
--------------------------------------------------------------------------------
/src/test/kotlin/com/korioz/intellij/test/completion/TestTuple.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022. Korioz(45950144+Korioz@users.noreply.github.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.korioz.intellij.test.completion
18 |
19 | class TestTuple : TestCompletionBase() {
20 |
21 | fun `test tuple 1`() {
22 | doTest("""
23 | --- test_tuple_1.lua
24 |
25 | ---@class Type1
26 | local obj = { name = "name" }
27 |
28 | ---@return number, Type1
29 | local function getTuple()
30 | end
31 |
32 | local a, b = getTuple()
33 | b.--[[caret]]
34 | """) {
35 | assertTrue("name" in it)
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/src/test/kotlin/com/korioz/intellij/test/inspections/LocalNameShadowedTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022. Korioz(45950144+Korioz@users.noreply.github.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.korioz.intellij.test.inspections
18 |
19 | import com.korioz.intellij.lua.codeInsight.inspection.LocalNameShadowed
20 |
21 | class LocalNameShadowedTest : LuaInspectionsTestBase(LocalNameShadowed()) {
22 |
23 | fun testLocalNameHidesPrevious() = checkByText("""
24 | local var1 = 1
25 | print(var1)
26 | local var1 = "123"
27 | """)
28 |
29 | }
--------------------------------------------------------------------------------
/src/test/kotlin/com/korioz/intellij/test/inspections/UndeclaredVariableTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2022. Korioz(45950144+Korioz@users.noreply.github.com)
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | /*
18 | package com.korioz.intellij.test.inspections
19 |
20 | import com.korioz.intellij.lua.codeInsight.inspection.UndeclaredVariableInspection
21 |
22 | class UndeclaredVariableTest : LuaInspectionsTestBase(UndeclaredVariableInspection()) {
23 |
24 | fun testUndeclaredVariable() = checkByText("""
25 | print(MyUndeclaredVariable)
26 | """)
27 |
28 | }*/
29 |
--------------------------------------------------------------------------------
/src/test/resources/completion/class.lua:
--------------------------------------------------------------------------------
1 | ---@class Emmy
2 | local e = { name = 'Emmy', age = 7 }
3 |
4 | function e:sayHello()
5 | print('hi')
6 | end
7 |
8 | ---@type Emmy
9 | emmy = nil
--------------------------------------------------------------------------------
/src/test/resources/completion/globals.lua:
--------------------------------------------------------------------------------
1 | gVar1 = 1
2 |
3 | gVar2 = {
4 | aaa = 2,
5 | bbb = 3
6 | }
7 | gVar2.ccc = 4
--------------------------------------------------------------------------------
/src/test/resources/completion/testAnnotationArray.lua:
--------------------------------------------------------------------------------
1 | ---@type Emmy[]
2 | local emmyList = {}
3 |
4 | local emmy = emmyList[1]
5 | emmy.
--------------------------------------------------------------------------------
/src/test/resources/completion/testAnnotationDict.lua:
--------------------------------------------------------------------------------
1 | ---@generic K, V
2 | ---@param t table|V[]
3 | ---@return fun(tbl: table):K, V
4 | function pairs(t) end
5 |
6 | ---@type fun():table
7 | local emmyCreator
8 |
9 | for k, emmy in pairs(emmyCreator()) do
10 | emmy.
11 | end
--------------------------------------------------------------------------------
/src/test/resources/completion/testAnnotationFun.lua:
--------------------------------------------------------------------------------
1 | ---@type fun():Emmy
2 | local emmyCreator
3 |
4 | local emmy = emmyCreator()
5 | emmy.
--------------------------------------------------------------------------------
/src/test/resources/completion/testAnonymous.lua:
--------------------------------------------------------------------------------
1 | local function test()
2 | local v = xx()
3 | v.pp = 123
4 | return v
5 | end
6 |
7 | local v = test()
8 | v.
--------------------------------------------------------------------------------
/src/test/resources/completion/testCompletion.lua:
--------------------------------------------------------------------------------
1 | local function func1()end
2 |
3 | local a = 2
4 | local b = 2
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/test/resources/completion/testParam.lua:
--------------------------------------------------------------------------------
1 |
2 | local function aaa(param1, param2)
3 | local bbb =
4 | end
--------------------------------------------------------------------------------
/src/test/resources/completion/testSelf.lua:
--------------------------------------------------------------------------------
1 |
2 | local s = {}
3 |
4 | function s:aaa()end
5 | function s:abb()end
6 | function s:ccc()
7 | sa
8 | end
--------------------------------------------------------------------------------
/src/test/resources/refactoring/moveFile/after/B.lua:
--------------------------------------------------------------------------------
1 | require("to.A")
--------------------------------------------------------------------------------
/src/test/resources/refactoring/moveFile/after/to/A.lua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/test/resources/refactoring/moveFile/after/to/A.lua
--------------------------------------------------------------------------------
/src/test/resources/refactoring/moveFile/after/to/C.lua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/test/resources/refactoring/moveFile/after/to/C.lua
--------------------------------------------------------------------------------
/src/test/resources/refactoring/moveFile/before/A.lua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/test/resources/refactoring/moveFile/before/A.lua
--------------------------------------------------------------------------------
/src/test/resources/refactoring/moveFile/before/B.lua:
--------------------------------------------------------------------------------
1 | require("A")
--------------------------------------------------------------------------------
/src/test/resources/refactoring/moveFile/before/to/C.lua:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlantingStds/cfxEmmyLua/19580139a34bd80d6228e78e8fc8b65def8a0c1f/src/test/resources/refactoring/moveFile/before/to/C.lua
--------------------------------------------------------------------------------
/src/test/resources/typeSafety/typeSafety.lua:
--------------------------------------------------------------------------------
1 | ---
2 | --- Created by Perry.
3 | --- DateTime: 30-9-2017 20:56
4 | ---
5 |
6 | --- Basic test
7 | --- @param x number
8 | function test(x) end
9 |
10 | test("3") -- Type mismatch, string instead of number
11 | test(nil) -- Type mismatch, nil instead of number (Only if strict nil option is checked)
12 | test(3) -- Valid
13 | test(4, 5) -- Too many arguments
14 | test() -- Not enough arguments
15 |
16 | --- Union test
17 | --- @param x number | nil
18 | function test2(x) end
19 |
20 | test2(3) -- Valid
21 | test2(nil) -- Valid
22 | test2("") -- Type mismatch, string instead of number or nil
23 |
24 | --- Overload test
25 | --- @overload fun(x: number, y: string): boolean
26 | --- @param x number
27 | function test3(x) end
28 |
29 | test3(3) -- Valid, main signature
30 | test3(3, "4") -- Valid, overload
31 | test3(3, 4, 5) -- No matching overload
32 | test3("") -- No matching overload
33 |
34 | --- List test
35 | --- @param x number[]
36 | function testList(x) end
37 |
38 | --- @type number[]
39 | local list = {1,2,3}
40 | testList(list) --- Valid
41 |
--------------------------------------------------------------------------------