Skip to content

Releases: zhangjiequan/IntelliJ-EmmyLua

1.4.13_extend_all_lua_types.2

Choose a tag to compare

Feat

By using the latest version of the master branch of EmmyLua/EmmyLuaDebugger, we now support custom display methods for various Lua type values within projects.

Usage

example:

package.cpath = package.cpath .. ';C:/Users/YourName/AppData/Roaming/JetBrains/Rider2023.2/plugins/EmmyLua/debugger/emmy/windows/x64/?.dll'
local dbg = require('emmy_core')
dbg.tcpListen('localhost', 9966)
dbg.waitIDE()
dbg.breakHere()

--region emmyProject
dbg.registerTypeName("number")
dbg.registerTypeName("string")

local emmyHelper = rawget(_G, "emmyHelper")

if emmyHelper then
    local function convertStringToHex(str)
        return str:gsub('.', function (c)
            return string.format('%02X', string.byte(c))
        end)
    end
    emmyHelper.queryVariableCustom = function(variable, obj, typeName, depth)
        if typeName == 'number' then
            local objStr = tostring(obj)
            local hexStr = string.format("%016x", obj)
            local finalStr = string.format("([Hex]:%s)%s", hexStr, objStr)
            variable.value = finalStr
            return true
        elseif typeName == 'string' then
            local objStr = tostring(obj)
            local hexStr = convertStringToHex(obj)
            local finalStr = string.format("([Hex]:%s)%s", hexStr, objStr)
            variable.value = finalStr
            return true
        end
        return false
    end
end
--endregion emmyProject

local int1 = 32
local str1 = hex_to_string("6162") -- ab
local str2 = hex_to_string("61620063") -- ab\0c

Debugg View Rider:

IntelliJ-EmmyLua_1.4.9.9_external_queryvariable

Choose a tag to compare

Feat

  • Support external customization of the queryVariable method.
  • Resolved null error caused by undefined queryVariable method in external custom in 1.4.9.8.

Usage

example:

package.cpath = package.cpath .. ';C:/Users/YourName/AppData/Roaming/JetBrains/Rider2023.2/plugins/EmmyLua/debugger/emmy/windows/x64/?.dll'
local dbg = require('emmy_core')
dbg.tcpListen('localhost', 9966)
dbg.waitIDE()
dbg.breakHere()

--region emmyProject
local function processNumber(number)
    local objStr = tostring(number)
    local hexStr = string.format("%016x", number)
    return string.format("%s ([Hex]:%s)", objStr, hexStr)
end

local extension = {
    queryVariable = function(variable, obj, typeName, depth)
        if typeName == 'number' then
            variable.value = processNumber(obj)
            return true
        end
        return false
    end
}
local emmyProject = {
    extension = extension
}
rawset(_G, 'emmyProject', emmyProject)
--endregion emmyProject

local testNumber = 16

20240218-143102

IntelliJ-EmmyLua_1.4.9.8_external_queryvariable

Choose a tag to compare

  • Support external customization of the queryVariable method.

Usage:

package.cpath = package.cpath .. ';C:/Users/YourName/AppData/Roaming/JetBrains/Rider2023.2/plugins/EmmyLua/debugger/emmy/windows/x64/?.dll'
local dbg = require('emmy_core')
dbg.tcpListen('localhost', 9966)
dbg.waitIDE()
dbg.breakHere()

local function processNumber(number)
    local objStr = tostring(number)
    local hexStr = string.format("%016x", number)
    return string.format("%s ([Hex]:%s)",
            objStr, valueFP64String, valueFP64Number, hexStr)
end

local extension = {
    queryVariable = function(variable, obj, typeName, depth)
        if typeName == 'number' then
            local a = processNumber(obj)
            variable.value = a
            return true
        end
        return false
    end
}
local emmyProject = {
    extension = extension
}
rawset(_G, 'emmyProject', emmyProject)

IntelliJ-EmmyLu_1.4.9.extend_string_value.7

Choose a tag to compare

  • Enhanced String Visualization in Debugger: The debugger has been updated to improve the way strings are visualized. It now includes a detailed representation of strings with both hexadecimal and ASCII encoding for non-printable characters, providing a more comprehensive understanding of string data during debugging sessions.

  • Default String Output Mode: We have introduced a 'Auto' default string output mode that is initialized within the updateCodeImpl method. This new default ensures that users experience consistent string visualization, taking full advantage of the recent enhancements in string handling

Full Changelog: https://github.com/zhangjiequan/IntelliJ-EmmyLua/commits/1.4.9.extend_string_value.7