Does anyone know an extension for Visual Studio Code that highlight code blocks as in the image ?
It is built-in to vscode. Enable the setting
Editor > Guides: Bracket Pairs
My react native code is like this:
When I save, I always get ESLint complaining :
Is it something about the tab character? Should I do some settings for the Visual Studio Code? I can't figure out how to get rid of this error. Could someone please give a suggestion?
My Visual Studio Code used to be able to auto-format my code when save. Now it completely not working when saving.
==== UPDATE ====
I tried also manually format the code:
But I get the ESLint error:
Is it some settings of tab key should be modified in Visual Studio Code settings?
I believe those characters are newlines. Try this:
remove the extra newline character after your imports
put each JSX tag on its on line. Something like this:
return (
<View>
<Text>Hello</Text>
</View>
);
The documentation explains how to set up eslint to automatically fix problems with your code. In Visual Studio Code, open File > Preferences > Settings and search for "code actions on save". Click Edit in settings.json and enable auto-fixing:
"editor.codeActionsOnSave": {
"source.fixAll.eslint": false
}
The title tells it all. I have installed a couple of Vue.js related plugins for Visual Studio Code, but still can not format the code, as I used to do it easily in SublimeText.
Appreciate your hints?
You can either use an extension called "Prettier" or "Beautify", then follow the instruction to set it up/
Just open the Extension window and look it up there, after you installed it you can right click on the opened file window and choose "Format Document" or simply press "Ctrl + Alt + F"
I've been trying to get intellisense working for quite some time now, and am unable to see anything outside of
!
![CDATA[
?
Visual Studio 2015 Update 2
Resharper is installed but disabled
Referencing the latest pre-releases of Xamarin Forms (2.3.0.38-pre2)
Xamarin for Visual Studio (4.2.21)
Portable project referencing the proper 2.3.0.38-pre2 targets file from NuGet
Enable XAML Language for Xamarin.Forms
What else am I missing? I feel like it shouldn't be this difficult.
I resolved this issue by doing a simple workaround and here is the solution.
Right-click the XAML file in the Solution Explorer and select
Solution 1: "Open With... > Source Code (Text) Editor".
and in another time this also worked for me:
Solution 2: "Open With... > Source Code (Text) Editor with Encoding"
This workaround gave me the desired XAML IntelliSense even without installing the extra "Enable XAML Language for Xamarin.Forms" extension and even with ReSharper installed but suspended.
Extensions > Tools > Enable XAML Language for Xamarin.Forms
Enable XAML Language for Xamarin.Forms
Enables the VS built-in XAML language service to provide editing and intellisense for Xamarin.Forms XAML files.
https://visualstudiogallery.msdn.microsoft.com/8195a8e2-a842-4389-a8cb-34e4672e2e13
Update:
From #Jeff:
Seems I had to completely uninstall Resharper, not just disable it. Then reinstall the "Enable XAML Language for Xamarin Forms extension".
Additional info:
http://www.cazzulino.com/enable-xaml-forms-intellisense.html
Xamarin XAML Enabled:
XML Enabled and thus no Xamarin XAML Intellisense:
The reason why Intellisense is not appear in editor is that Xamarin XAML is not opened as file with content type xaml but file with content type xml.
To open xamarin XAML file as file with content type xaml simply in solution explorer right click the xaml file and select Open With... In popup select "XAML Designer with Encoding" and click OK.
Solution below is if you edit Xamarin xaml as file with content type xml. But this solution is not correct, IntelliSense then not always correctly suggests.
To take advantage of Intellisense the Visual Studio must get appropriate definition of xml namespace for Xamarin.Forms. For the Xamarin.Forms Visual Studio needs xml definition for namespace http://xamarin.com/schemas/2014/forms.
This definition can be provided to Visual Studio by two ways:
You can use xsd file and this file then register to xml schemas - after you open xaml file, the menu Xml/Schemas appear.
You can this definition create by assembly attribute XmlnsDefinitionAttribute. This attribute you can found in Portable.Xaml nuget package.
Suitable for Xamarin.Forms is the second way(using attribute).
If you use Xaml in portable library, restore(download and install) this nuget package to this library.
If you use shared project, then restore this nuget package to all projects referencing this shared project.
Then insert this attribute to appropriate place. I believe that the App.xaml.cs(if you use generated name App) is a good place. The code could look like this:
using Portable.Xaml.Markup;
using Xamarin.Forms;
[assembly: XmlnsDefinition("http://xamarin.com/schemas/2014/forms", "Xamarin.Forms")]
namespace YourAppNamespace
{
public partial class App : Application
{
public App ()
{
this.MainPage = new MainPage();
}
}
}
And the rebuild solution, as I believe, might not be necessary to work Intellisense for Xamarin.Forms.
This worked for me:
right click on .xaml file and then select "Open With.." and select "XAML Designer" and also "Set as Default" then intellisense worked great.
I install the Extension Enable XAML Language for Xamarin.Forms from
Enable XAML Language for Xamarin.Forms
Still the intellisense was not working. I just need to close all tabs and close the visual studio. After re-starting Visual studio I open solution and XAML file. The instellisense is working fine.
worked for me
Right click on Your XAML file and choose Option
Open With=>Source Code(Text) Editor with Encoding=>Set as default=>Apply and choose option Auto....
Seems I had to completely uninstall Resharper, not just disable it. Then reinstall the Enable XAML Language for Xamarin Forms extension.
Jeff's answer almost worked for me, but I had to do one additional step:
Because I had previously uninstalled and reinstalled Xamarin, I had to update from 4.0.1 to the latest stable (4.1.1.3 as of this date). After that Intellisense started working!
I have Resharper installed on VS2015update3, and XAML Designer didn't work for me.
But accidently I found XML (Text) Editor works. That's Resharper that makes effet.
No wave-line beneath the tag
Perfect prompt everywhere: XML Tags, Properties, available Values
Only things: it doesn't color too much, and F7 do not send me to its code-behind.
Voilà, hope this could help
I resolved this issue by doing a simple workaround and here is the
solution.
Right-click the XAML file in the Solution Explorer and select
Solution 1: "Open With... > Source Code (Text) Editor".
and in another time this also worked for me:
Solution 2: "Open With... > Source Code (Text) Editor with Encoding"
Actually, I found that for me it even worked by simply choose:
Solution 2: "Open With... > Automatic Editor Selector (XML)" and then reopening VS.
I also found that the problem began after editing .xaml file outside of VS, by right-clicking the file and choose "Edit".
If your familiar with visual studio you can select code snippets from the auto complete list. is this possible in IntelliJ
So for example if i type
for
it would show "for" and the live template "fori" in the code complete dropdown list
Turns out it is possible (unless I'm missing something) via the Registry editor:
See this answer on how to get to this editor.