Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented a #L10-20 syntax for files, and #M-MethodName syntax for CSharp methods #715

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RonSijm
Copy link

@RonSijm RonSijm commented Feb 4, 2025

Hey there,

To make it easier to reference certain parts of code, I've added two new functions:

snippet: File.cs#L10-20

The purpose of this is to allow people to add a reference to a file, and indicate which line number range to include - instead of having to include everything.

snippet: File.cs#M-MethodName

The purpose of this is to allow people to add a reference to a file, and indicate method to include. This way you don't have to add regions to your codebase, and you can use specific methods as a reference.

I had some issues compiling and running parts of the code, but I managed to compile the MarkdownSnippets.Tool.exe and test the functionality on my own project. But I might have missed some things in usecases I haven't tried.

I've added the new logic to the FileToSnippet logic which creates an Snippet DTO, so the syntax is getting parsed and handled pretty high up in the program flow, without affecting lower level functions

@RonSijm RonSijm force-pushed the main branch 2 times, most recently from 4a469ed to 34baf83 Compare February 4, 2025 21:13
 - Implemented a #M-MethodName syntax for CSharp files to reference a specific method
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.

1 participant