{"action":"created","issue":{"url":"https://api.github.com/repos/derjanb/tampermonkey/issues/243","labels_url":"https://api.github.com/repos/derjanb/tampermonkey/issues/243/labels{/name}","comments_url":"https://api.github.com/repos/derjanb/tampermonkey/issues/243/comments","events_url":"https://api.github.com/repos/derjanb/tampermonkey/issues/243/events","html_url":"https://github.com/derjanb/tampermonkey/issues/243","id":113176732,"number":243,"title":"Autocomplete and lint in the editor","user":{"login":"tophf","id":1310400,"avatar_url":"https://avatars.githubusercontent.com/u/1310400?v=3","gravatar_id":"","url":"https://api.github.com/users/tophf","html_url":"https://github.com/tophf","followers_url":"https://api.github.com/users/tophf/followers","following_url":"https://api.github.com/users/tophf/following{/other_user}","gists_url":"https://api.github.com/users/tophf/gists{/gist_id}","starred_url":"https://api.github.com/users/tophf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tophf/subscriptions","organizations_url":"https://api.github.com/users/tophf/orgs","repos_url":"https://api.github.com/users/tophf/repos","events_url":"https://api.github.com/users/tophf/events{/privacy}","received_events_url":"https://api.github.com/users/tophf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/derjanb/tampermonkey/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/derjanb/tampermonkey/milestones/3","html_url":"https://github.com/derjanb/tampermonkey/milestones/3.13","labels_url":"https://api.github.com/repos/derjanb/tampermonkey/milestones/3/labels","id":1375057,"number":3,"title":"3.13","description":"","creator":{"login":"derjanb","id":767504,"avatar_url":"https://avatars.githubusercontent.com/u/767504?v=3","gravatar_id":"","url":"https://api.github.com/users/derjanb","html_url":"https://github.com/derjanb","followers_url":"https://api.github.com/users/derjanb/followers","following_url":"https://api.github.com/users/derjanb/following{/other_user}","gists_url":"https://api.github.com/users/derjanb/gists{/gist_id}","starred_url":"https://api.github.com/users/derjanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derjanb/subscriptions","organizations_url":"https://api.github.com/users/derjanb/orgs","repos_url":"https://api.github.com/users/derjanb/repos","events_url":"https://api.github.com/users/derjanb/events{/privacy}","received_events_url":"https://api.github.com/users/derjanb/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":3,"state":"open","created_at":"2015-10-25T13:00:22Z","updated_at":"2015-11-30T20:48:48Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-10-24T18:46:02Z","updated_at":"2015-12-01T08:33:42Z","closed_at":"2015-11-30T20:28:44Z","body":"Autocomplete is an awesome functionality and in CodeMirror it is provided by [show-hint.js addon](http://codemirror.net/doc/manual.html#addon_show-hint) (see also the [demo  page](http://codemirror.net/demo/complete.html)).\r\n\r\n```html\r\n<link rel=\"stylesheet\" href=\"codemirror/addon/hint/show-hint.css\">\r\n<script src=\"codemirror/addon/hint/show-hint.js\"></script>\r\n<script src=\"codemirror/addon/hint/javascript-hint.js\"></script>\r\n```\r\n```js\r\nCodeMirror.keyMap.pcDefault[\"Ctrl-Space\"] = \"autocomplete\"; // used by \"sublime\" keymap on PC via fallthrough\r\nCodeMirror.keyMap.macDefault[\"Alt-Space\"] = \"autocomplete\"; // OSX uses Ctrl-Space/Cmd-Space for something else\r\n```\r\n\r\nLinting while editing is also awesome: [lint.js addon](http://codemirror.net/doc/manual.html#addon_lint) (see also the [demo page](http://codemirror.net/demo/lint.html)). Requires [JSHint](https://github.com/jshint/jshint). Also, now that script templates are supported you may try adding CoffeeScript lint too, although I don't know how good it is.\r\n\r\n```html\r\n<link rel=\"stylesheet\" href=\"codemirror/addon/lint/lint.css\" />\r\n<script src=\"jshint/jshint.js\"></script>\r\n<script src=\"codemirror/addon/lint/lint.js\"></script>\r\n<script src=\"codemirror/addon/lint/coffeescript-lint.js\"></script>\r\n<script src=\"codemirror/addon/lint/javascript-lint.js\"></script>\r\n```\r\n```js\r\nvar cm = CodeMirror(someElement, {\r\n    lint: true,\r\n    gutters: [\"CodeMirror-linenumbers\", \"CodeMirror-foldgutter\", \"CodeMirror-lint-markers\"],\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/derjanb/tampermonkey/issues/comments/160893674","html_url":"https://github.com/derjanb/tampermonkey/issues/243#issuecomment-160893674","issue_url":"https://api.github.com/repos/derjanb/tampermonkey/issues/243","id":160893674,"user":{"login":"derjanb","id":767504,"avatar_url":"https://avatars.githubusercontent.com/u/767504?v=3","gravatar_id":"","url":"https://api.github.com/users/derjanb","html_url":"https://github.com/derjanb","followers_url":"https://api.github.com/users/derjanb/followers","following_url":"https://api.github.com/users/derjanb/following{/other_user}","gists_url":"https://api.github.com/users/derjanb/gists{/gist_id}","starred_url":"https://api.github.com/users/derjanb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derjanb/subscriptions","organizations_url":"https://api.github.com/users/derjanb/orgs","repos_url":"https://api.github.com/users/derjanb/repos","events_url":"https://api.github.com/users/derjanb/events{/privacy}","received_events_url":"https://api.github.com/users/derjanb/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T08:33:42Z","updated_at":"2015-12-01T08:33:42Z","body":"I explicitly disabled this behavior. If you for example type this:\r\n\r\n    var remVar = null;\r\n    rem\r\n\r\nand then run the autocompletion ```removeEventListener``` would be chosen. But maybe ```remVar``` was expected. Now the user has to delete many characters in order to fix this. I think this is more annoying than pressing Enter if you're happy with the suggested completion.\r\n\r\nI'll take a look at Tern later. If it works well, then auto-completion list should be much better,"}}