File tree Expand file tree Collapse file tree
client/modules/IDE/components/Editor Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { useRef , useEffect } from 'react' ;
22import { EditorView , lineNumbers as lineNumbersExt } from '@codemirror/view' ;
33import { autocompletion , closeBrackets } from '@codemirror/autocomplete' ;
4-
5- // TODO: Check what the v6 variants of these addons are.
6- // import 'codemirror/addon/search/searchcursor';
7- // import 'codemirror/addon/search/matchesonscrollbar';
8- // import 'codemirror/addon/search/match-highlighter';
9- // import 'codemirror/addon/search/jump-to-line';
10-
114import { debounce } from 'lodash' ;
125import { openSearchPanel } from '@codemirror/search' ;
136
@@ -147,7 +140,7 @@ export default function useCodeMirror({
147140 file,
148141 reconfigureEffect
149142 } ) ;
150- } , [ autocompleteHinter ] ) ;
143+ } , [ autocompleteHinter , referenceBaseUrl ] ) ;
151144
152145 // Initializes the files as CodeMirror states.
153146 function initializeDocuments ( ) {
Original file line number Diff line number Diff line change @@ -61,9 +61,7 @@ import { highlightStyle } from './highlightStyle';
6161import { errorDecorationStateField } from './consoleErrorDecoration' ;
6262
6363// ----- TODOS -----
64- // - JSON linter
6564// - shader syntax highlighting
66- // - add docstrings for all exported functions
6765
6866/** Detects what mode the file is based on the name. */
6967export function getFileMode ( fileName ) {
@@ -307,6 +305,7 @@ const extraKeymaps = [
307305] ;
308306const emmetKeymaps = [ { key : 'Tab' , run : expandAbbreviation } ] ;
309307
308+ /** Returns completion options configured for autocomplete. */
310309export const createAutocompleteOptions = ( referenceBaseUrl ) => ( {
311310 tooltipClass : ( ) => 'CodeMirror-hints' ,
312311 closeOnBlur : false ,
You can’t perform that action at this time.
0 commit comments