Compiles Emmet source files using the specified V8 engine instance.
        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();
        }
Beispiel #2
0
        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();
        }
Beispiel #4
0
        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.");
        }