Skip to content

Commit 819b9cb

Browse files
authored
Merge pull request #2 from kammeows/Branch_Kamakshi
Branch kamakshi
2 parents 5fc1c64 + e8bf752 commit 819b9cb

File tree

10 files changed

+2890
-124
lines changed

10 files changed

+2890
-124
lines changed

client/modules/IDE/components/Editor/index.jsx

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ import { EditorContainer, EditorHolder } from './MobileEditor';
7373
import { FolderIcon } from '../../../../common/icons';
7474
import IconButton from '../../../../common/IconButton';
7575

76+
import contextAwareHinter from '../contextAwareHinter';
77+
7678
emmet(CodeMirror);
7779

7880
window.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

Comments
 (0)