Vscode-code-runner: ブラウザでhtmlを開く(または任意のコマンドを使用する)

作成日 2016年11月07日  ·  4コメント  ·  ソース: formulahendry/vscode-code-runner

こんにちは、非常にきちんとした拡張に感謝します。

Chromeでhtmlファイルを開くようにCodeRunnerを構成しようとしましたが、機能しませんでした。

構成:

"code-runner.executorMap": {
    "javascript": "node"
},
"code-runner.defaultLanguage": "javascript",
"code-runner.clearPreviousOutput": true,
"code-runner.saveFileBeforeRun": false,
"code-runner.executorMapByFileExtension": {
    ".html": "chrome.exe"
}

しかし、私はエラーを下回っています:

[Running] chrome.exe "d:\angular-directive-demo.html"
'chrome.exe' is not recognized as an internal or external command,
operable program or batch file.

[Done] exited with code=1 in 0.176 seconds

chrome.exeの完全なパスも指定してみましたが、同じ問題が発生しました。

任意のコマンド/ exeを呼び出す方法はありますか?

コードランナー:0.4.1
VSCode:1.7.1
Windows 8.1

ありがとう。

question

最も参考になるコメント

こんにちは@manikantag 、私は以下の設定を使用して動作します:

"code-runner.executorMapByFileExtension": {
    ".html": "\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\""
}

出力:

[Running] "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "d:\Try\test\test.html"

[Done] exited with code=0 in 0.252 seconds

バックスラッシュとファイルパスのスペースに注意しているかどうかを確認してください。

全てのコメント4件

こんにちは@manikantag 、私は以下の設定を使用して動作します:

"code-runner.executorMapByFileExtension": {
    ".html": "\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\""
}

出力:

[Running] "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "d:\Try\test\test.html"

[Done] exited with code=0 in 0.252 seconds

バックスラッシュとファイルパスのスペースに注意しているかどうかを確認してください。

@formulahendryWorking👍

すべての円記号を試し、エスケープしましたが、パス全体を二重引用符で囲みませんでした。 ありがとう。

これは文書化されましたか? または、私はそれを逃しましたか? そうでない場合は、VSCode拡張readmeで確認できるように、これを文書化することをお勧めします。

https://github.com/formulahendry/vscode-code-runner#configurationにrubyとphpのインタープリターPATHを追加するサンプルがありますが、バックスラッシュとのスペースを処理するために詳細を追加しますファイルパス 。 #28

このページは役に立ちましたか?
0 / 5 - 0 評価