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 9d5b148 commit bdd70b4
Show file tree
Hide file tree
Showing 43 changed files with 433 additions and 412 deletions.
4 changes: 1 addition & 3 deletions src/app/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import {
faHistory,
IconDefinition,
} from '@fortawesome/free-solid-svg-icons'
import {
faChevronsLeft,
} from '@fortawesome/pro-regular-svg-icons'
import { faChevronsLeft } from '@fortawesome/pro-regular-svg-icons'
import { setChatOpen, toggleChatHistory } from '../features/chat/chatSlice'
import { store } from './store'

Expand Down
1 change: 0 additions & 1 deletion src/appComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
getFocusedTab,
} from './features/selectors'


import { ChatPopup, CommandBar } from './components/markdown'
import { SettingsPopup } from './components/settingsPane'
import { FeedbackArea, LeftSide } from './components/search'
Expand Down
3 changes: 2 additions & 1 deletion src/components/codemirrorHooks/dispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
TransactionSpec,
StateEffect,
Text,
Annotation } from '@codemirror/state'
Annotation,
} from '@codemirror/state'
import { useAppDispatch } from '../../app/hooks'
import { flushTransactions } from '../../features/globalSlice'
import { ReduxTransaction, LineChange } from '../../features/window/state'
Expand Down
19 changes: 10 additions & 9 deletions src/components/codemirrorHooks/extensions.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { useEffect, useMemo } from 'react'
import { EditorState, Prec, Extension, Compartment , RangeSetBuilder } from '@codemirror/state'
import {
EditorState,
Prec,
Extension,
Compartment,
RangeSetBuilder,
} from '@codemirror/state'
import {
closeHoverTooltips,
EditorView,
keymap,
scrollPastEnd,

ViewPlugin,
ViewUpdate,
Decoration,
Expand All @@ -14,12 +19,8 @@ import {
import { syntaxBundle } from '../../features/extensions/syntax'
import { indentationMarkers } from '../../features/extensions/indentLines'
// import { indentationMarkers } from '@replit/codemirror-indentation-markers';
import {
diffExtension,
} from '../../features/extensions/diff'
import {
hackExtension,
} from '../../features/extensions/hackDiff'
import { diffExtension } from '../../features/extensions/diff'
import { hackExtension } from '../../features/extensions/hackDiff'
import { diagnosticsField, lintGutter } from '../../features/linter/lint'
import { autocompleteView } from '../../features/extensions/autocomplete'
import { acceptCompletion } from '@codemirror/autocomplete'
Expand All @@ -29,7 +30,7 @@ import * as ssel from '../../features/settings/settingsSelectors'
import { Tab } from '../../features/window/state'
import { ReactCodeMirrorRef } from '../react-codemirror'
import { getFileIndentUnit } from '../../features/selectors'
import { indentUnit , syntaxTree } from '@codemirror/language'
import { indentUnit, syntaxTree } from '@codemirror/language'
import { vim } from '../codemirror-vim'
import { moveToPane, saveFile } from '../../features/globalSlice'
import { closeTab } from '../../features/globalThunks'
Expand Down
8 changes: 2 additions & 6 deletions src/components/commandPalette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ import {
} from '../features/tools/toolSelectors'
import { Combobox } from '@headlessui/react'
import { toggleFeedback } from '../features/logging/loggingSlice'
import {
selectFocusedTabId,
} from '../features/selectors'
import {
getViewId,
} from '../features/codemirror/codemirrorSelectors'
import { selectFocusedTabId } from '../features/selectors'
import { getViewId } from '../features/codemirror/codemirrorSelectors'
import { getCodeMirrorView } from '../features/codemirror/codemirrorSlice'
import { toggleChatHistory } from '../features/chat/chatSlice'
import { pressAICommand } from '../features/chat/chatThunks'
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// import keybinding and keymap
import { useState, useRef, useMemo, useEffect } from 'react'
import { EditorView , ViewUpdate } from '@codemirror/view'
import { EditorView, ViewUpdate } from '@codemirror/view'
import { vimStateField } from './codemirror-vim/index'
import { historyField } from '@codemirror/commands'
import { EditorState } from '@codemirror/state'
Expand Down
96 changes: 53 additions & 43 deletions src/components/errors.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { useAppDispatch, useAppSelector } from '../app/hooks';
import {closeError} from '../features/globalSlice'
import {getShowErrors, getError} from '../features/selectors';
import { useAppDispatch, useAppSelector } from '../app/hooks'
import { closeError } from '../features/globalSlice'
import { getShowErrors, getError } 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, OpenAIError } from '../utils';
import { CursorLogin, OpenAILoginPanel } from './settingsPane';
import {
NoAuthGlobalOldRateLimitError,
NotLoggedInError,
} from '../utils'
import { OpenAILoginPanel } from './settingsPane'

const customStyles = {
overlay: {
Expand Down Expand Up @@ -49,8 +52,6 @@ const loginStyles = {
},
}



export function ErrorPopup() {
const showError = useAppSelector(getShowErrors)
const error = useAppSelector(getError)
Expand Down Expand Up @@ -78,8 +79,8 @@ export function ErrorPopup() {
</div>
</div>
<div className="errorPopup__body">
Something unexpected happened. Please try again later. If
this continues, please contact [email protected].
Something unexpected happened. Please try again later.
If this continues, please contact [email protected].
<br />
</div>
</div>
Expand All @@ -96,31 +97,35 @@ export function ErrorPopup() {
>
<div className="errorPopup">
<div className="errorPopup__title">
<div className="errorPopup__title_text">
</div>
<div className="errorPopup__title_text"></div>
<div
className="errorPopup__title_close"
onClick={() => dispatch(closeError())}
>
<FontAwesomeIcon icon={faClose} />
</div>
</div>
<div className="signup__body">
<div className="signup__title">Cursor</div>
<div className="signup__module">
<div className="signup__subtitle">To avoid abuse on our backend, we ask that you login in to use the AI features</div>
<div className="signup__signup_button">Log in</div>
<div className="signup__signup_button">Sign up</div>
<div className="signup__body">
<div className="signup__title">Cursor</div>
<div className="signup__module">
<div className="signup__subtitle">
To avoid abuse on our backend, we ask that you
login in to use the AI features
</div>
<div className="signup__module signup__last_module">
<div className="signup__subtitle">Or enter your OpenAI API key</div>
<OpenAILoginPanel onSubmit={
() => {
dispatch(closeError())
}
} />
<div className="signup__signup_button">Log in</div>
<div className="signup__signup_button">Sign up</div>
</div>
<div className="signup__module signup__last_module">
<div className="signup__subtitle">
Or enter your OpenAI API key
</div>
<OpenAILoginPanel
onSubmit={() => {
dispatch(closeError())
}}
/>
</div>
</div>
</div>
</Modal>
)
Expand All @@ -135,30 +140,37 @@ export function ErrorPopup() {
>
<div className="errorPopup">
<div className="errorPopup__title">
<div className="errorPopup__title_text">
</div>
<div className="errorPopup__title_text"></div>
<div
className="errorPopup__title_close"
onClick={() => dispatch(closeError())}
>
<FontAwesomeIcon icon={faClose} />
</div>
</div>
<div className="signup__body">
<div className="signup__title">Free tier limit exceeded</div>
<div className="signup__module">
<div className="signup__subtitle">If you've enjoyed using Cursor, please consider subscribing to one of our paid plans</div>
<div className="signup__signup_button">Upgrade</div>
<div className="signup__body">
<div className="signup__title">
Free tier limit exceeded
</div>
<div className="signup__module">
<div className="signup__subtitle">
If you've enjoyed using Cursor, please consider
subscribing to one of our paid plans
</div>
<div className="signup__module signup__last_module">
<div className="signup__subtitle">Or enter your OpenAI API key to continue using the AI features at-cost</div>
<OpenAILoginPanel onSubmit={
() => {
dispatch(closeError())
}
} />
<div className="signup__signup_button">Upgrade</div>
</div>
<div className="signup__module signup__last_module">
<div className="signup__subtitle">
Or enter your OpenAI API key to continue using
the AI features at-cost
</div>
<OpenAILoginPanel
onSubmit={() => {
dispatch(closeError())
}}
/>
</div>
</div>
</div>
</Modal>
)
Expand All @@ -174,7 +186,7 @@ export function ErrorPopup() {
<div className="errorPopup">
<div className="errorPopup__title">
<div className="errorPopup__title_text">
{/* {error.title} */}
{/* {error.title} */}
</div>
<div
className="errorPopup__title_close"
Expand All @@ -184,13 +196,11 @@ export function ErrorPopup() {
</div>
</div>
<div className="errorPopup__body">
{/* {error.message} */}
{/* {error.message} */}
<br />
</div>
</div>
</Modal>
)
}


}
}
2 changes: 1 addition & 1 deletion src/components/filetree.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect } from 'react'
import React, { useEffect } from 'react'

import { useAppSelector, useAppDispatch } from '../app/hooks'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
Expand Down
3 changes: 2 additions & 1 deletion src/components/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import React, {
} from 'react'
import cx from 'classnames'
import { ActionTips, Tip } from '../app/constants'
import { Message ,
import {
Message,
CodeBlock as CodeBlockType,
CodeSymbolType,
} from '../features/window/state'
Expand Down
2 changes: 1 addition & 1 deletion src/components/react-codemirror/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
highlightActiveLine,
keymap,
} from '@codemirror/view'
import { EditorState, Extension , Prec } from '@codemirror/state'
import { EditorState, Extension, Prec } from '@codemirror/state'
import { history, defaultKeymap, historyKeymap } from '@codemirror/commands'
import { highlightSelectionMatches, searchKeymap } from '@codemirror/search'
import {
Expand Down
4 changes: 1 addition & 3 deletions src/components/react-codemirror/useCodeMirror.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { useEffect, useState, useMemo, useLayoutEffect } from 'react'
import { EditorState, StateEffect, Prec } from '@codemirror/state'
import { EditorState, StateEffect, Prec } from '@codemirror/state'
import { indentWithTab } from '@codemirror/commands'
import { EditorView, keymap, ViewUpdate, placeholder } from '@codemirror/view'
import { basicSetup } from './setup'
import { oneDark } from '@codemirror/theme-one-dark'
import { getStatistics } from './utils'
import { ReactCodeMirrorProps } from '.'



import {
getCodeMirrorView,
upsertEditor,
Expand Down
Loading

0 comments on commit bdd70b4

Please sign in to comment.