lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On Thursday, January 8, 2015, Tim Caswell <tim@creationix.com> wrote:
I finally got luacheck in windows in sublime text 3.

 - Use luarocks windows package and use the provided lua binary.
 - Set all the system paths it wants you to set.  This is a pain, but important.
 - Open a visual studio command prompt (search for "visual studio tools folder" in the start screen) to get the proper PATHs set
 - luarocks install luacheck
 - It worked mostly, but didn't install two dependencies, so I installed those also using luarocks
 - Got the sublime package to patch and support windows paths https://github.com/SublimeLinter/SublimeLinter-luacheck/issues/2

God luck.  I sometimes do lua development on windows, and I just don't feel at home without luacheck support in my editor.

On Thu, Jan 8, 2015 at 5:58 AM, Peter Melnichenko <mpeterval@gmail.com> wrote:
On Thu, Jan 8, 2015 at 2:30 PM, John Logsdon
<j.logsdon@quantex-research.com> wrote:
> Sorry to ask a dumb question but this looked just what I needed so I installed
> LuaRocks and the Windows SDK 8.1A on my Dell Inspiron 7000 box.  My native
> environment is Linux so registries and things like that cause me to break out
> in a cold sweat!  I have to use Windoze unfortunately in this application.
>
> But LC doesn't find the c++ compiler cl.exe and I suspect other things will
> fall over as well. :(
>
> Looking at the installed software, I see that Visual C++ 2005, 2008  and 2010
> are already installed, the last with 86 and x64 versions.  I guess they came
> with the box as I don't recall installing them or maybe they came with
> something else.
>
> Anyway is there a way of configuring luacheck so that it can use one of these
> compilers?  I don't want to break another program.  Or the gcc compiler?
>
> Maybe I don't need the SDK.  All I want to do is to check some code for
> missing declarations and unused variables!

You need to configure LuaRocks so that it can find cl.exe to compile
luafilesystem. I vaguely remember this answer helping:
http://stackoverflow.com/a/13428625/2733013. Also check that cl.exe is
in PATH. If that doesn't work, you can ask for help on the LuaRocks
mailing list[1]. Anyway, I plan to remove hard dependency on
luafilesystem in the next release.

Peter

[1] https://lists.sourceforge.net/lists/listinfo/luarocks-developers



I went through similar hoops with Sublime Text 3 on windows. I used "he olde batch file trick":

luacheck.bat:
@echo off
lua.exe %~dp0\luacheck.lua %*

Where the magic noise in front of the file name expands to "the path of this batch file"

I submitted this as a pull request. 
-Andrew