pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.6k stars 519 forks source link

Lack semicolon in package path #1122

Open Howld opened 2 years ago

Howld commented 2 years ago

...D:\NormalPrograms\ZeroBrane\lualibs/?/init.luaengine/?.lua;... ...D:\NormalPrograms\ZeroBrane\lualibs/?/init.lua ; engine/?.lua;...

Please fix that.

pkulchenko commented 2 years ago

Where are these paths are coming from? What's the location of the IDE itself? engine/?.lua is not something that the IDE would generate, so I'm not sure how this path is formed and how to reproduce this issue. What's the content of LUA_PATH variable?

pkulchenko commented 2 years ago

I confirmed that ....lualibs/?/init.lua location is the last one that the IDE usually adds, so whatever is added after that is either added by some of the plugins or by your script itself. Do you know where the engine/?.lua path is coming from?

Howld commented 2 years ago

It's my code path. I use Love2D engine, and running by cmd on Windows. Sure, the location is the last one that IDE adds, but lacks semicolon. The engine generate package path with semicolon last, so I think the IDE should do same to avoid some error message about not find file.

pkulchenko commented 2 years ago

Sure, the location is the last one that IDE adds, but lacks semicolon.

I don't see where this happens. Can you better describe your configuration and show full content of the Output window when you launch your love2d script and the selected interpreter in the IDE? Thanks.

Howld commented 2 years ago

Code in main.lua

package.path = package.path .. ';engine/?.lua;engine/SLAXML-master/?.lua;engine/middleclass-master/?.lua'
print(package.path)

Output in Cmd:

D:\PersonalFiles\Love\p1>love.exe ../p1
.\?.lua;D:\NormalPrograms\LOVE\lua\?.lua;D:\NormalPrograms\LOVE\lua\?\init.lua;;engine/?.lua;engine/SLAXML-master/?.lua;engine/middleclass-master/?.lua

Look path before my added path, you will find two semicolon. Because the Love2D engine adds one semicolon by itself.

Output in IDE:

;.\?.lua;D:\NormalPrograms\LOVE\lua\?.lua;D:\NormalPrograms\LOVE\lua\?\init.lua;;./?.lua;./?/init.lua;./lua/?.lua;./lua/?/init.lua;D:\NormalPrograms\ZeroBrane\lualibs/?/?.lua;D:\NormalPrograms\ZeroBrane\lualibs/?.lua;D:\NormalPrograms\ZeroBrane\lualibs/?/?/init.lua;D:\NormalPrograms\ZeroBrane\lualibs/?/init.lua;engine/?.lua;engine/SLAXML-master/?.lua;engine/middleclass-master/?.lua