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

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.

Related

The CSS file won't stop modifying the HTML, even though it's been erased (Visual Studio)

I was practicing HTML and CSS, when I realised I messed up the code and couldn't figure how to solve it, so I deleted the file to start all over. But the deleted CSS file still affects my HTML.
HTML code,
How the CSS still affects the code
I already tried:
Saving the project as it's modified without the CSS.
Making a copy of the existing HTML file.
Closing and opening the programme.
I tried looking up for why it happens but I just can't find a solution anywhere, as it's even hard for me to explain what happened.
On Chrome:
Step 1: Open the developper tool (Ctrl+Shift+I)
Step 2: Right click the reload button.
Step 3: Click "Empty cache and hard reload" to make sure to clear the cache.

problem with visual studio code in syntax

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.

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 to highlight section in VScode live server when clicking my source code?

Question
The editor brackets can do that. Supposed that, when I click my html tag in my source code file, the browser would automatically highlight the section/div in the broswer like google chrome developer tools.
Step 1
Click my tag in my source code file
Step 2
the live server will automatically focus on the section I want
How could I make it in VSCode?
VS Code does not have a built-in live server. Whatever extension you are using for live server can implement this, however I am not aware of any ones that do currently. Consider filing a feature request against them for this
Look at Five Server extension.
I used to love this Live Preview of Brackets, mainly for two unique features unlike many other editors and extensions:
It shows the preview live, literally. It doesn’t wait for file save to show the changes.
Highlights the section in the preview, corresponding to the html tag in which the cursor is placed currently.
I have been looking for a similar VS Code extension for a while.
Finally found it, JUST NOW.

PhpStorm: Save as Live Template does nothing

Trying to create a Live Template in PhpStorm by highlighting a block of text, going to Tools > Save as Live Template.
When I do this, nothing happens. The Live Template dialog does not open and there is no other indication of an error. I can manually open the Live Template menu and add one there.
Is there a setting or configuration that is needed for this to be enabled?
PhpStorm 2017.1.4 on Windows 10
You can turn a highlighted block into a live template, but you need to make sure that there is no leading whitespace in your selected text, or it won't do anything, as explained in the original question.
This is likely a bug, see the issue in the comments to track resolution.