Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup and refactor #327

Merged
merged 4 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\templates\ProjectTemplatesDownloader\ProjectTemplatesDownloader.csproj" ReferenceOutputAssembly="false" PrivateAssets="all" />
<ProjectReference Include="..\templates\ProjectTemplatesDownloader\ProjectTemplatesDownloader.csproj" ReferenceOutputAssembly="false" PrivateAssets="all" Name="ProjectTemplatesDownloader" />
<ProjectReference Include="..\CompletionEngine\Avalonia.Ide.CompletionEngine.DnlibMetadataProvider\Avalonia.Ide.CompletionEngine.DnlibMetadataProvider.csproj">
<Project>{5f0f9262-3527-46af-acf6-986b7f7b4c90}</Project>
<Name>Avalonia.Ide.CompletionEngine.DnlibMetadataProvider</Name>
Expand Down
2 changes: 1 addition & 1 deletion AvaloniaVS.VS2022/AvaloniaVS.VS2022.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\templates\ProjectTemplatesDownloader\ProjectTemplatesDownloader.csproj" ReferenceOutputAssembly="false" PrivateAssets="all" />
<ProjectReference Include="..\templates\ProjectTemplatesDownloader\ProjectTemplatesDownloader.csproj" ReferenceOutputAssembly="false" PrivateAssets="all" Name="ProjectTemplatesDownloader" />
<ProjectReference Include="..\CompletionEngine\Avalonia.Ide.CompletionEngine.DnlibMetadataProvider\Avalonia.Ide.CompletionEngine.DnlibMetadataProvider.csproj">
<Project>{5f0f9262-3527-46af-acf6-986b7f7b4c90}</Project>
<Name>Avalonia.Ide.CompletionEngine.DnlibMetadataProvider</Name>
Expand Down
2 changes: 2 additions & 0 deletions AvaloniaVS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ Global
{CD7DB042-4282-4DFB-9910-958036DD621D} = {8F7FC7D4-7E16-46A4-BA35-2CA47734AE5E}
{5F0F9262-3527-46AF-ACF6-986B7F7B4C90} = {8F7FC7D4-7E16-46A4-BA35-2CA47734AE5E}
{70475448-B721-48BD-A96D-56C8A0B88BA0} = {3CF4E8CC-E706-41DC-8A22-8E37EDA7E599}
{26CB0499-10FE-4CC1-9F20-4738BF527494} = {3CF4E8CC-E706-41DC-8A22-8E37EDA7E599}
{0D792D9B-66F7-46DB-AC87-AA3068151E6C} = {3CF4E8CC-E706-41DC-8A22-8E37EDA7E599}
{94AFBDF7-D3C5-4952-9070-5A517970B964} = {FC634911-168A-4FDD-8758-11FAD5B8696B}
{14C474FC-E529-4148-ADEB-E9F77E744452} = {FC634911-168A-4FDD-8758-11FAD5B8696B}
{75104AA0-3B1B-47D4-9C4D-501A8185ACFC} = {FC634911-168A-4FDD-8758-11FAD5B8696B}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ private static Dictionary<string, string> GetNamespaceAliases(string xml)
return null;
completions.Add(new Completion("/" + name + ">", CompletionKind.Class));
}
else if (tagName.Contains("."))
else if (tagName.Contains('.'))
{
var dotPos = tagName.IndexOf(".");
var typeName = tagName.Substring(0, dotPos);
Expand Down Expand Up @@ -274,7 +274,7 @@ private static Dictionary<string, string> GetNamespaceAliases(string xml)
attributeOffset = 0;
}

if (state.AttributeName?.Contains(".") == true)
if (state.AttributeName?.Contains('.') == true)
{
var dotPos = state.AttributeName.IndexOf('.');
curStart += dotPos + 1;
Expand Down Expand Up @@ -322,7 +322,7 @@ private static Dictionary<string, string> GetNamespaceAliases(string xml)
else if (state.State == XmlParser.ParserState.AttributeValue)
{
MetadataProperty? prop = null;
if (state.AttributeName?.Contains(".") == true)
if (state.AttributeName?.Contains('.') == true)
{
//Attached property
var split = state.AttributeName.Split('.');
Expand Down Expand Up @@ -352,7 +352,7 @@ private static Dictionary<string, string> GetNamespaceAliases(string xml)
search = last;

// Special case for pseudoclasses within the current edit
if (state.AttributeName!.Equals("Selector") && search!.Contains(":"))
if (state.AttributeName!.Equals("Selector") && search!.Contains(':'))
{
search = ":";
}
Expand Down Expand Up @@ -533,7 +533,7 @@ private void ProcessStyleSetter(string setterPropertyName, XmlParser state, List
{
var value = state.AttributeValue ?? "";

if (value.Contains("."))
if (value.Contains('.'))
{
var curStart = state.CurrentValueStart ?? 0;
var dotPos = value.IndexOf(".");
Expand All @@ -560,7 +560,7 @@ private void ProcessStyleSetter(string setterPropertyName, XmlParser state, List
var setterProperty = state.FindParentAttributeValue("Property", maxLevels: 0);
if (setterProperty is not null)
{
if (setterProperty.Contains(".") == true)
if (setterProperty.Contains('.') == true)
{
var vals = setterProperty.Split('.');
selectorTypeName = vals[0];
Expand Down Expand Up @@ -814,7 +814,7 @@ private int BuildCompletionsForMarkupExtension(MetadataProperty? property, List<
completions.AddRange(GetHintCompletions(t, attribName));
}
}
else if (attribName.Contains("."))
else if (attribName.Contains('.'))
{
if (t.SupportCtorArgument != MetadataTypeCtorArgument.Type)
{
Expand Down
7 changes: 1 addition & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@ Avalonia Visual Studio extension adds such capabilities to your Visual Studio:
| [VS2022](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaVS) |
| ------------- |

# Building and debugging
Before building project you will need to restore all submodules.
This command will help you to restore submodules.

```git submodule update --init --recursive```

# Debugging
If you want to debug Avalonia previewer extension the *easiest* way to do that is [VS Experimental instance](https://docs.microsoft.com/en-us/visualstudio/extensibility/the-experimental-instance?view=vs-2019).
To run it you simply need to set **AvaloniaVS.csproj** as startup project and run it,it will open VS Experimental instance,you can run here your repro and put the breakpoints in the original VS in AvaloniaVS project.

Expand Down