Open
Description
I am using rust inside Windows Subsystem for Linux (WSL).
It'd be great if I can use the same toolchain to perform syntax checking.
After some fiddling, I found some success. 2 things are concerned.
- finding the path to executable
- converting file paths from
/mnt/c/
toC:\\
I made a dirty patch to rust_proc.py
:
diff --git a/rust_proc.py.bak b/rust_proc.py
index 5d650d1..503ed3e 100755
--- a/rust_proc.py.bak
+++ b/rust_proc.py
@@ -212,6 +212,8 @@ class RustProc(object):
# Prevent a console window from popping up.
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
+ self.cmd.insert(0, 'C:\\Windows\\System32\\wsl.exe')
+ self.cmd[1] = '/home/user/.cargo/bin/' + self.cmd[1]
self.proc = subprocess.Popen(
self.cmd,
cwd=self.cwd,
@@ -298,6 +300,8 @@ class RustProc(object):
continue
if self.decode_json and line.startswith('{'):
try:
+ if sys.platform == 'win32':
+ line = line.replace('/mnt/c/', 'C:\\\\')
result = json.loads(line)
except:
self.listener.on_error(self,
Now that syntax check is working. Not sure about other commands.