简体   繁体   English

内联CSS /内联JavaScript的PHTML文件中的VS代码Intellisense支持

[英]VS code Intellisense support in PHTML-files for inline css / inline javascript

I am using Visual Studio Code since a few days and I was wondering if it is possible to have support for Intellisense inside inlined css-blocks and/or inlined javascript in ' .phtml '-files. 几天以来,我一直在使用Visual Studio Code,我想知道是否有可能在' .phtml '文件中的内联css块和/或内联javascript中支持Intellisense。

如您所见,仅支持php

I could not find a solution online only a few people complaining about this not working from a few months back but I nothing that worked for me. 我只能在网上找到解决方案,只有几个人抱怨几个月后这种方法不起作用,但我没有任何解决方法。
It would really help me a lot if someone has any idea how to solve this or at least a step in the right direction, or if I have to move the css and js into external files (of course thats better(!) but thats not the point here ;) ) 如果有人知道如何解决这个问题或至少朝正确的方向迈出了一步,或者如果我必须将css和js移到外部文件中(这当然更好(!),但那不是),那将对我有很大帮助这里的重点;)

Thanks in advance. 提前致谢。

This works for me after 2 changes in vscode . vscode进行2次更改后,这对我vscode

User settings 用户设置

I added below to the user settings 我在下面添加了用户设置

"files.associations": {
        "*.phtml": "php"
    },

Extension 延期

Installing the intelliphense extension 安装智能扩展

延期

And now both php as well as css intellisense works 现在,无论是php还是css intellisense作品

的PHP

的CSS

Make sure you have no other conflicting extension enabled which may cause issue. 确保没有启用其他可能引起问题的冲突扩展。

Also do have a look at the below open thread 也看看下面的开放线程

https://github.com/Microsoft/vscode/issues/670 https://github.com/Microsoft/vscode/issues/670

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM