Skip to content

Commit

Permalink
Fixed crash on search
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro Del Sole authored and Alessandro Del Sole committed Nov 13, 2016
1 parent 2c4194b commit ba31f2b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Expand Up @@ -934,12 +934,18 @@ Partial Public Class CodeSnippetStudioToolWindowControl
If criteria = "" Then
Me.LibraryTreeview.ItemsSource = Nothing
Me.LibraryTreeview.ItemsSource = Me.snippetLib.Folders
Exit Sub
End If

Dim query = Me.snippetLib.Folders.Where(Function(f) f?.SnippetFiles.Any(Function(s) s.FileName IsNot Nothing _
AndAlso s.FileName.ToLowerInvariant.Contains(criteria.ToLowerInvariant)))
Try
Dim query = Me.snippetLib.Folders.Where(Function(f) f?.SnippetFiles.Any(Function(s) s.FileName IsNot Nothing _
AndAlso s.FileName.ToLowerInvariant.Contains(criteria.ToLowerInvariant)))

Me.LibraryTreeview.ItemsSource = New ObservableCollection(Of SnippetFolder)(query)
Catch ex As Exception
Me.LibraryTreeview.ItemsSource = Me.snippetLib.Folders
End Try

Me.LibraryTreeview.ItemsSource = New ObservableCollection(Of SnippetFolder)(query)
End Sub

Private Sub FilterButton_Click(sender As Object, e As RoutedEventArgs)
Expand Down
Expand Up @@ -151,7 +151,7 @@
</ItemGroup>
<ItemGroup>
<Reference Include="DelSole.VSIX, Version=1.0.0.1, Culture=neutral, PublicKeyToken=f363590589be2c33, processorArchitecture=MSIL">
<HintPath>..\packages\DelSole.VSIX.1.0.6133.24819\lib\net40\DelSole.VSIX.dll</HintPath>
<HintPath>..\packages\DelSole.VSIX.1.0.6161.35451\lib\net40\DelSole.VSIX.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
Expand Down
2 changes: 1 addition & 1 deletion CodeSnippetStudio_Extension/packages.config
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DelSole.VSIX" version="1.0.6133.24819" targetFramework="net46" />
<package id="DelSole.VSIX" version="1.0.6161.35451" targetFramework="net46" />
<package id="DotNetZip" version="1.9.7" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis" version="1.3.2" targetFramework="net46" />
<package id="Microsoft.CodeAnalysis.Analyzers" version="1.1.0" targetFramework="net46" />
Expand Down
2 changes: 1 addition & 1 deletion CodeSnippetStudio_Extension/source.extension.vsixmanifest
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="CodeSnippetStudio_Extension.Alessandro Del Sole.c76974a7-5d80-4824-b961-798a44018340" Version="1.4.1" Language="en-US" Publisher="Alessandro Del Sole" />
<Identity Id="CodeSnippetStudio_Extension.Alessandro Del Sole.c76974a7-5d80-4824-b961-798a44018340" Version="1.4.2" Language="en-US" Publisher="Alessandro Del Sole" />
<DisplayName>Code Snippet Studio</DisplayName>
<Description xml:space="preserve">Create, edit, package, and share IntelliSense code snippets for Visual Studio 2015 and Visual Studio Code.</Description>
<MoreInfo>https://github.com/AlessandroDelSole/CodeSnippetStudio</MoreInfo>
Expand Down

0 comments on commit ba31f2b

Please sign in to comment.