Skip to content

Commit 91377de

Browse files
committed
fix: normalize path separator on non-posix systems
Fixes #73.
1 parent 2fa075e commit 91377de

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/organize.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const { sep, posix } = require('path');
12
const { applyTextChanges } = require('./apply-text-changes');
23
const { getLanguageServiceHost, getVueLanguageServiceHost } = require('./service-host');
34

@@ -15,6 +16,10 @@ module.exports.organize = (
1516
return code; // we do the preprocessing from the `vue` parent parser instead, so we skip the child parsers
1617
}
1718

19+
if (sep !== posix.sep) {
20+
filepath = filepath.split(sep).join(posix.sep);
21+
}
22+
1823
/**
1924
* @type {ts.LanguageService}
2025
*/

0 commit comments

Comments
 (0)