Skip to content

Commit

Permalink
fix: normalize path separator on non-posix systems
Browse files Browse the repository at this point in the history
Fixes #73.
  • Loading branch information
simonhaenisch committed Sep 1, 2022
1 parent 2fa075e commit 91377de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/organize.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { sep, posix } = require('path');
const { applyTextChanges } = require('./apply-text-changes');
const { getLanguageServiceHost, getVueLanguageServiceHost } = require('./service-host');

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

if (sep !== posix.sep) {
filepath = filepath.split(sep).join(posix.sep);
}

/**
* @type {ts.LanguageService}
*/
Expand Down

0 comments on commit 91377de

Please sign in to comment.