【问题标题】:Google Closure Linter not working in Sublime Text 2 for WindowsGoogle Closure Linter 在 Windows 的 Sublime Text 2 中不起作用
【发布时间】:2012-07-01 03:32:16
【问题描述】:

有没有人让 Google Closure Linter (gjslint) 与 Sublime Text 2 for Windows 一起工作?

当我运行它时,我得到以下信息(通过工具菜单或 CTRL+SHIFT+J):

文件名、目录名或卷标语法不正确。

闭包 linter:忽略 0 个错误。

我的步骤如下:

开箱即用,所有功能均无效。但是,如果我在默认设置中硬编码路径,我可以让 fixjsstyle 插件工作:

{
    // Path to the gjslint.
    "gjslint_path": "/python27/scripts/gjslint",

    // Path to the fixjsstyle.
    "fixjsstyle_path": "/python27/scripts/fixjsstyle"
}

可以确认它们都存在:

C:\>dir c:\python27\scripts
 Volume in drive C is OSDisk
 Volume Serial Number is 36E3-7433

 Directory of c:\python27\scripts

...
06/29/2012  09:48 AM               304 fixjsstyle-script.py
06/29/2012  09:48 AM             7,168 fixjsstyle.exe
06/29/2012  09:48 AM               525 fixjsstyle.exe.manifest
06/29/2012  09:48 AM               298 gjslint-script.py
06/29/2012  09:48 AM             7,168 gjslint.exe
06/29/2012  09:48 AM               522 gjslint.exe.manifest
              17 File(s)         34,580 bytes
               2 Dir(s)  186,377,805,824 bytes free

这听起来确实是一个参考问题,我什至尝试将可执行文件复制到插件目录,但也没有用。

编辑:我应该补充一点,我确实打开了debug: true 标志,但什么也没出现。

【问题讨论】:

    标签: javascript python google-closure-compiler sublimetext2


    【解决方案1】:

    我在 Windows 7 上遇到了同样的问题。 我发现修复它的唯一方法是删除 gjslint 调用周围的双引号

    第 34 行 gjslint.pysublime 包内

    原始(不工作):

    cmd = '"' + s.get('gjslint_path', 'jslint') + '" ' + s.get('gjslint_flags', '') + ' "' + file_path + '"'
    

    工作:

    cmd = '' + s.get('gjslint_path', 'jslint') + ' ' + s.get('gjslint_flags', '') + ' "' + file_path + '"'
    

    请确保您的 gjslint 路径中没有任何空格来完成这项工作,因为它适合您。

    如果有人有其他解决方案,请分享。

    【讨论】:

    • 为我工作。 Windows 7 也是如此。
    • 谢谢!输入和宾果游戏。不是 python 专家,非常感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-05-14
    • 2015-04-10
    • 1970-01-01
    • 1970-01-01
    • 2016-05-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多