Skip to content

Commit

Permalink
delete debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
FelicixAwe committed Aug 22, 2024
1 parent 4921316 commit ad81616
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 26 deletions.
21 changes: 0 additions & 21 deletions src/AutoFixProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ interface RuleSet {
rules: Record<string, Rule>;
}

// export function activate(context: vscode.ExtensionContext): void {
// const codeActionProvider = new DiagnosticFixProvider();
// context.subscriptions.push(
// vscode.languages.registerCodeActionsProvider(
// { scheme: 'file', language: 'yaml' },
// codeActionProvider
// )
// );
// }

class DiagnosticFixProvider implements vscode.CodeActionProvider {
public provideCodeActions(
document: vscode.TextDocument,
Expand All @@ -48,9 +38,7 @@ class DiagnosticFixProvider implements vscode.CodeActionProvider {
if (!this.isFileYAML(document.fileName)) {
return;
}
// console.log(context.diagnostics);
context.diagnostics.forEach(diagnostic => {
// console.log(diagnostic);
if (diagnostic.message.startsWith("The latest version is not used.")) {
const versionPattern = /"(\d+\.\d+\.\d+)"/;
const match = diagnostic.message.match(versionPattern);
Expand All @@ -59,7 +47,6 @@ class DiagnosticFixProvider implements vscode.CodeActionProvider {
}
}
const rule = this.getRuleFromDiagnostic(diagnostic);
// console.log(rule);
if (rule) {
const fixAction = this.createFixAction(document, diagnostic.range, rule);
if (fixAction) {
Expand Down Expand Up @@ -102,11 +89,6 @@ class DiagnosticFixProvider implements vscode.CodeActionProvider {
const codeActions: vscode.CodeAction[] = [];

if (Array.isArray(fix)) {
// return fix.map(fixItem => {
// const given = fixItem.given;
// const quickFixObj = fixItem.function(document, range, given, fixItem.field);
// return performFix(document, range, fixItem.name, quickFixObj);
// });
fix.forEach(fixItem => {
const action = new vscode.CodeAction(fixItem.name, vscode.CodeActionKind.QuickFix);
action.command = {
Expand All @@ -118,9 +100,6 @@ class DiagnosticFixProvider implements vscode.CodeActionProvider {
});
}
else {
// const given = fix.given;
// const quickFixObj = fix.function(document, range, given, fix.field);
// return [performFix(document, range, fix.name, quickFixObj)];
const action = new vscode.CodeAction(fix.name, vscode.CodeActionKind.QuickFix);
action.command = {
command: 'extension.applyFix',
Expand Down
1 change: 0 additions & 1 deletion src/ruleset/defaultFormat.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export default {
// Contains good examples
tags: [
{
name: "tag1",
Expand Down
1 change: 0 additions & 1 deletion src/ruleset/functions/createNewID.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as vscode from 'vscode';
import * as yaml from 'js-yaml';
import { JSONPath } from 'jsonpath-plus';
import { count } from 'console';

function getMessageIDMap(documentContent: string, given: string, field: string) {
const IDMap = new Set<string>();
Expand Down
3 changes: 0 additions & 3 deletions src/ruleset/functions/deleteEmptyVariables.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import * as vscode from 'vscode';
import * as yaml from 'js-yaml';
import { JSONPath } from 'jsonpath-plus';
import { off } from 'process';

const emptyCurlyBracesPattern = /\{\}/g;
const extraDotsPattern = /\.\./g;
Expand Down

0 comments on commit ad81616

Please sign in to comment.