define([
  'text!./SourceDetailsDialog.html',
  // '../../lib/codemirror.min',
  '../../lib/CodeMirror/lib/codemirror',
  'css!../../lib/CodeMirror/lib/codemirror',
  '../../lib/CodeMirror/mode/clike/clike',
  '../../lib/CodeMirror/addon/hint/show-hint',
  'css!../../lib/CodeMirror/addon/hint/show-hint',
  'css!../../css/show-hint-webgme',
  '../../lib/CodeMirror/addon/hint/anyword-hint'
  ],
  function(sourceDetailsDialogTemplate, CodeMirror) {

    "use strict";

    var SourceDetailsDialog = function() {
    };

    SourceDetailsDialog.prototype.show = function(name, val, saveCallback) {
      var self = this;
      self._init(name, val, saveCallback);
      self._dialog.modal('show');
      self._dialog.on('shown.bs.modal', function() {
        self._codeMirror.refresh();
      });
      self._dialog.on('hidden.bs.modal', function() {
        self._dialog.remove();
        self._dialog.empty();
        self._dialog = undefined;
      });
    };

    SourceDetailsDialog.prototype._init = function(name, val, saveCallback) {
      var self = this;
      self._dialog = $(sourceDetailsDialogTemplate);
      
      self._el = self._dialog.find('.modal-body').first();
      self._pScript = self._el.find('#pScript').first();
      self._scriptEditor = self._pScript.find('div.controls').first();

      CodeMirror.commands.autocomplete = function(cm) {
        cm.showHint({hint: CodeMirror.hint.anyword});
      };

      self._codeMirror = CodeMirror(self._scriptEditor[0], {
        value: val,
        lineNumbers: true,
        extraKeys: {"Ctrl-Space": "autocomplete"},
        mode: "text/x-nesc"
      });

      /*
      CodeMirror.commands.autocomplete = function(cm) {
        cm.showHint({hint: CodeMirror.hint.anyword});
      }
      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
        lineNumbers: true,
        extraKeys: {"Ctrl-Space": "autocomplete"}
      });
      */

      self._header = self._dialog.find('h3').first();
      self._header.html('Implementation of ' + name);
      
      self._btnSave = self._dialog.find('.btn-save').first();
      self._btnSave.on('click', function (event) {
          var val = self._codeMirror.getValue();
          event.stopPropagation();
          event.preventDefault();
          if (saveCallback) {
            saveCallback.call(self, val);
          }
      });
    };

    return SourceDetailsDialog;

  });
@@ -197,24 +197,80 @@
 ike/clike',%0A
+  // '../../lib/CodeMirror/mode/javascript/javascript',%0A
   '../../lib
@@ -426,23 +426,127 @@
 on/hint/
-anyword
+nesc-hint'%0A  // '../../lib/CodeMirror/addon/hint/anyword-hint'%0A  // '../../lib/CodeMirror/addon/hint/javascript
 -hint'%0A 
@@ -1557,39 +1557,36 @@
 CodeMirror.hint.
-anyword
+nesc
 %7D);%0A      %7D;%0A%0A  
@@ -1780,294 +1780,31 @@
     
-%7D);%0A%0A      /*%0A      CodeMirror.commands.autocomplete = function(cm) %7B%0A        cm.showHint(%7Bhint: CodeMirror.hint.anyword%7D);%0A      %7D%0A      var editor = CodeMirror.fromTextArea(document.getElementById(%22code%22), %7B%0A        lineNumbers: true,%0A        extraKeys: %7B%22Ctrl-Space%22: %22autocomplete%22%7D
+  // mode: %22javascript%22
 %0A   
@@ -1813,17 +1813,8 @@
  %7D);
-%0A      */
 %0A%0A  

Add nesc-hint.js, it's a copy of anyword-hint.js