Skip to content

Commit

Permalink
Ran prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanger2000 committed Mar 30, 2023
1 parent 3d0db7a commit f2c3b9f
Show file tree
Hide file tree
Showing 70 changed files with 256 additions and 263 deletions.
4 changes: 2 additions & 2 deletions src/app/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
faTimes,
faHistory,
IconDefinition,
faHistory,
faTimes,
} from '@fortawesome/free-solid-svg-icons'
import { faChevronsLeft } from '@fortawesome/pro-regular-svg-icons'
import { setChatOpen, toggleChatHistory } from '../features/chat/chatSlice'
Expand Down
2 changes: 1 addition & 1 deletion src/app/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'
import type { RootState, AppDispatch } from './store'
import type { AppDispatch, RootState } from './store'

// Use throughout your app instead of plain `useDispatch` and `useSelector`
export const useAppDispatch: () => AppDispatch = useDispatch
Expand Down
6 changes: 3 additions & 3 deletions src/app/store.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
configureStore,
combineReducers,
ThunkAction,
Action,
PreloadedState,
ThunkAction,
combineReducers,
configureStore,
} from '@reduxjs/toolkit'
import globalReducer from '../features/globalSlice'
import { initialState } from '../features/window/state'
Expand Down
10 changes: 5 additions & 5 deletions src/appComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
useCallback,
useEffect,
useLayoutEffect,
useRef,
useEffect,
useState,
useCallback,
} from 'react'
import { faClose } from '@fortawesome/pro-regular-svg-icons'
import Modal from 'react-modal'

import { useAppSelector, useAppDispatch } from './app/hooks'
import { useAppDispatch, useAppSelector } from './app/hooks'
import { PaneHolder } from './components/pane'
import * as gs from './features/globalSlice'
import * as cs from './features/chat/chatSlice'
Expand All @@ -19,11 +19,11 @@ import * as tsel from './features/tools/toolSelectors'
import * as gsel from './features/selectors'

import {
getFocusedTab,
getFolders,
getPaneStateBySplits,
getZoomFactor,
getRootPath,
getFocusedTab,
getZoomFactor,
} from './features/selectors'

import { ChatPopup, CommandBar } from './components/markdown'
Expand Down
4 changes: 2 additions & 2 deletions src/components/codemirror-vim/block-cursor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SelectionRange, Prec } from '@codemirror/state'
import { ViewUpdate, EditorView, Direction } from '@codemirror/view'
import { Prec, SelectionRange } from '@codemirror/state'
import { Direction, EditorView, ViewUpdate } from '@codemirror/view'
import { CodeMirror } from '.'

type Measure = { cursors: Piece[] }
Expand Down
26 changes: 13 additions & 13 deletions src/components/codemirror-vim/cm_adapter.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { EditorSelection, Text, MapMode, ChangeDesc } from '@codemirror/state'
import { ChangeDesc, EditorSelection, MapMode, Text } from '@codemirror/state'
import {
StringStream,
matchBrackets,
indentUnit,
ensureSyntaxTree,
foldCode,
indentUnit,
matchBrackets,
} from '@codemirror/language'
import { EditorView, ViewUpdate } from '@codemirror/view'
import { RegExpCursor, setSearchQuery, SearchQuery } from '@codemirror/search'
import { RegExpCursor, SearchQuery, setSearchQuery } from '@codemirror/search'
import {
insertNewlineAndIndent,
indentMore,
indentLess,
indentSelection,
deleteCharBackward,
deleteCharForward,
cursorCharBackward,
cursorCharLeft,
undo,
redo,
cursorLineBoundaryBackward,
cursorLineBoundaryForward,
cursorCharBackward,
deleteCharBackward,
deleteCharForward,
indentLess,
indentMore,
indentSelection,
insertNewlineAndIndent,
redo,
undo,
} from '@codemirror/commands'

interface Pos {
Expand Down
12 changes: 6 additions & 6 deletions src/components/codemirror-vim/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import { CodeMirror } from './cm_adapter'
import { BlockCursorPlugin, hideNativeSelection } from './block-cursor'
import {
Extension,
StateField,
StateEffect,
RangeSetBuilder,
StateEffect,
StateField,
} from '@codemirror/state'
import {
ViewPlugin,
PluginValue,
ViewUpdate,
Decoration,
EditorView,
showPanel,
Panel,
PluginValue,
ViewPlugin,
ViewUpdate,
showPanel,
} from '@codemirror/view'
import { setSearchQuery } from '@codemirror/search'

Expand Down
2 changes: 1 addition & 1 deletion src/components/codemirrorHooks/diffHook.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EditorView } from '@codemirror/view'
import { BotMessage } from '../../features/window/state'
import { useRef, useEffect } from 'react'
import { useEffect, useRef } from 'react'
import { EditorState, Text } from '@codemirror/state'
import { rejectDiff, setDiff } from '../../features/extensions/diff'
import { editBoundaryState } from '../../features/extensions/hackDiff'
Expand Down
8 changes: 4 additions & 4 deletions src/components/codemirrorHooks/dispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { EditorView } from '@codemirror/view'
import React, { useEffect } from 'react'
import { ReactCodeMirrorRef } from '../react-codemirror'
import {
Transaction,
TransactionSpec,
Annotation,
StateEffect,
Text,
Annotation,
Transaction,
TransactionSpec,
} from '@codemirror/state'
import { useAppDispatch } from '../../app/hooks'
import { flushTransactions } from '../../features/globalSlice'
import { ReduxTransaction, LineChange } from '../../features/window/state'
import { LineChange, ReduxTransaction } from '../../features/window/state'
import { showBar } from '../../features/extensions/cmdZBar'

import { reduxTransaction } from '../../features/extensions/utils'
Expand Down
20 changes: 10 additions & 10 deletions src/components/codemirrorHooks/extensions.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { useEffect, useMemo } from 'react'
import {
Compartment,
EditorState,
Prec,
Extension,
Compartment,
Prec,
RangeSetBuilder,
} from '@codemirror/state'
import {
closeHoverTooltips,
Decoration,
DecorationSet,
EditorView,
keymap,
scrollPastEnd,
ViewPlugin,
ViewUpdate,
Decoration,
DecorationSet,
closeHoverTooltips,
keymap,
scrollPastEnd,
} from '@codemirror/view'
import { syntaxBundle } from '../../features/extensions/syntax'
import { indentationMarkers } from '../../features/extensions/indentLines'
Expand All @@ -36,10 +36,10 @@ import { moveToPane, saveFile } from '../../features/globalSlice'
import { closeTab } from '../../features/globalThunks'
import { languageBundle } from '../../features/extensions/lsp'
import {
completionDecoration,
copilotBundle,
rejectSuggestionCommand,
getClient,
completionDecoration,
rejectSuggestionCommand,
} from '../../features/extensions/ghostText'
import {
copilotStatus,
Expand All @@ -58,7 +58,7 @@ import { newLineText } from '../../features/extensions/newLineText'
import { Tree } from '@lezer/common'
import { barExtension } from '../../features/extensions/cmdZBar'
import { updateCommentsEffect } from '../../features/extensions/comments'
import { getStyleTags, tags, Tag } from '@lezer/highlight'
import { Tag, getStyleTags, tags } from '@lezer/highlight'
import { fixLintExtension } from '../../features/linter/fixLSPExtension'
import { storePaneIdExtensions } from '../../features/extensions/storePane'
import { store } from '../../app/store'
Expand Down
4 changes: 2 additions & 2 deletions src/components/commandPalette.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useRef, useState, useMemo, useCallback } from 'react'
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { AnyAction, Dispatch } from '@reduxjs/toolkit'
import { useAppDispatch, useAppSelector } from '../app/hooks'
import cx from 'classnames'
Expand All @@ -12,8 +12,8 @@ import {
openFileTree,
openSearch,
triggerFileSearch,
untriggerCommandPalette,
untriggerAICommandPalette,
untriggerCommandPalette,
} from '../features/tools/toolSlice'
import { toggleSettings } from '../features/settings/settingsSlice'
import {
Expand Down
18 changes: 9 additions & 9 deletions src/components/editor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// import keybinding and keymap
import { useState, useRef, useMemo, useEffect } from 'react'
import { useEffect, useMemo, useRef, useState } from 'react'
import { EditorView, ViewUpdate } from '@codemirror/view'
import { vimStateField } from './codemirror-vim/index'
import { historyField } from '@codemirror/commands'
Expand All @@ -11,16 +11,16 @@ import { throttleCallback } from './componentUtils'
import {
getCachedTab,
getFileContents,
getTab,
getKeyListeners,
getFilePath,
getFileName,
getPaneIsActive,
getFileIndentUnit,
getRelativeFilePath,
getPageType,
getFileName,
getFilePath,
getFileRenameName,
getKeyListeners,
getPageType,
getPaneIsActive,
getPendingTransactions,
getRelativeFilePath,
getTab,
} from '../features/selectors'
import { useAppDispatch, useAppSelector } from '../app/hooks'
import { CachedTab, ReduxTransaction, Tab } from '../features/window/state'
Expand All @@ -34,9 +34,9 @@ import * as csel from '../features/chat/chatSelectors'
//import { useRenderDiffs} from './chat/hooks';
import { diagnosticsField, setDiagnostics } from '../features/linter/lint'
import {
useDispatchHook,
customDispatch,
dontShowAnnotation,
useDispatchHook,
} from './codemirrorHooks/dispatch'
import { getSettings } from '../features/settings/settingsSelectors'
import { useExtensions } from './codemirrorHooks/extensions'
Expand Down
7 changes: 2 additions & 5 deletions src/components/errors.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { useAppDispatch, useAppSelector } from '../app/hooks'
import { closeError } from '../features/globalSlice'
import { getShowErrors, getError } from '../features/selectors'
import { getError, getShowErrors } from '../features/selectors'
import { faClose } from '@fortawesome/pro-regular-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import Modal from 'react-modal'
import {
NoAuthGlobalOldRateLimitError,
NotLoggedInError,
} from '../utils'
import { NoAuthGlobalOldRateLimitError, NotLoggedInError } from '../utils'
import { OpenAILoginPanel } from './settingsPane'

const customStyles = {
Expand Down
6 changes: 3 additions & 3 deletions src/components/filetree.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React, { useEffect } from 'react'

import { useAppSelector, useAppDispatch } from '../app/hooks'
import { useAppDispatch, useAppSelector } from '../app/hooks'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import {
faChevronDown,
faChevronRight,
faFile,
faCode,
faImage,
faCodeMerge,
faEyeSlash,
faFile,
faGear,
faImage,
faInfoCircle,
} from '@fortawesome/sharp-solid-svg-icons'
import * as gs from '../features/globalSlice'
Expand Down
16 changes: 8 additions & 8 deletions src/components/markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React, {
useRef,
useEffect,
useState,
useCallback,
ReactNode,
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from 'react'
import cx from 'classnames'
import { ActionTips, Tip } from '../app/constants'
import {
Message,
CodeBlock as CodeBlockType,
CodeSymbolType,
Message,
} from '../features/window/state'
import { faArrowUp, faClose } from '@fortawesome/pro-regular-svg-icons'
import { getIconElement } from '../components/filetree'
Expand All @@ -25,13 +25,13 @@ import {
} from '@codemirror/view'
import { EditorState } from '@codemirror/state'
import { languages } from '@codemirror/language-data'
import { useAppSelector, useAppDispatch } from '../app/hooks'
import { useAppDispatch, useAppSelector } from '../app/hooks'
import { syntaxBundle } from '../features/extensions/syntax'
import {
getFilePath,
getCurrentFilePath,
getFile,
getFilePath,
getFolderPath,
getCurrentFilePath,
} from '../features/selectors'
import { ContextBuilder } from '../features/chat/context'

Expand Down
4 changes: 2 additions & 2 deletions src/components/pane.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useState } from 'react'
import { useAppDispatch, useAppSelector } from '../app/hooks'
import {
getPane,
getCurrentTab,
getDraggingTabId,
getPane,
getTab,
} from '../features/selectors'
import { selectPane, moveDraggingTabToPane } from '../features/globalSlice'
import { moveDraggingTabToPane, selectPane } from '../features/globalSlice'
import { HoverState } from '../features/window/state'

import { TabBar } from './tabs'
Expand Down
2 changes: 1 addition & 1 deletion src/components/react-codemirror/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef, forwardRef, useImperativeHandle } from 'react'
import React, { forwardRef, useImperativeHandle, useRef } from 'react'
import {
EditorState,
EditorStateConfig,
Expand Down
Loading

0 comments on commit f2c3b9f

Please sign in to comment.