autocompletion: lint
This commit is contained in:
parent
2d2d0cabb3
commit
8e6909478c
3 changed files with 7 additions and 20 deletions
|
|
@ -143,9 +143,10 @@ export default function CodeMirror({
|
||||||
return staticExtensions;
|
return staticExtensions;
|
||||||
}, [keybindings]);
|
}, [keybindings]);
|
||||||
|
|
||||||
const setAutoCompletion = isAutoCompletionEnabled => isAutoCompletionEnabled ?
|
const setAutoCompletion = (isAutoCompletionEnabled) =>
|
||||||
javascriptLanguage.data.of({ autocomplete: strudelAutocomplete }) :
|
isAutoCompletionEnabled
|
||||||
autocompletion({ override: [] })
|
? javascriptLanguage.data.of({ autocomplete: strudelAutocomplete })
|
||||||
|
: autocompletion({ override: [] });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ fontSize, fontFamily }} className="w-full">
|
<div style={{ fontSize, fontFamily }} className="w-full">
|
||||||
|
|
@ -155,7 +156,7 @@ export default function CodeMirror({
|
||||||
onChange={handleOnChange}
|
onChange={handleOnChange}
|
||||||
onCreateEditor={handleOnCreateEditor}
|
onCreateEditor={handleOnCreateEditor}
|
||||||
onUpdate={handleOnUpdate}
|
onUpdate={handleOnUpdate}
|
||||||
extensions={[ ...extensions, setAutoCompletion(isAutoCompletionEnabled) ]}
|
extensions={[...extensions, setAutoCompletion(isAutoCompletionEnabled)]}
|
||||||
basicSetup={{ lineNumbers: isLineNumbersDisplayed }}
|
basicSetup={{ lineNumbers: isLineNumbersDisplayed }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -364,14 +364,7 @@ const fontFamilyOptions = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function SettingsTab({ scheduler }) {
|
function SettingsTab({ scheduler }) {
|
||||||
const {
|
const { theme, keybindings, isLineNumbersDisplayed, isAutoCompletionEnabled, fontSize, fontFamily } = useSettings();
|
||||||
theme,
|
|
||||||
keybindings,
|
|
||||||
isLineNumbersDisplayed,
|
|
||||||
isAutoCompletionEnabled,
|
|
||||||
fontSize,
|
|
||||||
fontFamily
|
|
||||||
} = useSettings();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="text-foreground p-4 space-y-4">
|
<div className="text-foreground p-4 space-y-4">
|
||||||
|
|
|
||||||
|
|
@ -105,14 +105,7 @@ export function Repl({ embedded = false }) {
|
||||||
const [lastShared, setLastShared] = useState();
|
const [lastShared, setLastShared] = useState();
|
||||||
const [pending, setPending] = useState(true);
|
const [pending, setPending] = useState(true);
|
||||||
|
|
||||||
const {
|
const { theme, keybindings, fontSize, fontFamily, isLineNumbersDisplayed, isAutoCompletionEnabled } = useSettings();
|
||||||
theme,
|
|
||||||
keybindings,
|
|
||||||
fontSize,
|
|
||||||
fontFamily,
|
|
||||||
isLineNumbersDisplayed,
|
|
||||||
isAutoCompletionEnabled
|
|
||||||
} = useSettings();
|
|
||||||
|
|
||||||
const { code, setCode, scheduler, evaluate, activateCode, isDirty, activeCode, pattern, started, stop, error } =
|
const { code, setCode, scheduler, evaluate, activateCode, isDirty, activeCode, pattern, started, stop, error } =
|
||||||
useStrudel({
|
useStrudel({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue