Skip to content

Commit b928a2a

Browse files
committed
extension: fix stdin-filepath for non-file documents
1 parent a7dae57 commit b928a2a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

stylua-vscode/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ To view the changelog of the StyLua binary, see [here](https://github.com/Johnny
1111

1212
## [Unreleased]
1313

14+
### Fixed
15+
16+
- Skip `--stdin-filepath` when handling non-file based text documents (e.g., untitled documents)
17+
1418
## [1.7.0] - 2024-11-16
1519

1620
### Changed

stylua-vscode/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ export async function activate(context: vscode.ExtensionContext) {
248248
outputChannel,
249249
styluaBinaryPath.path,
250250
text,
251-
document.uri.fsPath,
251+
document.uri.scheme === "file" ? document.uri.fsPath : undefined,
252252
cwd,
253253
byteOffset(document, range.start),
254254
byteOffset(document, range.end)

0 commit comments

Comments
 (0)