Code Monkey home page Code Monkey logo

Comments (10)

CppCXY avatar CppCXY commented on June 16, 2024

This may be because your chunkname does not comply with the general rules of Lua. The general format for a Lua chunkname is aaa/b/ccc.lua. You can check the chunkname by printing debug.getinfo(1).source or use dbg.breakHere() to forcefully break and inspect it. If you are developing with Unity's xLua, you can modify the custom loader. If you are using a different framework, you can try modifying the usage of the lua loadbuffer interface.

from intellij-emmylua.

ahyee avatar ahyee commented on June 16, 2024

This is what I printed out with debug.getinfo

@UI/UIVillage

but the break point still didnt worked.

from intellij-emmylua.

CppCXY avatar CppCXY commented on June 16, 2024

you can try dbg.breakHere(), this code needs to be inserted after dbg.tcpConnect, is your editor Rider?

from intellij-emmylua.

ahyee avatar ahyee commented on June 16, 2024

Yes I'm using Rider. I notice some of my lua file used . instead of /. Will it affect the file that i going to debug which is using /?

from intellij-emmylua.

CppCXY avatar CppCXY commented on June 16, 2024

It is correct to use require 'aaaa.bbbbbbbb.cccccc' in the code, but the corresponding chunkname needs to be changed to a/b/c. Have you tried using dbg.breakHere()?

from intellij-emmylua.

ahyee avatar ahyee commented on June 16, 2024

dbg.breakHere() do work however I cant step over etc for it

from intellij-emmylua.

CppCXY avatar CppCXY commented on June 16, 2024

Files outside of the assets may not be indexed by Rider. You can try using other editors like Visual Studio Code or IntelliJ IDEA.

from intellij-emmylua.

ahyee avatar ahyee commented on June 16, 2024

I see.. I will test out others.
I using Xlua in Unity. Is this what you mean by modify custom loader?

luaEnv.AddLoader((ref string filePath) => ReadFile(filePath));

private static byte[] ReadFile(string path)
{
if (path == "emmy_core")
return null;

    path = path.Replace('.', '/');
    var fileFullPath = $"{FileService.GetAssetRootPath()}/lua_root/{path}.lua";
    return System.IO.File.ReadAllBytes(fileFullPath);
}

from intellij-emmylua.

CppCXY avatar CppCXY commented on June 16, 2024

You can take a look at the documentation for the AddLoader function. It requires you to return the real path to filePath. In other words, you need to modify the ReadFile parameter to be ref string path and assign fileFullPath to path.

from intellij-emmylua.

ahyee avatar ahyee commented on June 16, 2024

thanks

from intellij-emmylua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.