In the Visual Studio 2013 editor, the following URL syntax works in C/C++ comment blocks - for single click navigation:
//
// http://bitbucket.org/foo/main.cpp#cl-123
//
The Visual Studio 2015 editor considers the fragment starting with # not to be part the URL. It does accept %23 instead of # but the server does not like it:
//
// http://bitbucket.org/foo/main.cpp%23cl-123
//
Is there a way to relax the URL encoding / syntax checking in VS 2015?
Solution: Surround the offending URL with " " ( ) or { }.
Related
I was using Visual Studio 2012 and it used to give the description of a property/method, which doesn't seem to work in VS2019. Is there an option that I will have to enable for this to work?
Below screesnhot is an example of File Input/Output operation:
When I scroll/hover over ios::app, it should give a description "Append to the end of the file" which it does not.
Second concern is that it is giving me a lot of other options as well (marked as * in VS). Is there an option to disable that permanently?
Final concern is that, when I hover over a function, it will display the parameters that the function is expecting (Or list of suggestions if the function is overloaded). But for some reason, in the below case, it is displaying along with namespace. Is there an option to disable that?
public static constexpr std::_losb::_Openmode std::_losb::app = (std::_losb::_Openmode)8
While using of Visual Studio Code I've noticed that when I write function from autocomlete it never autocomlete with parentheses. For example:
fmt. //now select a function Print(a ...interface{}) from autocomplete
fmt.Print //why the parenthesehas have not been inserted automaticaly?
Is it always so in VS code or it is somehow related to the golang setting for VS code? Is there a way how to fix that?
In your VSCode settings (JSON) add the following line;
"go.useCodeSnippetsOnFunctionSuggest": true
Or if you are viewing your preferences/settings as the UI version, search for useCodeSnippetsOnFunctionSuggest and set it to true. This will
Add parentheses to the tailing end of function names.
Complete function suggestions with parameter signatures, including the variable types.
There is also the setting of go.useCodeSnippetsOnFunctionSuggestWithoutType which does the same, but omits the variable types.
You need the Visual Studio Code (Google Go Team maintained) Go extension installed which can be found here.
In Xamarin Studio 5.0.1(build3).
I input the code in the editor, when I enter ENTER, why the indentation is too long, and the { symbol is not align to the if keyword, and int i = 3 is not aligned to the above line?
This is a visual representation of what is happening:
if (mUri == uri)
{
mImageView.Image = image;
int i=3
}
xs perferences:
behavior=> indentation mode: smart (also try option: none, automatic)
SourceCode/Code formatting: c# source code/ Policy: has been try the following options: mono/visual studio/custom/tab width:4 ...
The same setting is Xamarin Studio 4.3 are ok.
I also try to uninstall xs5.0 and reinstall it, but not resolved.
It also will be happen for any new projects.
I have pasted some code that looks like this:
Dto = new MyDto()
{
SessionId = sessionId.ToString(),
UserName = username,
License = allocateLicense
},
but the pasted version looks like:
Dto = new MyDto
()
{
SessionId =
sessionId.
ToString(),
UserName =
username,
License =
allocateLicense
},
I tried control-z (undo) and sometimes with simple pieces of code it reformats correctly but for other code it stays as above with line breaks.
So is there a way I can select the pasted code and reformat it so that the additional line breaks are removed?
If the problem is automatic formatting on paste you can of course disable it. If it's the other way around you can do the same as well..
Visual Studio > Tools > Options > Text Editor > C# > Formatting
appropriately set Automatically format on paste
This happens often when you copy code from PDF files or web pages.
I usually remove the unwanted formatting by pasting the code on a plain-text editor like notepad, then from notepad over to Visual Studio.
Is there a way to always have LF line endings in Visual Studio? I can never seem to find it!
There'a an add-in for Visual Studio 2008 that converts the end of line format when a file is saved. You can download it here: http://grebulon.com/software/stripem.php
You don't have to install any plugins.
As mentioned here you can configure line endings in File -> Advanced Save options...
Yes, there is a way to always have LF line endings, at least in Visual Studio 2010 Pro.
Go to Tools | Options... | Environment | Documents
Then Enable the Check for consistent line endings on load option.
It works for me.
Visual Studio 2008 doesn't retain the advanced save options after the solution is closed. I would be willing to hand edit a lot of files if that would make it work consistently, but I am not willing to change all of the settings every time I open VS.
This is too bad. Since VS does support forcing the line-endings to whatever is desired in the backend, its just not hooked up properly in the UI. Maybe Microsoft will fix this isn a service pack.
There's a plugin to VS called Strip'Em where you can choose which kind of new line type you want to auto convert all the line endings to when saving.
(You can choose between LF, CRLF, CR.)
I seem to have found a method by accident and found this article attempting to correct it (I want Windows CRLF EOL)! Doing the following results in UNIX (LF only) line endings for me.
SaveFileDialog^ dialog = gcnew SaveFileDialog();
System::Windows::Forms::DialogResult DR;
dialog->Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
dialog->FilterIndex = 2;
dialog->RestoreDirectory = true;
dialog->DefaultExt = "txt";
DR = dialog->ShowDialog(this);
if ( DR == System::Windows::Forms::DialogResult::OK )
{
// Get the page (tab) we are currently on
System::Windows::Forms::TabPage ^selPage = this->tabControl1->SelectedTab;
// Note: technically the correct way to look for our control is to use Find and search by name
// System::Windows::Forms::RichTextBox ^selText = selPage->Controls->Find("rtb", false);
// I only add one control (rich text) so first control ([0]) must be it
System::Windows::Forms::RichTextBox ^selText = safe_cast<System::Windows::Forms::RichTextBox^>(selPage->Controls[0]);
// Just let a Windows forms method do all the work
File::WriteAllText(dialog->FileName, selText->Text);
}