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
91 changes: 91 additions & 0 deletions .github/workflows/build-vsix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Publish VSIX

on:
push:
tags:
- v*

jobs:
build:
name: Build VSIX
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSBuild (add to PATH)
uses: microsoft/setup-msbuild@v2
- name: Locate MSBuild
id: msbuild
shell: pwsh
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
if(-not (Test-Path $vswhere)) { throw "vswhere not found at $vswhere" }
$msbuild = & $vswhere -latest -requires Microsoft.Component.MSBuild -find "MSBuild\**\Bin\MSBuild.exe" | Select-Object -First 1
if(-not $msbuild){ throw 'MSBuild not found' }
"path=$msbuild" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
- name: Restore (solution)
shell: pwsh
run: |
dotnet restore src/CodeIndex.VisualStudioExtension/CodeIndex.VisualStudioExtension.sln
- name: Build VSIX (Release)
shell: pwsh
run: |
& '${{ steps.msbuild.outputs.path }}' src/CodeIndex.VisualStudioExtension/CodeIndex.VisualStudioExtension.csproj /t:Build /p:Configuration=Release /nologo
- name: Locate VSIX
id: locate_vsix
shell: pwsh
run: |
$outDir = "src/CodeIndex.VisualStudioExtension/bin/Release"
if(-not (Test-Path $outDir)) { throw "Output directory not found: $outDir" }
Write-Host "Listing VSIX output directory contents:"; Get-ChildItem -Path $outDir | Format-Table Name,Length,LastWriteTime
$vsix = Get-ChildItem -Path $outDir -Filter *.vsix -File | Sort-Object LastWriteTime -Descending | Select-Object -First 1
if(-not $vsix) {
Write-Host 'No VSIX found; dumping recursive tree:'
Get-ChildItem -Path $outDir -Recurse | Select-Object FullName,Length,LastWriteTime | Format-Table -AutoSize
throw 'VSIX file not generated.'
}
Write-Host "Found VSIX: $($vsix.FullName)"
if(-not (Test-Path 'artifacts')) { New-Item -ItemType Directory -Path artifacts | Out-Null }
$dest = Join-Path -Path (Resolve-Path 'artifacts').Path -ChildPath $vsix.Name
Copy-Item -Path $vsix.FullName -Destination $dest -Force -ErrorAction Stop
Write-Host "Copied to $dest"
"path=$dest" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: CodeIndex.VSIX
path: ${{ steps.locate_vsix.outputs.path }}
if-no-files-found: error

release:
name: Create / Update Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: CodeIndex.VSIX
path: downloaded
- name: List downloaded files
run: ls -R downloaded
- name: Create or update release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
tag="$GITHUB_REF_NAME"
asset=$(ls downloaded/*.vsix | head -n1)
if [ -z "$asset" ]; then
echo "No VSIX asset found" >&2
exit 1
fi
echo "Publishing release $tag with asset $asset"
if gh release create "$tag" "$asset" --title "VSIX $tag" --notes "VSIX build for $tag" -R "$GITHUB_REPOSITORY"; then
echo "Release created"
else
echo "Release exists, updating asset..."
gh release upload "$tag" "$asset" --clobber -R "$GITHUB_REPOSITORY"
fi
21 changes: 11 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ jobs:
Write-Host "Tag $tag deleted to prevent release."

build:
name: Build & Package (framework-dependent any-platform)
name: Build & Package
needs: test
runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -67,15 +67,16 @@ jobs:
-p:PublishSingleFile=false -p:SelfContained=false -o artifacts/publish-any

- name: Package zip
shell: pwsh
run: |
mkdir -p artifacts/zips
(cd artifacts/publish-any && zip -r ../zips/CodeIndex.Server-any.zip .)
New-Item -ItemType Directory -Path artifacts/zips -Force | Out-Null
Compress-Archive -Path artifacts/publish-any/* -DestinationPath artifacts/zips/CodeIndex.Server.zip -Force

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: CodeIndex.Server-any
path: artifacts/zips/CodeIndex.Server-any.zip
name: CodeIndex.Server
path: artifacts/zips/CodeIndex.Server.zip
if-no-files-found: error

release:
Expand All @@ -88,7 +89,7 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: CodeIndex.Server-any
name: CodeIndex.Server
path: downloaded

- name: List downloaded files
Expand All @@ -100,9 +101,9 @@ jobs:
shell: bash
run: |
tag="$GITHUB_REF_NAME"
asset="downloaded/CodeIndex.Server-any.zip"
echo "Publishing release $tag with asset $asset (framework-dependent build)"
if gh release create "$tag" "$asset" --title "CodeIndex.Server $tag" --notes "Framework-dependent (cross-platform) build for $tag" -R "$GITHUB_REPOSITORY"; then
asset="downloaded/CodeIndex.Server.zip"
echo "Publishing release $tag with asset $asset"
if gh release create "$tag" "$asset" --title "CodeIndex.Server $tag" --notes "Framework-dependent build (.exe) for $tag" -R "$GITHUB_REPOSITORY"; then
echo "Release created"
else
echo "Release exists, updating asset..."
Expand Down
68 changes: 58 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,53 @@ Notice: in the docker container, when add the index config, the monitor folder s

### Search Extension For Visual Studio

|Status|Value|
Current icon used in listing:

![Marketplace Icon](doc/Extension-Icon.png)

|Status|Badge|
|:----|:---:|
|VS Marketplace|[![VS Marketplace](http://vsmarketplacebadge.apphb.com/version-short/qiuhaotc.CodeIndexExtension.svg)](https://marketplace.visualstudio.com/items?itemName=qiuhaotc.CodeIndexExtension)
|VS Marketplace Downloads|[![VS Marketplace Downloads](http://vsmarketplacebadge.apphb.com/downloads/qiuhaotc.CodeIndexExtension.svg)](https://marketplace.visualstudio.com/items?itemName=qiuhaotc.CodeIndexExtension)
|VS Marketplace Installs|[![VS Marketplace Installs](http://vsmarketplacebadge.apphb.com/installs-short/qiuhaotc.CodeIndexExtension.svg)](https://marketplace.visualstudio.com/items?itemName=qiuhaotc.CodeIndexExtension)
|VS Marketplace Version|[![VS Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/qiuhaotc.CodeIndexExtension?label=version&logo=visualstudio&color=blueviolet)](https://marketplace.visualstudio.com/items?itemName=qiuhaotc.CodeIndexExtension)|
|VS Marketplace Downloads|[![VS Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/qiuhaotc.CodeIndexExtension?label=downloads&logo=visualstudio)](https://marketplace.visualstudio.com/items?itemName=qiuhaotc.CodeIndexExtension)|
|VS Marketplace Installs|[![VS Marketplace Installs](https://img.shields.io/visual-studio-marketplace/i/qiuhaotc.CodeIndexExtension?label=installs&logo=visualstudio)](https://marketplace.visualstudio.com/items?itemName=qiuhaotc.CodeIndexExtension)|
|VS Marketplace Rating|[![VS Marketplace Rating](https://img.shields.io/visual-studio-marketplace/r/qiuhaotc.CodeIndexExtension?label=rating&logo=visualstudio)](https://marketplace.visualstudio.com/items?itemName=qiuhaotc.CodeIndexExtension)|

#### Recent Updates

Latest improvements to the Visual Studio extension

- Dual Server Modes
- Seamlessly switch between Local and Remote server modes with persistent settings.
- Automatic health probe on settings window open (local mode) + manual Check button.
- Resilient Local Server Lifecycle
- Single-instance control (global mutex + per-process lock files + PID file).
- Auto restart if external termination detected (mutex loss recovery).
- Deferred index loading until server health passes.
- Download / Update Workflow
- One-click Download / Update (latest tag scraped from Releases page).
- Streamed download with real-time percentage progress.
- Temp ZIP cleanup after successful extraction; validates core binary presence.
- Smart Default Paths
- Auto install path: `%LOCALAPPDATA%/CodeIndex.VisualStudioExtension/CodeIndex.Server` when empty.
- Auto data path: `%LOCALAPPDATA%/CodeIndex.VisualStudioExtension/CodeIndex.Server.Data` when first selecting install path and data path empty.
- Modern Folder Picker
- 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.
- Quick Navigation Buttons
- Open buttons beside Local & Remote URLs (auto prepend http:// when missing).
- Responsive Async Commands
- Instant button enable/disable; removed unsafe async void patterns.
- Embedded Log Viewer
- Displays latest 100 log lines with refresh.
- Packaging & Manifest Reliability
- Pre-build sync of `source.extension.vsixmanifest` prevents stale version drift.
- Architecture targeting + ProductArchitecture resolves VSSDK1311 warning.
- Settings & Migration
- JSON settings, legacy URL migration, normalized trailing slashes.
- Additional Hardening
- Clear health states (Started / Stopped / Error / Unknown) drive UI state.
- Improved error messages for download / extraction / URL opening.

#### Download Url

Expand Down Expand Up @@ -127,13 +169,19 @@ When Phase Quuery not been ticked, you can follow the sytax under [http://www.lu

When Case-Sensitive been ticked, we can search the content in case-sensitive mode. When search the content like String, it won't return the content that contains string

## Extension Compile

```powershell
& "C:\Program Files\Microsoft Visual Studio\18\Insiders\MSBuild\Current\Bin\MSBuild.exe" src\CodeIndex.VisualStudioExtension\CodeIndex.VisualStudioExtension.csproj /t:Build /p:Configuration=Debug /nologo
```

## Misc

|Status|Value|
|:----|:---:|
|Stars|[![Stars](https://img.shields.io/github/stars/qiuhaotc/CodeIndex)](https://github.com/qiuhaotc/CodeIndex)
|Forks|[![Forks](https://img.shields.io/github/forks/qiuhaotc/CodeIndex)](https://github.com/qiuhaotc/CodeIndex)
|License|[![License](https://img.shields.io/github/license/qiuhaotc/CodeIndex)](https://github.com/qiuhaotc/CodeIndex)
|Issues|[![Issues](https://img.shields.io/github/issues/qiuhaotc/CodeIndex)](https://github.com/qiuhaotc/CodeIndex)
|Docker Pulls|[![Downloads](https://img.shields.io/docker/pulls/qiuhaotc/codeindex.svg)](https://hub.docker.com/r/qiuhaotc/codeindex)
|Release Downloads|[![Downloads](https://img.shields.io/github/downloads/qiuhaotc/CodeIndex/total.svg)](https://github.com/qiuhaotc/CodeIndex/releases)
|Stars|[![Stars](https://img.shields.io/github/stars/qiuhaotc/CodeIndex)](https://github.com/qiuhaotc/CodeIndex)|
|Forks|[![Forks](https://img.shields.io/github/forks/qiuhaotc/CodeIndex)](https://github.com/qiuhaotc/CodeIndex)|
|License|[![License](https://img.shields.io/github/license/qiuhaotc/CodeIndex)](https://github.com/qiuhaotc/CodeIndex)|
|Issues|[![Issues](https://img.shields.io/github/issues/qiuhaotc/CodeIndex)](https://github.com/qiuhaotc/CodeIndex)|
|Docker Pulls|[![Downloads](https://img.shields.io/docker/pulls/qiuhaotc/codeindex.svg)](https://hub.docker.com/r/qiuhaotc/codeindex)|
|Release Downloads|[![Downloads](https://img.shields.io/github/downloads/qiuhaotc/CodeIndex/total.svg)](https://github.com/qiuhaotc/CodeIndex/releases)|
Binary file modified doc/UseExtension.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 0 additions & 22 deletions src/.vscode/launch.json

This file was deleted.

42 changes: 0 additions & 42 deletions src/.vscode/tasks.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'VisualStudioExtensionRelease|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>true</UseWPF>
</PropertyGroup>
<OutputPath>bin\Release\</OutputPath>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
<UseWPF>true</UseWPF>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -121,10 +120,42 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\SettingsWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<!-- Suppress MSB4011 duplicate import warning locally (benign; caused by SDK + VSIX target chain) -->
<PropertyGroup>
<NoWarn>$(NoWarn);MSB4011</NoWarn>
</PropertyGroup>
<!-- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition="'$(CSharpTargetsImported)' != 'true'" /> -->
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<Target Name="CodeIndex_ForceSyncManifest" BeforeTargets="PrepareForBuild">
<Message Text="[CodeIndex] Syncing source.extension.vsixmanifest to obj/Debug, obj/Release and $(IntermediateOutputPath)" Importance="High" />
<ItemGroup>
<_CodeIndexManifest Include="source.extension.vsixmanifest" Condition="Exists('source.extension.vsixmanifest')" />
</ItemGroup>
<!-- Ensure target folders exist (they may not if never built that config yet) -->
<MakeDir Directories="obj\Debug" Condition="!Exists('obj\\Debug')" />
<MakeDir Directories="obj\Release" Condition="!Exists('obj\\Release')" />
<!-- Copy to fixed Debug/Release obj roots -->
<Copy SourceFiles="@(_CodeIndexManifest)"
DestinationFiles="obj\Debug\extension.vsixmanifest"
SkipUnchangedFiles="true"
OverwriteReadOnlyFiles="true" Condition=" '@(_CodeIndexManifest)' != '' " />
<Copy SourceFiles="@(_CodeIndexManifest)"
DestinationFiles="obj\Release\extension.vsixmanifest"
SkipUnchangedFiles="true"
OverwriteReadOnlyFiles="true" Condition=" '@(_CodeIndexManifest)' != '' " />
<!-- Still copy to the configuration-specific intermediate path (e.g. obj\Debug\ or obj\Release\) so VsixUtil uses latest -->
<Copy SourceFiles="@(_CodeIndexManifest)"
DestinationFiles="$(IntermediateOutputPath)extension.vsixmanifest"
SkipUnchangedFiles="true"
OverwriteReadOnlyFiles="true" Condition=" '@(_CodeIndexManifest)' != '' " />
</Target>
</Project>
Loading