diff --git a/stylua-vscode/CHANGELOG.md b/stylua-vscode/CHANGELOG.md index 1118951b..d116c604 100644 --- a/stylua-vscode/CHANGELOG.md +++ b/stylua-vscode/CHANGELOG.md @@ -11,6 +11,10 @@ To view the changelog of the StyLua binary, see [here](https://github.com/Johnny ## [Unreleased] +### Fixed + +- Skip `--stdin-filepath` when handling non-file based text documents (e.g., untitled documents) + ## [1.7.0] - 2024-11-16 ### Changed diff --git a/stylua-vscode/src/extension.ts b/stylua-vscode/src/extension.ts index 8383175a..87bfeb0b 100644 --- a/stylua-vscode/src/extension.ts +++ b/stylua-vscode/src/extension.ts @@ -248,7 +248,7 @@ export async function activate(context: vscode.ExtensionContext) { outputChannel, styluaBinaryPath.path, text, - document.uri.fsPath, + document.uri.scheme === "file" ? document.uri.fsPath : undefined, cwd, byteOffset(document, range.start), byteOffset(document, range.end)