Auto Format on Visual Studio Code for .cfm files

时光毁灭记忆、已成空白 提交于 2020-03-22 09:00:11

问题


Does anyone know if there's a way to auto format ColdFusion documents on VSCode the way it does for HTML files?


回答1:


In VS Code, click on Extensions on the left side. Or View >> Extensions (or CTRL-SHIFT-X on Windows). Enter "CFML" in the Search box, and choose KamasamaK's extension (kamasamak.vscode-cfml). It is an excellent extension. There are also others, if you're interested.

Or https://marketplace.visualstudio.com/items?itemName=KamasamaK.vscode-cfml




回答2:


Auto format HTML, JS & CSS within CFM/CFML files?

If you want, you can install the Beautify and then add cfc, cfm, & cfml as languages in the settings.json file. After that, you can use "Beautify Selection" or "Beautify File" to modify code. If the plugin can't decide what type of code you are formatting, it will prompt you for "HTML, JS or CSS". (I've assigned a shortcut so I don't have to press CTRL+SHIFT+P to search for the the beautify option.)

SETTINGS.JSON

"beautify.config" : {
    "beautify.language": {
        "js": ["js","json","cfc"],
        "css": ["css", "scss"],
        "html": ["htm", "html", "cfml", "cfm"]
    },
    "html": {
        "allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "cfm", "cfml"]
    }
}


来源:https://stackoverflow.com/questions/54837342/auto-format-on-visual-studio-code-for-cfm-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!