Nothing is converted when the file path contains a space
まだ誰も着手していません。
評価
調査の方向性
JsModules.pyを読み、アクティブなファイルのパスからshell_cmdが組み立てられるJsModulesFileCommandとJsModulesDirCommandに注目してください。Sublimeでドキュメント化されているcmd引数の配列とshell_cmdを比較し、両方のコマンドが報告された空白を含むパスを処理できることを確認してください。空白を含むパスにあるファイルをコンバーターが見つけて変換でき、通常のパスも引き続き機能すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Claude reports: on Windows the commands convert nothing when the file path contains a space, and the exec panel says "Found 0 files".
Tested with JsModules 0.0.2 on Sublime Text 4215 (Windows), cjs-to-es6 installed globally with npm. The same two-line file a.js (const x = require('y'); module.exports = x;) in two folders:
...\jsmok\a.js: "JsModules: Convert file to ES module" prints "Found 1 files ... 1 ok"....\jsm space dir\a.js: the console showsRunning cjs-to-es6 C:\...\jsm space dir\a.js, and the exec panel shows "Found 0 files." followed by "Error: You have to provide at least one file/directory to transform."
JsModules.py builds the command with "cjs-to-es6 {0}".format(active_file) and passes it as shell_cmd, so the path is split at the spaces. Both commands do this (JsModulesFileCommand and JsModulesDirCommand).
Running the same command through the exec command with the path as its own list item works for the folder with spaces:
exec {"cmd": ["cjs-to-es6", "C:\\...\\jsm space dir\\a.js"], "shell": true}
That printed "Found 1 files ... 1 ok" for the same file. Sublime's build system docs describe cmd as an array of arguments and shell_cmd as a string passed to the shell (https://www.sublimetext.com/docs/build_systems.html). Changing both commands to the cmd form (or quoting the path) should fix it.
- 主要言語
- Python
- スター
- 0
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
luwes/SublimeJsModules のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
luwes/SublimeJsModules の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fossasia/visdom-dev#77 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
aws-cloudformation/cfn-lint#4890 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
volcengine/OpenViking#6521 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
AstrBotDevs/AstrBot#10720 ·
メンテナーはふだん 1 日以内に返信
-
fix(xiaomi): curated picker list still offers six ids that return 400 (plan-limited vs retired)オープンcause/upstream comp/cli P2 provider/other tool/file type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NousResearch/hermes-agent#143900 ·
メンテナーはふだん 1 日以内に返信