S
S
soif2012-12-20 23:13:31
IntelliJ IDEA
soif, 2012-12-20 23:13:31

Setting up IntelliJ IDEA with the Lua plugin

There is someone else's Lua project that you need to work with, installed IntelliJ IDEA 11.1.5 (because the plugin for 12 does not work). Navigation "Go to declaration" does not work for functions and classes defined in another file. (If in the same file, then everything is ok)
The project created a "new project from scrutch" specifying a folder that already has files. Can anyone advise how to solve the problem? Or another good IDE for Lua?

upd
The problem seems to be with connecting files in Windows, firstly, require does not work, secondly, when I installed Lua Development Tools (Eclipse Koneki) there is the same problem, I could not even reproduce the example from their screencast , I tried to assign both a relative path, and and the absolute path to the file.

The question now boils down to this: does anyone write Lua from under Windows?? What IDE are you using?? Respond please!
I make 2 lib.lua files

module(...)

function hello()
    print "hello"
end

and test.lua
local mod = require('C:\My Projects\Lua tutorial\lib.lua')
-- local mod = require('lib")
--
mod.hello()

poke plz where is the error ??
I would be very grateful for an example with require.

upd2
Of course, it would be fair to send me to the Lua forum , but I can't register there, because. they do not plow captcha

upd3 Partial solution!
head-on solution: set environment variables to
LUA_DIR = "C:\My Projects\Lua tutorial"
LUA_PATH = "?.lua;%LUA_DIR%\?.lua;%LUA_DIR%\L_DIR\?.lua"
LUA_CPATH = "? .dll;%LUA_DIR%\?.dll;%LUA_DIR%\C_DIR\?.dll"

or for a project separately in IntelliJ IDEA
screen
image


But, the "Go to declaration" navigation for the hello() function doesn't work anyway!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergei Borisov, 2012-12-21
@risik

Maybe slashes in the other direction should be deployed?

K
khrenkov, 2014-12-04
@khrenkov

I use Lua Development Tools.
The "Open declaration" function worked when the module was created differently.
lib.lua

local m = {}
function m.hello()
    print "hello"
end
return m

www.eclipse.org/forums/index.php/t/361639

V
Vasily minodvesP, 2015-01-30
@benoni

does anyone write in Lua from under Windows?? What IDE are you using??

1. Geany + plugin for Lua (I mainly use it)
2. ZeroBrane Studio studio.zerobrane.com (tailored for Lua, supports almost all Lua frameworks)
3. Eclipse + LuaDT

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question