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

EmmyLua lost context when coding in Evalute Window. #168

Closed
luchuanbaker opened this issue Jul 4, 2018 · 1 comment
Closed

EmmyLua lost context when coding in Evalute Window. #168

luchuanbaker opened this issue Jul 4, 2018 · 1 comment

Comments

@luchuanbaker
Copy link
Contributor

User = {}
function User.getData()
  local data1 = User._data1
  local data2 = User._data2     --line 4
end

While you are debugging the code as shown above, and the current line is line 4, then you press "Ctrl + U" to open the Evaluate Window, in the express input box, when you input "data1" there is no auto complete, and the font of "data1" is italic that indicates it's an undefined variable, but it is defined in fact, so I guess the EmmyLua doesn't provide a correct context to Idea....
And maybe the problem is in the following code(EmmyLua doesn't use the xSourcePosition):

class LuaDebuggerEditorsProvider : XDebuggerEditorsProvider() {
    override fun getFileType(): FileType {
        return LuaFileType.INSTANCE
    }

    override fun createDocument(project: Project,
                                s: String,
                                xSourcePosition: XSourcePosition?,
                                evaluationMode: EvaluationMode): Document {
        val file = LuaElementFactory.createFile(project, s)
        return PsiDocumentManager.getInstance(project).getDocument(file)!!
    }
}
@tangzx
Copy link
Member

tangzx commented Aug 27, 2018

solved

@tangzx tangzx closed this as completed Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants