GitHub Copilot shows only few lines of suggestion - razor

I'm testing GitHub Copilot in Visual Studio 2022, and it shows only a few lines of the code instead the complete code:
If I click tab button it writes only this code lines.
Is this a normal behavior?

Related

Looking for an HTML IDE where clicking on an element in the live preview highlights the code

I'm looking for an HTML IDE (preferably free) or extension for Visual Studio Code that:
a)has a live preview feature
and
b) clicking or right-clicking an element in the live preview highlights the corresponding code.
This seems to be a bit elusive, which doesn't make a lot of sense to me considering how useful this is.
I'm currently using Visual Studio Code with the Live Preview extension, but it doesn't allow doing anything with the preview.
1, Adobe Dreamweaver, just use Split Mode.
You code yourself, just use the Editor part as a Live Preview so you won't mess-up with redundant and ugly codes.
You click on the code, and the live preview corresponding element will be highlighted, you click on the live preview, the text cursor will jump to the code.
2, Brackets
It just works exactly like what you want, but unfortunately, it is discontinued by Adobe.
3, Five servers (VSC Extension)
https://marketplace.visualstudio.com/items?itemName=yandeu.five-server
It is only one-way-highlight. You can't jump to code by clicking on Live Preview.
I haven't found any VSC extension working the way you want.

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.

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.

Razor pages (cshtml) render HTML markup without the classic colors

I'm working on a web project in Visual Studio 2013 and I'm not able to see the classic colors for HTML tags (Maroon, Blue and Red). Instead all the HTML is black, except the Razor blocks, they show ok.
When I go to the Fonts options the colors are configured correctly but the editor seems to not consider the configuration values.
Any help would be appreciated.
Do you mean that the source code doesn't have syntax highlighting within the Visual Studio editor, outside of the Razor blocks?
It's possible that your default editor for cshtml files got switched to the wrong one somehow. Try right-clicking one of the cshtml files in question, doing an "Open With...", and choosing "HTML Editor".
If that doesn't work, try disabling any extensions you have installed that touch the HTML editor (e.g. Web Essentials, Productivity Power Tools, Indent Guides, etc).
If that doesn't work, I'd try resetting your settings from Tools > Import and Export Settings... > Reset all settings. You can back your settings up first, so you can restore them afterward if resetting them doesn't help.
Finally, if none of that works, I would try running a repair on Visual Studio from the installer. I've seen that fix strange issues like this before.

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.