Skip to content

Conversation

@JacobRWebb
Copy link
Contributor

Summary

  • Added tree-sitter-c-sharp.wasm grammar URL for C# syntax parsing/indexing
  • Added .slnx support to C# project detection patterns

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 18, 2026

Greptile Summary

  • Added C# tree-sitter grammar WASM download capability to enable syntax parsing and code indexing for C# projects in the Matrix indexer system
  • Extended C# project detection to include .slnx files, which are the new XML-based solution format introduced in recent Visual Studio versions

Important Files Changed

Filename Overview
src/indexer/languages/download.ts Added C# grammar WASM URL but contains typo ("duplicatess") and potential filename/URL mismatch (hyphen vs underscore)
src/utils/project-detection.ts Extended C# project detection patterns to include .slnx files alongside existing .csproj, .sln, and global.json

Confidence score: 3/5

  • This PR enhances C# language support but has technical issues that need attention before merging
  • Score lowered due to a typo in comments ("duplicatess" instead of "duplicates") and a potential filename mismatch between the registry key ('tree-sitter-c-sharp.wasm') and the actual URL path ('tree-sitter-c_sharp.wasm') which could cause download failures
  • Pay close attention to src/indexer/languages/download.ts for the typo fix and verify the correct WASM filename format

Sequence Diagram

sequenceDiagram
    participant User
    participant "Matrix Plugin"
    participant "Project Detector"
    participant Indexer
    participant "Grammar Downloader"
    participant "unpkg CDN"
    participant "File System"

    User->>+"Matrix Plugin": "Index C# project"
    "Matrix Plugin"->>+"Project Detector": "detectProjectTypes(cwd)"
    "Project Detector"->>+"File System": "Check for *.csproj, *.sln, *.slnx"
    "File System"-->>-"Project Detector": "C# project markers found"
    "Project Detector"-->>-"Matrix Plugin": "C# project detected"
    
    "Matrix Plugin"->>+Indexer: "Start C# indexing"
    Indexer->>+"Grammar Downloader": "downloadGrammar('tree-sitter-c-sharp.wasm')"
    "Grammar Downloader"->>+"File System": "Check cache ~/.claude/matrix/grammars/"
    "File System"-->>-"Grammar Downloader": "Grammar not cached"
    
    "Grammar Downloader"->>+"unpkg CDN": "Fetch tree-sitter-c_sharp.wasm"
    "unpkg CDN"-->>-"Grammar Downloader": "WASM binary"
    "Grammar Downloader"->>+"File System": "Cache grammar file"
    "File System"-->>-"Grammar Downloader": "Grammar cached"
    "Grammar Downloader"-->>-Indexer: "Grammar path"
    
    Indexer->>+Indexer: "Parse C# files with grammar"
    Indexer-->>-"Matrix Plugin": "Indexing complete"
    "Matrix Plugin"-->>-User: "C# project indexed successfully"
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

'tree-sitter-cpp.wasm': 'https://unpkg.com/tree-sitter-cpp@0.23.4/tree-sitter-cpp.wasm',
'tree-sitter-ruby.wasm': 'https://unpkg.com/tree-sitter-ruby@0.23.1/tree-sitter-ruby.wasm',
'tree-sitter-php.wasm': 'https://unpkg.com/tree-sitter-php@0.24.2/tree-sitter-php.wasm',
'tree-sitter-c-sharp.wasm': 'https://unpkg.com/tree-sitter-c-sharp@0.23.1/tree-sitter-c_sharp.wasm',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Filename key uses hyphen ('c-sharp') but URL path uses underscore ('c_sharp'). This mismatch will cause download failures when the C# grammar is requested.

Suggested change
'tree-sitter-c-sharp.wasm': 'https://unpkg.com/tree-sitter-c-sharp@0.23.1/tree-sitter-c_sharp.wasm',
'tree-sitter-c-sharp.wasm': 'https://unpkg.com/tree-sitter-c-sharp@0.23.1/tree-sitter-c-sharp.wasm',

Should the key be 'tree-sitter-c_sharp.wasm' to match the URL, or should the URL use hyphens?

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/indexer/languages/download.ts
Line: 29:29

Comment:
**logic:** Filename key uses hyphen ('c-sharp') but URL path uses underscore ('c_sharp'). This mismatch will cause download failures when the C# grammar is requested.

```suggestion
  'tree-sitter-c-sharp.wasm': 'https://unpkg.com/tree-sitter-c-sharp@0.23.1/tree-sitter-c-sharp.wasm',
```

 Should the key be 'tree-sitter-c_sharp.wasm' to match the URL, or should the URL use hyphens?

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL is currently in correct format. c-sharp returns incorrect uri. The proper format in this instance is c_sharp

@ojowwalker77
Copy link
Owner

@JacobRWebb thanks for this contribution! Could you add a changelog entry?

---CHANGELOG.md

[2.1.2] - 2025-01-18

Added

  • C# Tree-sitter Grammar - Added tree-sitter-c-sharp.wasm for code indexing
  • .slnx Detection - Extended C# project detection to include .slnx files

the release CI won't trigger without a changelog entry

@ojowwalker77 ojowwalker77 self-requested a review January 18, 2026 02:36
@ojowwalker77 ojowwalker77 merged commit 308d995 into ojowwalker77:main Jan 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants