Skip to content

Commit

Permalink
Remove comments and unused variable vscodeadapter
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalre committed Feb 10, 2023
1 parent d792c5a commit 389c4e8
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,21 @@ import { Settings } from "./settings"
import { VsCodeAdapter } from "./adapter/vs-code-adapter"
import { Controller } from "./controller/controller"

const settings = new Settings()
const vscodeadapter = new VsCodeAdapter()

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: ExtensionContext) {

const formatter: DocumentFormattingEditProvider = {
provideDocumentFormattingEdits(): TextEdit[] {
const settings = new Settings()
if (settings.doSortOnSave()) {
return new Controller().sortYamlWrapper(settings.sortOnSave)
} else {/* istanbul ignore next */
} else {
return new Controller().formatYamlWrapper()
}
}
}

// register at activate-time
VsCodeAdapter.registerFormatter(formatter)

// The command has been defined in the package.json file
// Now provide the implementation of the command with registerCommand
// The commandId parameter must match the command field in package.json
context.subscriptions.push(
commands.registerCommand("vscode-yaml-sort.sortYaml", () => {
new Controller().sortYamlWrapper()
Expand Down

0 comments on commit 389c4e8

Please sign in to comment.