Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup .NET 9
- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x

- name: Restore
run: dotnet restore src/CodeIndex.sln
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
dotnet-version: '10.0.x'

- name: Restore
run: dotnet restore src/CodeIndex.sln
Expand Down Expand Up @@ -53,10 +53,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
dotnet-version: '10.0.x'

- name: Restore (solution)
run: dotnet restore src/CodeIndex.sln
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ Latest improvements to the Visual Studio extension
- Replaced WinForms dialog with Vista IFileOpenDialog (better UX); removed System.Windows.Forms dependency.
- Theme-Aware UI
- Buttons/styles now use Visual Studio dynamic theme brushes (light/dark/HC) instead of hardcoded colors.
- Internationalization (i18n)
- Full multi-language support with automatic VS language detection.
- Currently supports English and Simplified Chinese (易于扩展其他语言).
- All UI elements (windows, buttons, messages) fully localized.
- Quick Navigation Buttons
- Open buttons beside Local & Remote URLs (auto prepend http:// when missing).
- Responsive Async Commands
Expand Down
4 changes: 2 additions & 2 deletions src/CodeIndex.Common/CodeIndex.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NLog" Version="6.0.4" />
<PackageReference Include="NLog" Version="6.0.7" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>

Expand Down
12 changes: 6 additions & 6 deletions src/CodeIndex.ConsoleApp/CodeIndex.ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.9" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
<PackageReference Include="NLog.Extensions.Logging" Version="6.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="6.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/CodeIndex.Files/CodeIndex.Files.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/CodeIndex.IndexBuilder/CodeIndex.IndexBuilder.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand All @@ -10,7 +10,7 @@
<PackageReference Include="Lucene.Net.Analysis.Common" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.ICU" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.QueryParser" Version="4.8.0-beta00016" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.9" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="10.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/CodeIndex.MaintainIndex/CodeIndex.MaintainIndex.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/CodeIndex.Search/CodeIndex.Search.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>

Expand Down
13 changes: 13 additions & 0 deletions src/CodeIndex.Server/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "10.0.1",
"commands": [
"dotnet-ef"
],
"rollForward": false
}
}
}
14 changes: 6 additions & 8 deletions src/CodeIndex.Server/CodeIndex.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
<UserSecretsId>869cc96a-d1b8-4328-9b99-bc356c26a33a</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
<None Update="nlog.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -15,14 +14,13 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor.HttpClient" Version="3.2.0-preview1.20073.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.9" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
<PackageReference Include="NLog.Web.AspNetCore" Version="6.0.4" />
<PackageReference Include="NSwag.AspNetCore" Version="14.6.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.11" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="10.0.0" />
<PackageReference Include="NLog.Web.AspNetCore" Version="6.1.0" />
<PackageReference Include="NSwag.AspNetCore" Version="14.6.3" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.12" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.7" />
<PackageReference Include="System.Drawing.Common" Version="9.0.9" />
<PackageReference Include="System.Drawing.Common" Version="10.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/CodeIndex.Server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
WORKDIR /app
ENV ASPNETCORE_ENVIRONMENT Production
ENV CodeIndex__LuceneIndex /luceneindex
ENV CodeIndex__MonitorFolder /monitorfolder
ENV CodeIndex__IsInLinux true
ENV CodeIndex__LocalUrl http://localhost:80/
EXPOSE 80
EXPOSE 443
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY ["CodeIndex.Server/CodeIndex.Server.csproj", "CodeIndex.Server/"]
COPY ["CodeIndex.Common/CodeIndex.Common.csproj", "CodeIndex.Common/"]
Expand Down
6 changes: 3 additions & 3 deletions src/CodeIndex.Test/CodeIndex.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="nunit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.1.0">
<PackageReference Include="NUnit3TestAdapter" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@
<Link>Models\CodeContentProcessing.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources\Strings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Resources\Strings.zh-CN.resx">
<DependentUpon>Strings.resx</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\doc\Extension-Icon.png">
<Link>Resources\Extension-Icon.png</Link>
Expand Down Expand Up @@ -128,6 +137,13 @@
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<ItemGroup>
<Compile Update="Resources\Strings.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Strings.resx</DependentUpon>
</Compile>
</ItemGroup>
<!-- Suppress MSB4011 duplicate import warning locally (benign; caused by SDK + VSIX target chain) -->
<PropertyGroup>
<NoWarn>$(NoWarn);MSB4011</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vsshell="clr-namespace:Microsoft.VisualStudio.Shell;assembly=Microsoft.VisualStudio.Shell.15.0"
xmlns:cvt="clr-namespace:CodeIndex.VisualStudioExtension.Converts"
xmlns:res="clr-namespace:CodeIndex.VisualStudioExtension.Resources"
mc:Ignorable="d"
d:DesignHeight="281.2" d:DesignWidth="987.2"
Foreground="{DynamicResource {x:Static vsshell:VsBrushes.WindowTextKey}}"
Expand All @@ -13,37 +15,37 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Resources/ExtensionResourceDictionary.xaml" />
</ResourceDictionary.MergedDictionaries>
<!-- 样式已迁移至 ExtensionResourceDictionary.xaml -->
<cvt:LocalizeConverter x:Key="LocalizeConverter"/>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<DockPanel LastChildFill="True" Margin="6">
<WrapPanel HorizontalAlignment="Left" DockPanel.Dock="Top">
<DockPanel Style="{StaticResource PanelForWrapPanel}">
<Label Content="Content:"/>
<Label Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_Content}"/>
<TextBox Height="23" TextWrapping="Wrap" Text="{Binding Content, UpdateSourceTrigger=PropertyChanged}" Width="240" KeyUp="ContentTextBox_KeyUp" MaxLength="1000" />
</DockPanel>
<CheckBox Content=":Case Sensitive" Style="{StaticResource CommonCheckBox}" IsChecked="{Binding CaseSensitive}"/>
<CheckBox Content=":Phase Query" Style="{StaticResource CommonCheckBox}" IsChecked="{Binding PhaseQuery}"/>
<CheckBox Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_CaseSensitive}" Style="{StaticResource CommonCheckBox}" IsChecked="{Binding CaseSensitive}"/>
<CheckBox Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_PhaseQuery}" Style="{StaticResource CommonCheckBox}" IsChecked="{Binding PhaseQuery}"/>
<DockPanel Style="{StaticResource PanelForWrapPanel}">
<Label Content="File Name:" />
<Label Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_FileName}" />
<TextBox Height="23" TextWrapping="Wrap" Text="{Binding FileName, UpdateSourceTrigger=PropertyChanged}" Width="120" KeyDown="TextBox_KeyDown" MaxLength="200" />
</DockPanel>
<DockPanel Style="{StaticResource PanelForWrapPanel}">
<Label Content="File Extension:" />
<Label Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_FileExtension}" />
<TextBox Height="23" TextWrapping="Wrap" Text="{Binding FileExtension, UpdateSourceTrigger=PropertyChanged}" Width="120" KeyDown="TextBox_KeyDown" MaxLength="21" />
</DockPanel>
<DockPanel Style="{StaticResource PanelForWrapPanel}">
<Label Content="File Location:" />
<Label Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_FileLocation}" />
<TextBox Height="23" TextWrapping="Wrap" Text="{Binding FileLocation, UpdateSourceTrigger=PropertyChanged}" Width="120" KeyDown="TextBox_KeyDown" MaxLength="1000" />
</DockPanel>
<DockPanel Style="{StaticResource PanelForWrapPanel}">
<Label Content="Show Results:" />
<Label Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_ShowResults}" />
<ComboBox SelectedValue="{Binding ShowResultsNumber}" ItemsSource="{Binding Options}" DisplayMemberPath="Name" SelectedValuePath="Value" Width="100" VerticalAlignment="Center" />
</DockPanel>
<DockPanel Style="{StaticResource PanelForWrapPanel}">
<Button x:Name="SearchButton" Margin="10 2 0 2" Content="Search" Command="{Binding SearchIndexCommand}" Style="{StaticResource InfoButton}" />
<Button Margin="10 2 0 2" Content="Stop Search" Command="{Binding StopSearchCommand}" Style="{StaticResource WarnButton}" />
<Button x:Name="SearchButton" Margin="10 2 0 2" Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_Search}" Command="{Binding SearchIndexCommand}" Style="{StaticResource InfoButton}" />
<Button Margin="10 2 0 2" Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_StopSearch}" Command="{Binding StopSearchCommand}" Style="{StaticResource WarnButton}" />
</DockPanel>
</WrapPanel>
<Grid DockPanel.Dock="Top">
Expand All @@ -54,19 +56,19 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Content="Index:" Style="{StaticResource CommonLabel}" Grid.Column="0" VerticalAlignment="Center" />
<Label Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_Index}" Style="{StaticResource CommonLabel}" Grid.Column="0" VerticalAlignment="Center" />
<ComboBox SelectedValue="{Binding IndexPk}" Grid.Column="1" ItemsSource="{Binding IndexInfos}" DisplayMemberPath="Name" SelectedValuePath="Value" Width="200" VerticalAlignment="Center" />
<StackPanel Grid.Column="2" Orientation="Horizontal">
<Button x:Name="RefreshButton" Margin="10 2 0 2" Content="Refresh Index" Command="{Binding RefreshIndexCommand}" Style="{StaticResource InfoButton}" Height="26" Width="82" />
<Button Margin="10 2 0 2" Content="Settings" Command="{Binding OpenSettingsCommand}" Style="{StaticResource InfoButton}" Height="26" Width="70" />
<Button x:Name="RefreshButton" Margin="10 2 0 2" Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_RefreshIndex}" Command="{Binding RefreshIndexCommand}" Width="Auto" MinWidth="70" Style="{StaticResource SecondaryButton}"/>
<Button x:Name="SettingsButton" Margin="10 2 0 2" Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_Settings}" Command="{Binding OpenSettingsCommand}" Style="{StaticResource SecondaryButton}" Width="Auto" MinWidth="70" />
</StackPanel>
<Label Content="Result Info:" Style="{StaticResource CommonLabel}" VerticalAlignment="Center" Grid.Column="3" />
<Label Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_ResultInfo}" Style="{StaticResource CommonLabel}" VerticalAlignment="Center" Grid.Column="3" />
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" MaxHeight="100" Grid.Column="4">
<Label Content="{Binding ResultInfo}" Style="{StaticResource ResultInfoLabelStyle}" />
</ScrollViewer>
</Grid>
<DockPanel DockPanel.Dock="Top">
<Label Content="Hind Words:" Style="{StaticResource CommonLabel}" DockPanel.Dock="Left" />
<Label Content="{Binding Converter={StaticResource LocalizeConverter}, ConverterParameter=Search_HintWords}" Style="{StaticResource CommonLabel}" DockPanel.Dock="Left" />
<ScrollViewer DockPanel.Dock="Right" VerticalScrollBarVisibility="Auto" MaxHeight="60">
<ItemsControl ItemsSource="{Binding HintWords}" ItemsPanel="{StaticResource ItemsPanelTemplateHorizontal}" HorizontalAlignment="Left">
<ItemsControl.ItemTemplate>
Expand All @@ -79,17 +81,17 @@
</DockPanel>
<DataGrid Name="MatchedCodeSourceGrid" Style="{StaticResource MatchedCodeSourceGridStyle}" Margin="0 6 0 0" ItemsSource="{Binding SearchResults}" IsReadOnly="True">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Width="3*" Binding="{Binding CodeSource.FileName}" />
<DataGridTextColumn Header="Extension" Width="1*" Binding="{Binding CodeSource.FileExtension}" />
<DataGridTextColumn Header="Matched Line" Width="1*" Binding="{Binding MatchedLine}" />
<DataGridTemplateColumn Header="Content" Width="6*">
<DataGridTextColumn Width="3*" Binding="{Binding CodeSource.FileName}" Header="{x:Static res:Strings.Search_ColumnName}" />
<DataGridTextColumn Width="1*" Binding="{Binding CodeSource.FileExtension}" Header="{x:Static res:Strings.Search_ColumnExtension}" />
<DataGridTextColumn Width="1*" Binding="{Binding MatchedLine}" Header="{x:Static res:Strings.Search_ColumnMatchedLine}" />
<DataGridTemplateColumn Width="6*" Header="{x:Static res:Strings.Search_ColumnContent}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ContentControl Content="{Binding MatchedContent, Converter={StaticResource StringToXamlConverter}, Mode=OneWay}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="Path" Width="6*" Binding="{Binding CodeSource.FilePath}" />
<DataGridTextColumn Width="6*" Binding="{Binding CodeSource.FilePath}" Header="{x:Static res:Strings.Search_ColumnPath}" />
</DataGrid.Columns>
<DataGrid.Resources>
<Style TargetType="DataGridRow" BasedOn="{StaticResource BaseGridStyle}">
Expand Down
Loading