Skip to content

General cleanup #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Aug 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"cSpell.words": [
Expand Down
139 changes: 0 additions & 139 deletions src/NavigationMap.ts

This file was deleted.

12 changes: 6 additions & 6 deletions src/actions/BringMoveSwap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import {
Graph,
TypedSelection,
Edit,
} from "../Types";
import { runForEachEditor } from "../targetUtils";
} from "../typings/Types";
import { runForEachEditor } from "../util/targetUtils";
import update from "immutability-helper";
import displayPendingEditDecorations from "../editDisplayUtils";
import { performOutsideAdjustment } from "../performInsideOutsideAdjustment";
import displayPendingEditDecorations from "../util/editDisplayUtils";
import { performOutsideAdjustment } from "../util/performInsideOutsideAdjustment";
import { flatten, zip } from "lodash";
import { Selection, TextEditor, Range } from "vscode";
import { performEditsAndUpdateSelections } from "../updateSelections";
import { getTextWithPossibleDelimiter } from "../getTextWithPossibleDelimiter";
import { performEditsAndUpdateSelections } from "../util/updateSelections";
import { getTextWithPossibleDelimiter } from "../util/getTextWithPossibleDelimiter";

type ActionType = "bring" | "move" | "swap";

Expand Down
9 changes: 6 additions & 3 deletions src/actions/Call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import {
ActionPreferences,
Graph,
TypedSelection,
} from "../Types";
import { ensureSingleTarget } from "../targetUtils";
} from "../typings/Types";
import { ensureSingleTarget } from "../util/targetUtils";

export default class Call implements Action {
targetPreferences: ActionPreferences[] = [{ insideOutsideType: "inside" }];
targetPreferences: ActionPreferences[] = [
{ insideOutsideType: "inside" },
{ insideOutsideType: "inside" },
];

constructor(private graph: Graph) {
this.run = this.run.bind(this);
Expand Down
6 changes: 3 additions & 3 deletions src/actions/clear.ts → src/actions/Clear.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
ActionReturnValue,
Graph,
TypedSelection,
} from "../Types";
import { ensureSingleEditor } from "../targetUtils";
import { setSelectionsAndFocusEditor } from "../setSelectionsAndFocusEditor";
} from "../typings/Types";
import { ensureSingleEditor } from "../util/targetUtils";
import { setSelectionsAndFocusEditor } from "../util/setSelectionsAndFocusEditor";

export default class Clear implements Action {
targetPreferences: ActionPreferences[] = [{ insideOutsideType: "inside" }];
Expand Down
12 changes: 6 additions & 6 deletions src/CommandAction.ts → src/actions/CommandAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import {
Graph,
TypedSelection,
SelectionWithEditor,
} from "./Types";
import displayPendingEditDecorations from "./editDisplayUtils";
import { runOnTargetsForEachEditor } from "./targetUtils";
import { focusEditor } from "./setSelectionsAndFocusEditor";
} from "../typings/Types";
import displayPendingEditDecorations from "../util/editDisplayUtils";
import { runOnTargetsForEachEditor } from "../util/targetUtils";
import { focusEditor } from "../util/setSelectionsAndFocusEditor";
import { flatten } from "lodash";
import { callFunctionAndUpdateSelections } from "./updateSelections";
import { ensureSingleEditor } from "./targetUtils";
import { callFunctionAndUpdateSelections } from "../util/updateSelections";
import { ensureSingleEditor } from "../util/targetUtils";

export default class CommandAction implements Action {
targetPreferences: ActionPreferences[] = [{ insideOutsideType: "inside" }];
Expand Down
4 changes: 2 additions & 2 deletions src/actions/Comment.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Graph } from "../Types";
import CommandAction from "../CommandAction";
import { Graph } from "../typings/Types";
import CommandAction from "./CommandAction";

export class CommentLines extends CommandAction {
constructor(graph: Graph) {
Expand Down
12 changes: 6 additions & 6 deletions src/actions/CopyLines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import {
ActionReturnValue,
Graph,
TypedSelection,
} from "../Types";
} from "../typings/Types";
import { Range, Selection, TextEditor } from "vscode";
import { performEditsAndUpdateSelections } from "../updateSelections";
import { displayPendingEditDecorationsForSelection } from "../editDisplayUtils";
import { runOnTargetsForEachEditor } from "../targetUtils";
import { performEditsAndUpdateSelections } from "../util/updateSelections";
import { displayPendingEditDecorationsForSelection } from "../util/editDisplayUtils";
import { runOnTargetsForEachEditor } from "../util/targetUtils";
import { flatten } from "lodash";
import unifyRanges from "../unifyRanges";
import expandToContainingLine from "../expandToContainingLine";
import unifyRanges from "../util/unifyRanges";
import expandToContainingLine from "../util/expandToContainingLine";

class CopyLines implements Action {
targetPreferences: ActionPreferences[] = [{ insideOutsideType: "inside" }];
Expand Down
10 changes: 5 additions & 5 deletions src/actions/CutCopyPaste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
ActionReturnValue,
Graph,
TypedSelection,
} from "../Types";
import { performInsideOutsideAdjustment } from "../performInsideOutsideAdjustment";
import CommandAction from "../CommandAction";
import displayPendingEditDecorations from "../editDisplayUtils";
import { getOutsideOverflow } from "../targetUtils";
} from "../typings/Types";
import { performInsideOutsideAdjustment } from "../util/performInsideOutsideAdjustment";
import CommandAction from "./CommandAction";
import displayPendingEditDecorations from "../util/editDisplayUtils";
import { getOutsideOverflow } from "../util/targetUtils";
import { zip } from "lodash";

export class Cut implements Action {
Expand Down
8 changes: 4 additions & 4 deletions src/actions/delete.ts → src/actions/Delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
ActionReturnValue,
Graph,
TypedSelection,
} from "../Types";
import { runOnTargetsForEachEditor } from "../targetUtils";
import displayPendingEditDecorations from "../editDisplayUtils";
} from "../typings/Types";
import { runOnTargetsForEachEditor } from "../util/targetUtils";
import displayPendingEditDecorations from "../util/editDisplayUtils";
import { flatten } from "lodash";
import { performEditsAndUpdateSelections } from "../updateSelections";
import { performEditsAndUpdateSelections } from "../util/updateSelections";

export default class Delete implements Action {
targetPreferences: ActionPreferences[] = [{ insideOutsideType: "outside" }];
Expand Down
2 changes: 1 addition & 1 deletion src/actions/EditNewLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ActionReturnValue,
Graph,
TypedSelection,
} from "../Types";
} from "../typings/Types";
import { commands, Selection } from "vscode";

class EditNewLine implements Action {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
ActionReturnValue,
Graph,
TypedSelection,
} from "../Types";
import { ensureSingleTarget } from "../targetUtils";
} from "../typings/Types";
import { ensureSingleTarget } from "../util/targetUtils";
import { commands } from "vscode";

export default class ExtractVariable implements Action {
Expand Down
4 changes: 2 additions & 2 deletions src/actions/Find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
ActionPreferences,
Graph,
TypedSelection,
} from "../Types";
} from "../typings/Types";
import { commands } from "vscode";
import { ensureSingleTarget } from "../targetUtils";
import { ensureSingleTarget } from "../util/targetUtils";

export class FindInFiles implements Action {
targetPreferences: ActionPreferences[] = [{ insideOutsideType: "inside" }];
Expand Down
4 changes: 2 additions & 2 deletions src/actions/fold.ts → src/actions/Fold.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
ActionReturnValue,
Graph,
TypedSelection,
} from "../Types";
import { ensureSingleEditor } from "../targetUtils";
} from "../typings/Types";
import { ensureSingleEditor } from "../util/targetUtils";

class FoldAction implements Action {
targetPreferences: ActionPreferences[] = [{ insideOutsideType: "outside" }];
Expand Down
6 changes: 3 additions & 3 deletions src/actions/GetText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
ActionReturnValue,
Graph,
TypedSelection,
} from "../Types";
import displayPendingEditDecorations from "../editDisplayUtils";
import { ensureSingleTarget } from "../targetUtils";
} from "../typings/Types";
import displayPendingEditDecorations from "../util/editDisplayUtils";
import { ensureSingleTarget } from "../util/targetUtils";

export default class GetText implements Action {
targetPreferences: ActionPreferences[] = [{ insideOutsideType: "inside" }];
Expand Down
4 changes: 2 additions & 2 deletions src/actions/Indent.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Graph } from "../Types";
import CommandAction from "../CommandAction";
import { Graph } from "../typings/Types";
import CommandAction from "./CommandAction";

export class IndentLines extends CommandAction {
constructor(graph: Graph) {
Expand Down
8 changes: 4 additions & 4 deletions src/actions/InsertEmptyLines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
ActionReturnValue,
Graph,
TypedSelection,
} from "../Types";
} from "../typings/Types";
import { Selection, Range } from "vscode";
import { displayPendingEditDecorationsForSelection } from "../editDisplayUtils";
import { runOnTargetsForEachEditor } from "../targetUtils";
import { performEditsAndUpdateSelections } from "../updateSelections";
import { displayPendingEditDecorationsForSelection } from "../util/editDisplayUtils";
import { runOnTargetsForEachEditor } from "../util/targetUtils";
import { performEditsAndUpdateSelections } from "../util/updateSelections";
import { flatten } from "lodash";

class InsertEmptyLines implements Action {
Expand Down
10 changes: 5 additions & 5 deletions src/actions/Replace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import {
ActionReturnValue,
Graph,
TypedSelection,
} from "../Types";
import displayPendingEditDecorations from "../editDisplayUtils";
import { runForEachEditor } from "../targetUtils";
} from "../typings/Types";
import displayPendingEditDecorations from "../util/editDisplayUtils";
import { runForEachEditor } from "../util/targetUtils";
import { flatten, zip } from "lodash";
import { maybeAddDelimiter } from "../getTextWithPossibleDelimiter";
import { performEditsAndUpdateSelections } from "../updateSelections";
import { maybeAddDelimiter } from "../util/getTextWithPossibleDelimiter";
import { performEditsAndUpdateSelections } from "../util/updateSelections";

type RangeGenerator = { start: number };

Expand Down
8 changes: 4 additions & 4 deletions src/actions/Scroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
ActionReturnValue,
Graph,
TypedSelection,
} from "../Types";
import { displayDecorationsWhileRunningFunc } from "../editDisplayUtils";
import { groupBy } from "../itertools";
} from "../typings/Types";
import { displayDecorationsWhileRunningFunc } from "../util/editDisplayUtils";
import { groupBy } from "../util/itertools";
import { commands, window, workspace } from "vscode";
import { focusEditor } from "../setSelectionsAndFocusEditor";
import { focusEditor } from "../util/setSelectionsAndFocusEditor";

class Scroll implements Action {
targetPreferences: ActionPreferences[] = [{ insideOutsideType: "inside" }];
Expand Down
Loading