Code Monkey home page Code Monkey logo

vscode-extension's Introduction

Winter VSCode Extension

Banner

The official Visual Studio Code extension for Winter CMS, providing syntax highlighting, code completion and useful assistive features for developers working on Winter projects.

This extension is currently in preview and is not feature-complete.

Features

Currently available

  • Syntax highlighting for CMS template files and Winter CMS Block templates.
  • Twig definition for Winter-provided Twig functions and filters.

Planned for v1.0.0

  • YAML schema validation and code completion for the following configurations:
    • Form field definitions (fields.yaml)
    • List column definitions (columns.yaml)
    • Form behaviour configuration (config_form.yaml)
    • List behaviour configuration (config_list.yaml)
    • Relation behaviour configuration (config_releation.yaml)
    • Reorder behaviour configuration (config_reorder.yaml)
    • Import/export behaviour configuration (config_import_export.yaml)
  • Code completion for CMS templates:
    • Main template definitions in INI section
    • Component configuration in INI section
    • Component variables in {% component %} tag

Screenshot

Screenshot

Requirements

The YAML validation will require the YAML plugin provided by Red Hat. This will be installed automatically with this extension.

Additional notes

To enable Emmet features in theme templates, add the following to the emmet.includeLanguages setting in your settings.json in VSCode.

"emmet.includeLanguages": {
    "wintercms": "html"
}

Compatibility with other extensions

If you are getting the error Symfony\Component\ErrorHandler\Error\FatalError: Uncaught Illuminate\Contracts\Container\BindingResolutionException: Target [Illuminate\Contracts\Auth\Access\Gate] is not instantiable. in your logs or Ray output while you have the Laravel Extra Intellisense extension installed, then you can set LaravelExtraIntellisense.disableAuth to true in your VSCode extension settings.

vscode-extension's People

Contributors

aic-bv avatar bennothommo avatar joaocosta-azores avatar luketowers avatar webvpf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vscode-extension's Issues

Official VS Code extension for Winter

Switch to Monaco

We plan to release an official VS Code extension for supercharging Winter CMS development in Visual Studio Code.

Some of the features that we intend to include in the initial release are as follows:

  • Full YAML schema and validation for configuration files (ie. form and list configurations, behaviour settings, etc.)
  • Auto-completion in YAML files
    • Allow selection of models in modules and plugins when specifying models in YAML configuration files
    • Auto-complete component configuration
  • Language support for Winter CMS templates

Error on type property

image

type: x in fields.yaml is throwing an error
"Matches multiple schemas when only one must validate."

Note:
It is not throwing the error inside nestedform, but I think that is because its not working in nestedform?

Detecting all different types of .htm files

First of all, this is not a real issue but more like a conceptual discussion and comments. Although maybe something could be done/improved in the extension logic or at least maybe README could be updated with settings I will give below. Also I am aware that this is only Preview version of extension so probably you are also aware of this.

Anyways, I installed extension yesterday and played around it a little - Winter CMS page file (.htm) detection works as expected but problems start to arise when I open, for example, component, partial and controller .htm files - by default (at least in my VSCode setup) they are also detected as Winter CMS Template files but as they don't contain == delimiters and are not true Winter CMS files but more like standart html files then syntax highlighting gets messed around and doesn't work for html code in the files:
2022-02-13_12-15

So my workaround at this problem was to update my VSCode workspace file association settings (.vscode/settings.json file):

{
    "files.associations": {
        "*.htm": "wintercms",
        "**/controllers/**/*.htm": "html",
        "**/components/**/*.htm": "wintercms-twig",
        "**/partials/**/*.htm": "html"
    }
}

And now the syntax highlighting looks like this for the same component file:
2022-02-13_12-18

I didn't tested my setup in all scenarios and I know that it's not 100% safe because, for example, partials can also contain YAML section with description field but so far looks and works at least better than default auto-detection feature for component, partial and controller html files.

Problems

Highlighting does not work in theme partials without '=='
Example \themes\demo\partials\site\head.htm

no_hl

ok-hl


Code commenting not working with keyboard shortcuts Ctrl + /. For lang Winter CMS Template.
Works only for the INI section.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.