<commit_before># tern-browser-extension

[![Build Status](https://secure.travis-ci.org/angelozerr/tern-browser-extension.png)](http://travis-ci.org/angelozerr/tern-browser-extension)
[![NPM version](https://img.shields.io/npm/v/tern-browser-extension.svg)](https://www.npmjs.org/package/tern-browser-extension)  

At first tern-browser-extension needs teh accept of [this PR](https://github.com/marijnh/tern/pull/550) because it needs preParse method.

[tern-browser-extension](https://github.com/angelozerr/tern-browser-extension) is a tern plugin which extends [browser.json](https://github.com/marijnh/tern/blob/master/defs/browser.json) and provides the following features : 

 * use tern inside HTML. The plugin extract JavaScript code from scripts elements before creating the acorn AST.
 * get completion for element ids when document.getElementById is used:

![CodeMirror & GetElementById completion](https://github.com/angelozerr/tern-browser-extension/wiki/images/CodeMirror_GetElementByIdCompletion.png)

 * returns the well HTML element instance (eg : HTMLInputElement) when getElementById or createElement is used.<commit_msg>Add validation screenshot.<commit_after># tern-browser-extension

[![Build Status](https://secure.travis-ci.org/angelozerr/tern-browser-extension.png)](http://travis-ci.org/angelozerr/tern-browser-extension)
[![NPM version](https://img.shields.io/npm/v/tern-browser-extension.svg)](https://www.npmjs.org/package/tern-browser-extension)  

At first tern-browser-extension needs the accept of [this PR](https://github.com/marijnh/tern/pull/550) because it needs preParse method.

[tern-browser-extension](https://github.com/angelozerr/tern-browser-extension) is a tern plugin which extends [browser.json](https://github.com/marijnh/tern/blob/master/defs/browser.json) and provides the following features : 

 * use tern inside HTML. The plugin extract JavaScript code from scripts elements before creating the acorn AST.
 * get completion for element ids when document.getElementById is used:

![CodeMirror & GetElementById completion](https://github.com/angelozerr/tern-browser-extension/wiki/images/CodeMirror_GetElementByIdCompletion.png)

 * validate element id if the editor supports [tern-lint](https://github.com/angelozerr/tern-lint) : 

![CodeMirror & GetElementById completion](https://github.com/angelozerr/tern-browser-extension/wiki/images/CodeMirror_GetElementByIdValidation.png) 

 * returns the well HTML element instance (eg : HTMLInputElement) when getElementById or createElement is used.
{'fraction_non_alphanumeric': 0.12224842767295598, 'fraction_numerical': 0.0023584905660377358, 'mean_word_length': 5.475826972010178, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1103258', 'n_tokens_mistral': 745, 'n_tokens_neox': 710, 'n_words': 164}