Skip to content

Commit

Permalink
chore: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
danielo515 committed Nov 4, 2023
1 parent a89d1a2 commit 8567b8a
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 51 deletions.
2 changes: 1 addition & 1 deletion src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { MigrationError } from "./core/formDefinitionSchema";
import FormResult from "./core/FormResult";
import { exampleModalDefinition } from "./exampleModalDefinition";
import ModalFormPlugin from "./main";
import { ModalFormError } from "./utils/Error";
import { ModalFormError } from "./utils/ModalFormError";
import { FormModal } from "./FormModal";
import { log_error, log_notice } from "./utils/Log";

Expand Down
2 changes: 1 addition & 1 deletion src/core/FormResult.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { objectSelect } from './objectSelect';
import { stringifyYaml } from "obsidian";
import { log_error } from "../utils/Log";
import { ModalFormError } from "../utils/Error";
import { ModalFormError } from "../utils/ModalFormError";

type ResultStatus = "ok" | "cancelled";

Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ModalFormSettingTab } from "src/ModalFormSettingTab";
import { API } from "src/API";
import { EDIT_FORM_VIEW, EditFormView } from "src/views/EditFormView";
import { MANAGE_FORMS_VIEW, ManageFormsView } from "src/views/ManageFormsView";
import { ModalFormError } from "src/utils/Error";
import { ModalFormError } from "src/utils/ModalFormError";
import { type FormDefinition } from "src/core/formDefinition";
import { formNeedsMigration, migrateToLatest, MigrationError, InvalidData } from "./core/formDefinitionSchema";
import { parseSettings, type ModalFormSettings, type OpenPosition, getDefaultSettings } from "src/core/settings";
Expand Down
2 changes: 1 addition & 1 deletion src/suggesters/SafeDataviewQuery.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { E, Either, flow } from "@std";
import { pipe } from "fp-ts/lib/function";
import { App } from "obsidian";
import { ModalFormError } from "src/utils/Error";
import { ModalFormError } from "src/utils/ModalFormError";
import { log_error } from "src/utils/Log";

type DataviewQuery = (dv: unknown, pages: unknown) => unknown;
Expand Down
45 changes: 0 additions & 45 deletions src/utils/Error.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/utils/Log.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Notice } from "obsidian";
import { ModalFormError } from "./Error";
import { ModalFormError } from "./ModalFormError";


export function log_notice(title: string, msg: string | DocumentFragment): void {
Expand Down
7 changes: 7 additions & 0 deletions src/utils/ModalFormError.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export class ModalFormError extends Error {
constructor(msg: string, public console_msg?: string) {
super(msg);
this.name = this.constructor.name;
Error.captureStackTrace(this, this.constructor);
}
}
2 changes: 1 addition & 1 deletion src/views/FormBuilder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import InputBuilderSelect from "./components/InputBuilderSelect.svelte";
import InputFolder from "./components/InputFolder.svelte";
import { log_error } from "src/utils/Log";
import { ModalFormError } from "src/utils/Error";
import { ModalFormError } from "src/utils/ModalFormError";
export let definition: EditableFormDefinition = {
title: "",
Expand Down

0 comments on commit 8567b8a

Please sign in to comment.