Skip to content

Commit

Permalink
Merge pull request #451 from PowerShell/kapilmb/code-format-untitled
Browse files Browse the repository at this point in the history
Handle formatting of untitled documents
  • Loading branch information
daviwil authored Jan 20, 2017
2 parents 9c97246 + dc64cfc commit 3d9319b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/features/DocumentFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export namespace ScriptFileMarkersRequest {

// TODO move some of the common interface to a separate file?
interface ScriptFileMarkersRequestParams {
filePath: string;
fileUri: string;
settings: any;
}

Expand Down Expand Up @@ -122,10 +122,11 @@ class PSDocumentFormattingEditProvider implements DocumentFormattingEditProvider
let rule = this.ruleOrder[index];
let uniqueEdits: ScriptRegion[] = [];
let edits: ScriptRegion[];

return this.languageClient.sendRequest(
ScriptFileMarkersRequest.type,
{
filePath: document.fileName,
fileUri: document.uri.toString(),
settings: this.getSettings(rule)
})
.then((result: ScriptFileMarkersRequestResultParams) => {
Expand Down

0 comments on commit 3d9319b

Please sign in to comment.