Visual Studio Code HTML Preview issue - visual-studio-code

I'm having an issue with VS Code, when I try to use JAVA Script in an HTML file. When I use the HTML preview it keeps saying that some content is disabled. But when I go to update the settings to allow the content, it never enables it. I've looked around the internet and couldn't find anything that would help me troubleshoot this issue. I'm just learning how to code, so I don't know that my code is good, but any help with the settings would be greatly appreciated. Thanks.

Related

How can I copy the text of the Interactive Playground page in VS Code?

I thought this page would be very useful for me. So I wanted to save it on my local computer. But I could not copy the text in it.
I tried several ways:
right-click: invalid
try to find the file: don't know the name
search on Google but there is no solution now
Can somebody help me? Thank you very much!
The file is called vs_code_editor_walkthrough.ts in the GitHub repository for Visual Studio Code. You stated you were after the text of the file, so if you view it in its raw form you can easily get all of the text in its markdown format.
It won't look anywhere near as pretty as Visual Studio Code renders it. If you want to achieve that look, you'll probably need to be savvy with TypeScript, something I am not.

On saving html files in visual stuido lines got messed up

I have developed an angular application using VS code.On saving html file, the lines got messed up. It automatically re-aligns. I don't know what is causing this. This issue suddenly showed up. Can someone help me to solve this? Thank you.
This is for programming community only. For tools related things you have to use different stack overflow community.You have to switch off auto save on save. So then only it won't reset. For VS code I found https://marketplace.visualstudio.com/items?itemName=cbrevik.toggle-format-on-save

Automatically formatting HTML within PHP with VSCode?

I tried Intelephense and dozens of other extensions and settings but NONE of them achieved what I'm after. What I prioritize is automatic tag close and automatic indent... most of others VSC functionalities for HTML would be great too, like css classes or files paths suggestions, but what I really need is this 'basic' automatic format...
I'm sorry for this question, I know it's been done and answered before, it's just that I can't get my VSC to correctly work with HTML when mixed with PHP, and I've been trying for months now... Read everything I've found on Google, searched about it here and on Reddit, but wasn't able to reproduce any of the solutions, or better saying, none of them worked for me.
Could anyone give me some guidance?
Luckily I felt the same way as you so I just decided to go ahead and hammer out a solution to this very annoying problem with a VScode extension that doesn't register itself as a "formatting" extension I format the HTML onBeforeSave so you can still register a PHP formatting extension so between the two it gets the whole file. I use js-beautify so you can just use all the native HTML formatting settings in VSCode already.
Format HTML in PHP on the VSCode Extension Marketplace.

Is is possible to run visual studio code within the browser (i.e., as a web app, without electron)?

Since VS Code is Javascript based, it seems like one should be able to launch it in the browser as a web app. However, I can't seem to find anyone doing that?
I was able to launch the Monaco Editor this way, but I'm looking for the complete Visual Studio Code application, with support for extensions. Anyone know if/how this would be done?
Thanks in advance!
This is what I am looking for: https://coder.com/

Visual Studio Code HTML wrong comment type

I recently used VS code for Wordpress development but I encountered a weird bug when I comment with (ctrl+/) to an html element. Instead of commenting (<!-- -->) it uses (//) for my html code? Has anybody experience this? Do you know of any solutions to change the comment to the correct html comment?
This is caused by VS Code improperly auto-detected programming language - in the lower right corner of your GIF you can clearly see, that VS Code is set to HTML. Click on that button, and switch over to JavaScript (React) and problem should be solved.
I had the same exact problem. But in the end, I discovered I had an extension which was interfering with the HTML commenting. So I had to disable all extensions and restart VS Code to get back to my usual commenting back again.
Then I did a trial-and-error check (enabling one extension at a time and then reload) to find out the faulty extension which I later uninstalled. Try disabling all your extensions to see if it helps you.
In case it helps anyone else, it was the Go extension that changed all my comment characters to {#.
HTH
For future searchers, this happened to me in a different way: I was getting HTML comments inside a script tag, instead of JavaScript comments.
I disabled the TWIG pack extension and it went back to the expected behavior!
In my case it was the Sublime Babel extension that changed the comment code to // in HTML mode. Downgrading Sublime Babel from 0.2.10 to 0.2.9 solved the issue.
In my case I was getting html comments inside script tag, instead of Javascript tag.
I uninstalled Jinja extension and everything went back to normal.