@@ -73,6 +73,8 @@ import { EditorContainer, EditorHolder } from './MobileEditor';
73
73
import { FolderIcon } from '../../../../common/icons' ;
74
74
import IconButton from '../../../../common/IconButton' ;
75
75
76
+ import contextAwareHinter from '../contextAwareHinter' ;
77
+
76
78
emmet ( CodeMirror ) ;
77
79
78
80
window . JSHINT = JSHINT ;
@@ -465,11 +467,8 @@ class Editor extends React.Component {
465
467
( ) => {
466
468
const c = _cm . getCursor ( ) ;
467
469
const token = _cm . getTokenAt ( c ) ;
468
-
469
- const hints = this . hinter
470
- . search ( token . string )
471
- . filter ( ( h ) => h . item . text [ 0 ] === token . string [ 0 ] ) ;
472
-
470
+ const hints = contextAwareHinter ( _cm , { hinter : this . hinter } ) ;
471
+ console . log ( 'hints= ' , hints ) ;
473
472
return {
474
473
list : hints ,
475
474
from : CodeMirror . Pos ( c . line , token . start ) ,
@@ -478,6 +477,26 @@ class Editor extends React.Component {
478
477
} ,
479
478
hintOptions
480
479
) ;
480
+
481
+ // CodeMirror.showHint(
482
+ // _cm,
483
+ // () => {
484
+ // const c = _cm.getCursor();
485
+ // const token = _cm.getTokenAt(c);
486
+ // const hints = this.hinter
487
+ // .search(token.string)
488
+ // .filter((h) => h.item.text[0] === token.string[0]);
489
+ // console.log('c= ', c);
490
+ // console.log('token= ', token);
491
+ // console.log('hints= ', hints);
492
+ // return {
493
+ // list: hints,
494
+ // from: CodeMirror.Pos(c.line, token.start),
495
+ // to: CodeMirror.Pos(c.line, c.ch)
496
+ // };
497
+ // },
498
+ // hintOptions
499
+ // );
481
500
} else if ( _cm . options . mode === 'css' ) {
482
501
// CSS
483
502
CodeMirror . showHint ( _cm , CodeMirror . hint . css , hintOptions ) ;
0 commit comments