Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 6465b49

Browse files
committed
Move formatter provider to standalone file
1 parent f559556 commit 6465b49

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/providers/formatter.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { ExtensionContext } from 'vscode';
2+
import { RubyDocumentFormattingEditProvider } from '../format/rubyFormat';
3+
4+
export function registerFormatter(ctx: ExtensionContext) {
5+
new RubyDocumentFormattingEditProvider().register(ctx);
6+
}

src/ruby.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import * as Locate from './locate/locate';
66
import * as path from 'path';
77
import * as cp from 'child_process';
88
import { LintCollection } from './lint/lintCollection';
9-
import { RubyDocumentFormattingEditProvider } from './format/rubyFormat';
109
import * as utils from './utils';
1110
import { registerTaskProvider } from './task/rake';
1211
import { Config as LintConfig } from './lint/lintConfig';
1312
import * as debounce from 'lodash/debounce';
1413

14+
import { registerFormatter } from './providers/formatter';
1515
import { registerHighlightProvider } from './providers/highlight';
1616
import { registerIntellisenseProvider } from './providers/intellisense';
1717

@@ -146,7 +146,3 @@ function registerCompletionProvider(ctx: ExtensionContext) {
146146
completeTest.on('error', () => 0);
147147
}
148148
}
149-
150-
function registerFormatter(ctx: ExtensionContext) {
151-
new RubyDocumentFormattingEditProvider().register(ctx);
152-
}

0 commit comments

Comments
 (0)