@@ -73,6 +73,8 @@ import { EditorContainer, EditorHolder } from './MobileEditor';
7373import { FolderIcon } from '../../../../common/icons' ;
7474import IconButton from '../../../../common/IconButton' ;
7575
76+ import contextAwareHinter from '../contextAwareHinter' ;
77+
7678emmet ( CodeMirror ) ;
7779
7880window . JSHINT = JSHINT ;
@@ -465,11 +467,8 @@ class Editor extends React.Component {
465467 ( ) => {
466468 const c = _cm . getCursor ( ) ;
467469 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 ) ;
473472 return {
474473 list : hints ,
475474 from : CodeMirror . Pos ( c . line , token . start ) ,
@@ -478,6 +477,26 @@ class Editor extends React.Component {
478477 } ,
479478 hintOptions
480479 ) ;
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+ // );
481500 } else if ( _cm . options . mode === 'css' ) {
482501 // CSS
483502 CodeMirror . showHint ( _cm , CodeMirror . hint . css , hintOptions ) ;
0 commit comments