File tree Expand file tree Collapse file tree 2 files changed +23
-23
lines changed
client/modules/IDE/components Expand file tree Collapse file tree 2 files changed +23
-23
lines changed Original file line number Diff line number Diff line change @@ -417,29 +417,28 @@ class Editor extends React.Component {
417
417
closeOnUnfocus : false
418
418
} ;
419
419
420
- // CSS
421
- if ( _cm . options . mode === 'css' ) {
420
+ if ( _cm . options . mode === 'javascript' ) {
421
+ // JavaScript
422
+ CodeMirror . showHint (
423
+ _cm ,
424
+ ( ) => {
425
+ const c = _cm . getCursor ( ) ;
426
+ const token = _cm . getTokenAt ( c ) ;
427
+
428
+ const hints = this . hinter . search ( token . string ) ;
429
+
430
+ return {
431
+ list : hints ,
432
+ from : CodeMirror . Pos ( c . line , token . start ) ,
433
+ to : CodeMirror . Pos ( c . line , c . ch )
434
+ } ;
435
+ } ,
436
+ hintOptions
437
+ ) ;
438
+ } else if ( _cm . options . mode === 'css' ) {
439
+ // CSS
422
440
CodeMirror . showHint ( _cm , CodeMirror . hint . css , hintOptions ) ;
423
- return ;
424
441
}
425
-
426
- // JavaScript
427
- CodeMirror . showHint (
428
- _cm ,
429
- ( ) => {
430
- const c = _cm . getCursor ( ) ;
431
- const token = _cm . getTokenAt ( c ) ;
432
-
433
- const hints = this . hinter . search ( token . string ) ;
434
-
435
- return {
436
- list : hints ,
437
- from : CodeMirror . Pos ( c . line , token . start ) ,
438
- to : CodeMirror . Pos ( c . line , c . ch )
439
- } ;
440
- } ,
441
- hintOptions
442
- ) ;
443
442
}
444
443
445
444
showReplace ( ) {
Original file line number Diff line number Diff line change 323
323
else {
324
324
const e = ownerDocument . createElement ( 'p' ) ;
325
325
const name = getText ( cur ) ;
326
+
326
327
if ( cur . item && cur . item . type ) {
327
328
cur . displayText = displayHint ( name , cur . item . type ) ;
328
329
}
330
+
329
331
elt . appendChild ( e ) ;
330
332
e . outerHTML =
331
- cur . displayText ||
332
- `<span class="plain-hint-item">${ getText ( cur ) } <span>` ;
333
+ cur . displayText || `<span class="plain-hint-item">${ name } <span>` ;
333
334
}
334
335
elt . hintId = i ;
335
336
}
You can’t perform that action at this time.
0 commit comments