problem with visual studio code in syntax - html

I am a beginner in programming learning and I have a problem writing the code on Visual Studio. When I press the tap button to format and save, what you have modified using the tap button is canceled. Please solve it as soon as possible and thank you in advance.

If you referring to formatting the code, i suggesting you to use an extension called Prettier, it makes your code better by formatting it automatically for you, you can navigate to Extensions tab on the left sidebar then write on the search box "Prettier" install it then reload the application and it will work.
How to use: Just write the code and save it (CTRL + S) then Prettier will automatically formatting the code for you.

Related

How can I add HTML code with notepad without installing an IDE

I am a starter in programming. One of my friends told me that I can start programing without installing any app and that I need only notepad to start learning HTML. The thing I can't find out is how I actually make it work. I inputted the code he gave me and I also made sure there where no typos, but then after I saved it I can not open it as a local file. I have only been able to open it as a text document so I can only see the code.
For this you have to save the file you are working on with the extension: .html. Then you have to open it with a browser, and you will see there the content of it
you can create a notepad and save it as name.html (not as .txt)
write the code inside it.
You can start with the notepad software. Unfortunately, this is not the best option. In fact, specialized software is recommended. Thanks to them, you will be able to write code faster thanks to the suggestions made by the software or to the very useful shortcuts! If you want to use this software, I recommend you one of the best on the market: Visual Studio Code.
If however you want to stay with notepad, you just have to click on "File" > "Save as" and to choose the type of file you want. In your case, it will be .html (Hypertext Markup Language)
You can create a file called [filename].html, and right click on it to open it in notepad. After Editing the file and adding your code to it, you can double click on it and it will open in your browser.
If you start enjoying to code, getting an IDE will make it much better. Visual Studio Code is recommended for this as it is user friendly and won't take up much storage space :)
code.visualstudio.com - Visual Studio Code
After saving the HTML code save it as filename.html, make sure that file extension is .html otherwise the filesystem will not recognized it.
Then right click on the file and open it with chrome or whatever browser you have and it will work, else open browser and drag it to browser and drop it, your html page will open in browser.

Visual Studio Code Not Auto-Close Tags in HTML

So version before 1.30 worked fine, and did close the Tags in .html file, but as of 1.30 update I can't finish and then try to close it with
I have tried to delete config.json file, also tried to turno on every possible option for auto-close and auto-complete tags in options, but nothing worked.
And Sublime it's working fine. I downloaded plugin to transfer Sublime confing into Visual Studio Code but without success. Hope you can help me out, since i've been trying to fix this problem 3 hours now.
I had the same problem, then I noticed that my select language mode was something like Django HTML. Solved after changing it.
You might have opened a file before that changed the language mode. So first, check the language shown at the bottom-right of the VS Code window (status bar), then follow the steps bellow.
Go to settings (or edit the settins.json file) and search emmet.includeLanguages, then press add item under Emmet: Include Languages. input the language you are using in item field and html in value field.

How do I stop visual editor in Wordpress from changing the code?

Every time I switch to the visual editor in Wordpress, it changes my code (e.g Removes <br/>). How do I stop this?
You can't in the base framework without adding some plugin.
However, if you'd like a simple break on the Visual editor side use shift-enter.

simple code editor with snippets panel?

I use Webstorm as my IDE and Brackets for some quicker stuff.
Is there a light weight editor similar to brackets that has a snippets panel like Dreamweaver? or maybe one that has a plug in or extension that adds a snippets panel?
I'm familiar with live templates in Webstorm but I don't believe there is a way to have a list of them in a panel that is always visible. I much prefer to have a big panel of commonly used blocks of code and html tags that are always visible that I can just click on.
Thanks for the help.
Windows Only:
Notepad++ has a a snippet plug in which does the same thing. After installing Notepad++ you simply click the Plugin menu -> Plugin Manager. The tick snippets and press install. The rest is done for you.
Alternatives:
Sublime Text has a snippet tool but it's not the same as as Dreamweavers snippet panel.

Long delays when formatting a .cshtml file in Visual Studio 2012

Working with MVC4 using Visual Studio 2012 at the moment and when every I format a CSHTML document (CTRL + E + D) I get the "Waiting for a background operation to complete dialog"
This dialog stays around for roughly a minutes however I've had wait times of up to 10minutes before.
My document is not long it consists of 20< lines of basic html.
I'm only using 1 Add-in; Visual Git.
EDIT: Removing the Add-in has no effect.
EDIT2: I'm now getting the following error trying to edit the file after trying to format.
Attempted TextBuffer edit operation while another edit is in progress.
For me it seemed to be related with the razor syntax, since I only had it on one particular file.
For example if I put the following code in one line I had the described issue.
#section BodyClassName {note}
But when putting the closing parenthesis on the next line the issue went away
#section BodyClassName {note
}
Kind regards
Stijn
I had the same problem, i did the following and it worked for me.
UnCheck the ReadOnly attribute of your View(By using windows explorer)
If you already have your view open in VS, then close your view and open it again.
If you can click on Refresh button at the top of Solution Explorer, that will also reload the files.
It should be editable.
I hope that will help.
Thanks.