【问题标题】:NppExec plugin ends output at first colonNppExec 插件在第一个冒号处结束输出
【发布时间】:2013-07-11 11:24:04
【问题描述】:

我正在试验 TypeScript,我正在使用 Notepad++ 编写 TypeScript,并使用 NppExec 插件来编译我的脚本。似乎它应该可以工作,但有一个非常奇怪的问题:NppExec 只在第一条警告/错误消息的文本之前向我显示输出到:。例如,假设编译输出应该是这样的:

C:/temp/tstest/test.ts(26,14): Supplied parameters do not match any signature of call target
C:/temp/tstest/test.ts(33,9): Supplied parameters do not match any signature of call target

我将在 NppExec 控制台窗口中看到的是:

node C:\temp\tstest\node_modules\typescript\bin\tsc.js C:\temp\tstest\test.ts
Process started >>>
C:/temp/tstest/test.ts(26,14): <<< Process finished. (Exit code 1)
================ READY ================

请注意,它在第一个 ): 之后终止了输出。

非常有趣的是,如果我将 JavaScript 引擎从 Node 更改为 cscript(Windows 脚本宿主),那么它可以工作......但需要永远!如果我使用 cscript 执行相同的命令,我会看到以下内容:

cscript C:\temp\tstest\node_modules\typescript\bin\tsc.js C:\temp\tstest\test.ts
Process started >>>
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

C:/temp/tstest/test.ts(26,14): Supplied parameters do not match any signature of call target
C:/temp/tstest/test.ts(33,9): Supplied parameters do not match any signature of call target
<<< Process finished. (Exit code 1)
================ READY ================

关于这个去哪里有什么建议吗?我宁愿使用 Node,因为它更快...

这是一个演示所有这些的视频: http://screencast.com/t/xxgodAU8

编辑: 事实证明,如果您将-w 开关(“监视文件并在更改时重建”开关)传递给 tsc.js,它会在 Node 执行时工作...但它不会只构建一次,它会继续构建,直到你杀死它,这个过程才会结束。

【问题讨论】:

    标签: notepad++ typescript nppexec


    【解决方案1】:

    我开始了一个记事本++插件项目。 你可以在这里找到它: https://github.com/hansrwindhoff/nppPluginTypescript.git

    在保存时编译 并在nodejs中运行js

    如果有人想加入智能感知,那就太好了!

    在以下位置有一个语法着色 xml 文件: https://gist.github.com/wate/5077019 这个要点与我无关。

    【讨论】:

      【解决方案2】:

      我没有给你答案,但我可以给你一些关于攻击计划的想法。

      可能正在输出整个消息,但某些特殊字符或序列使 Notepad++ 停止处理它。将输出重定向到文件以查看那里发生了什么。 hex editor 插件可能会有所帮助。有了这些知识,您就可以通过awksed 之类的工具对命令输出进行管道传输,以重写有问题的位,以便 Notepad++ 喜欢它。

      【讨论】:

      • 我会试一试,但我很困惑为什么如果你通过 -w 线程这一切都有效。我希望输出在每次编译时都是逐字节相同的,有或没有 -w 开关。
      【解决方案3】:

      我前段时间在 Codeplex 发起了一项功能请求。问题似乎是 nodejs 如何刷新其缓冲区的方式。请参阅 github 和 codeplex 上的讨论:

      http://typescript.codeplex.com/workitem/115

      https://github.com/joyent/node/issues/4640#issuecomment-12542632

      您可能希望为请求投票,以提高其优先级。

      【讨论】:

        猜你喜欢
        • 2012-08-27
        • 1970-01-01
        • 2021-10-19
        • 1970-01-01
        • 1970-01-01
        • 2013-03-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多