public void Compile_CompilesEmmetEngineScript() { // Arrange V8Engine engine = new V8Engine(); EngineCompiler compiler = new EngineCompiler(engine); // Act compiler.CompileCore(); // Assert ObjectHandle emmet = engine.DynamicGlobalObject.window.emmet; emmet.Should().NotBeNull(); }
private void InitializeEngine() { this.Trace("Started initializing Emmet engine."); _engine = new V8Engine(); var compiler = new EngineCompiler(_engine); compiler.CompileCore(); compiler.RegisterCallbacks(_editor); if (null != _extensionsDir) { compiler.LoadExtensions(_extensionsDir); } this.Trace("Emmet engine successfully initialized."); }
public void LoadExtensions_PointedToPreferencesFile_LoadsCustomSnippets() { // Arrange V8Engine engine = new V8Engine(); EngineCompiler compiler = new EngineCompiler(engine); // Act compiler.CompileCore(); compiler.LoadExtensions(TestContext.TestDeploymentDir); // Assert string script = "window.emmet.resources.fuzzyFindSnippet('css', 'section')"; Handle result = engine.Execute(script); // preferences.json file contains "section" abbreviation for css. If we are able to find it then // our extension has been loaded correctly. result.IsObject.Should().BeTrue(); }
private void InitializeEngine() { Trace("Started initializing Emmet engine."); _engine = JavaScriptRuntime.Create(JavaScriptRuntimeAttributes.EnableIdleProcessing); _context = _engine.CreateContext(); JavaScriptContext.Current = _context; var compiler = new EngineCompiler(); compiler.CompileCore(_currentSourceContext); if (null != _extensionsDir) { compiler.LoadExtensions(_extensionsDir, _currentSourceContext); } Trace("Emmet engine successfully initialized."); _initialized = true; }
private void InitializeEngine() { this.Trace("Started initializing Emmet engine."); _engine = new V8Engine(); var compiler = new EngineCompiler(_engine); compiler.CompileCore(); compiler.RegisterCallbacks(_editor); if (null != _extensionsDir) compiler.LoadExtensions(_extensionsDir); this.Trace("Emmet engine successfully initialized."); }