Skip to content

support C# - #15

Open
Outofnothing wants to merge 3 commits into
luxel:masterfrom
Outofnothing:master
Open

support C##15
Outofnothing wants to merge 3 commits into
luxel:masterfrom
Outofnothing:master

Conversation

@Outofnothing

@Outofnothing Outofnothing commented May 10, 2024

Copy link
Copy Markdown

Add support for C++, C#, Dart
All three languages have similar style like Java, so basically copy JavaProcessor

Copilot AI review requested due to automatic review settings February 5, 2026 05:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds support for three new programming languages (C++, C#, and Dart) to the Ramile source code extraction tool. Additionally, it introduces build configuration files (pyproject.toml and uv.lock) for the uv package manager and updates documentation to reflect the new language support.

Changes:

  • Added three new file processors (CppProcessor, CSharpProcessor, DartProcessor) that follow the same pattern as existing Java/JavaScript processors
  • Updated processor registration to include the new language processors
  • Added error handling to the file processing method to gracefully handle file reading exceptions
  • Updated README with Chinese translation, uv usage instructions, and documentation for new language support

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
ramile/processors/cpp_processor.py New processor for C++ files (.cpp, .hpp, .c, .h) with C-style comment filtering
ramile/processors/csharp_processor.py New processor for C# files (.cs) with C-style comment filtering
ramile/processors/dart_processor.py New processor for Dart files (.dart) with C-style comment filtering
ramile/processors/init.py Registered new processors and added exception handling for file processing
pyproject.toml New project configuration file for uv package manager
uv.lock New lock file for uv package manager with dependency specifications
README.md Updated with Chinese translation, uv instructions, and new language support documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +7 to +14
class CSharpProcessor(FileProcessorBase):
expected_extensions = ['.cs']

def __init__(self):
self.filters.append(BlankLineFilter())
self.filters.append(CStyleCommentBlockFilter())
self.filters.append(DoubleSlashCommentFilter())
return

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

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

The new CSharpProcessor lacks test coverage. The codebase uses pytest and has test coverage for other language processors (see tests/test_js.py). Consider adding a test file such as tests/test_csharp.py with sample C# code to verify that the processor correctly filters comments and blank lines.

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +14
class CppProcessor(FileProcessorBase):
expected_extensions = ['.cpp', '.hpp', '.c', '.h']

def __init__(self):
self.filters.append(BlankLineFilter())
self.filters.append(CStyleCommentBlockFilter())
self.filters.append(DoubleSlashCommentFilter())
return

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

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

The new CppProcessor lacks test coverage. The codebase uses pytest and has test coverage for other language processors (see tests/test_js.py). Consider adding a test file such as tests/test_cpp.py with sample C++ code to verify that the processor correctly filters comments and blank lines.

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +14
class DartProcessor(FileProcessorBase):
expected_extensions = ['.dart']

def __init__(self):
self.filters.append(BlankLineFilter())
self.filters.append(CStyleCommentBlockFilter())
self.filters.append(DoubleSlashCommentFilter())
return

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

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

The new DartProcessor lacks test coverage. The codebase uses pytest and has test coverage for other language processors (see tests/test_js.py). Consider adding a test file such as tests/test_dart.py with sample Dart code to verify that the processor correctly filters comments and blank lines.

Copilot uses AI. Check for mistakes.
Comment on lines +28 to +32
last_line = None
for original_line in open_file:
if self.process_line(file, original_line):
yield original_line
last_line = original_line

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

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

Variable last_line is not used.

Suggested change
last_line = None
for original_line in open_file:
if self.process_line(file, original_line):
yield original_line
last_line = original_line
for original_line in open_file:
if self.process_line(file, original_line):
yield original_line

Copilot uses AI. Check for mistakes.
from ramile.processors.double_slash_comment_filter import DoubleSlashCommentFilter


class CppProcessor(FileProcessorBase):

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

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

This class does not call FileProcessorBase.init during initialization. (CppProcessor.init may be missing a call to a base class init)

Copilot uses AI. Check for mistakes.
from ramile.processors.double_slash_comment_filter import DoubleSlashCommentFilter


class CSharpProcessor(FileProcessorBase):

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

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

This class does not call FileProcessorBase.init during initialization. (CSharpProcessor.init may be missing a call to a base class init)

Copilot uses AI. Check for mistakes.
from ramile.processors.double_slash_comment_filter import DoubleSlashCommentFilter


class DartProcessor(FileProcessorBase):

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

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

This class does not call FileProcessorBase.init during initialization. (DartProcessor.init may be missing a call to a base class init)

Copilot uses AI. Check for mistakes.
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