Skip to content

Commit 3d9319b

Browse files
authored
Merge pull request #451 from PowerShell/kapilmb/code-format-untitled
Handle formatting of untitled documents
2 parents 9c97246 + dc64cfc commit 3d9319b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/features/DocumentFormatter.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export namespace ScriptFileMarkersRequest {
2525

2626
// TODO move some of the common interface to a separate file?
2727
interface ScriptFileMarkersRequestParams {
28-
filePath: string;
28+
fileUri: string;
2929
settings: any;
3030
}
3131

@@ -122,10 +122,11 @@ class PSDocumentFormattingEditProvider implements DocumentFormattingEditProvider
122122
let rule = this.ruleOrder[index];
123123
let uniqueEdits: ScriptRegion[] = [];
124124
let edits: ScriptRegion[];
125+
125126
return this.languageClient.sendRequest(
126127
ScriptFileMarkersRequest.type,
127128
{
128-
filePath: document.fileName,
129+
fileUri: document.uri.toString(),
129130
settings: this.getSettings(rule)
130131
})
131132
.then((result: ScriptFileMarkersRequestResultParams) => {

0 commit comments

Comments
 (0)