mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
Fix #5238: Add support for .NET file extensions in codebase indexing
- Added Visual Basic .NET (.vb) extension support - Added F# (.fs, .fsx, .fsi) extension support - Added appropriate parser mappings for VB.NET and F# files - Added comprehensive test coverage for .NET extension support This resolves the issue where .NET projects were not being properly indexed because only C# files were supported. Now all common .NET file types are included in the codebase indexing system.
This commit is contained in:
parent
3a8ba27615
commit
052628e5e2
3 changed files with 50 additions and 0 deletions
32
src/services/code-index/__tests__/dotnet-support.spec.ts
Normal file
32
src/services/code-index/__tests__/dotnet-support.spec.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// npx vitest services/code-index/__tests__/dotnet-support.spec.ts
|
||||
|
||||
import { extensions } from "../../tree-sitter"
|
||||
import { scannerExtensions } from "../shared/supported-extensions"
|
||||
|
||||
describe(".NET file extension support", () => {
|
||||
it("should include C# files in supported extensions", () => {
|
||||
expect(extensions).toContain(".cs")
|
||||
expect(scannerExtensions).toContain(".cs")
|
||||
})
|
||||
|
||||
it("should include Visual Basic .NET files in supported extensions", () => {
|
||||
expect(extensions).toContain(".vb")
|
||||
expect(scannerExtensions).toContain(".vb")
|
||||
})
|
||||
|
||||
it("should include F# files in supported extensions", () => {
|
||||
expect(extensions).toContain(".fs")
|
||||
expect(extensions).toContain(".fsx")
|
||||
expect(extensions).toContain(".fsi")
|
||||
expect(scannerExtensions).toContain(".fs")
|
||||
expect(scannerExtensions).toContain(".fsx")
|
||||
expect(scannerExtensions).toContain(".fsi")
|
||||
})
|
||||
|
||||
it("should not include markdown files in scanner extensions", () => {
|
||||
expect(extensions).toContain(".md")
|
||||
expect(extensions).toContain(".markdown")
|
||||
expect(scannerExtensions).not.toContain(".md")
|
||||
expect(scannerExtensions).not.toContain(".markdown")
|
||||
})
|
||||
})
|
||||
|
|
@ -46,6 +46,12 @@ const extensions = [
|
|||
"hpp",
|
||||
// C#
|
||||
"cs",
|
||||
// Visual Basic .NET
|
||||
"vb",
|
||||
// F#
|
||||
"fs",
|
||||
"fsx",
|
||||
"fsi",
|
||||
// Ruby
|
||||
"rb",
|
||||
"java",
|
||||
|
|
|
|||
|
|
@ -137,6 +137,18 @@ export async function loadRequiredLanguageParsers(filesToParse: string[], source
|
|||
language = await loadLanguage("c_sharp", sourceDirectory)
|
||||
query = new Query(language, csharpQuery)
|
||||
break
|
||||
case "vb":
|
||||
// Visual Basic .NET - use C# parser as fallback since VB.NET has similar structure
|
||||
language = await loadLanguage("c_sharp", sourceDirectory)
|
||||
query = new Query(language, csharpQuery)
|
||||
break
|
||||
case "fs":
|
||||
case "fsx":
|
||||
case "fsi":
|
||||
// F# - use OCaml parser since F# is based on OCaml
|
||||
language = await loadLanguage("ocaml", sourceDirectory)
|
||||
query = new Query(language, ocamlQuery)
|
||||
break
|
||||
case "rb":
|
||||
language = await loadLanguage("ruby", sourceDirectory)
|
||||
query = new Query(language, rubyQuery)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue