diff --git a/src/grammar-registry.js b/src/grammar-registry.js index 0a233c7831..a0ce8997e3 100644 --- a/src/grammar-registry.js +++ b/src/grammar-registry.js @@ -193,6 +193,10 @@ module.exports = class GrammarRegistry { buffer.getPath(), getGrammarSelectionContent(buffer) ); + + // Emit an event whenever a grammar is auto-assigned + this.emitter.emit("did-auto-assign-grammar", { grammar: result.grammar, buffer: buffer }); + this.languageOverridesByBufferId.delete(buffer.id); this.grammarScoresByBuffer.set(buffer, result.score); if (result.grammar !== buffer.getLanguageMode().grammar) {