{"id":13629677,"url":"https://github.com/roeibajayo/SourceGeneratorQuery","last_synced_at":"2025-04-17T09:35:42.170Z","repository":{"id":65256201,"uuid":"589087984","full_name":"roeibajayo/SourceGeneratorQuery","owner":"roeibajayo","description":"C# SourceGenerator helper which helps you query your files, and adds LINQ support","archived":false,"fork":false,"pushed_at":"2023-01-16T22:17:54.000Z","size":24,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-30T17:16:26.568Z","etag":null,"topics":["csharp-sourcegenerator","linq","query","query-builder","source-generator"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roeibajayo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-15T02:18:15.000Z","updated_at":"2024-08-28T07:41:20.000Z","dependencies_parsed_at":"2023-02-10T06:30:35.767Z","dependency_job_id":null,"html_url":"https://github.com/roeibajayo/SourceGeneratorQuery","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roeibajayo%2FSourceGeneratorQuery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roeibajayo%2FSourceGeneratorQuery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roeibajayo%2FSourceGeneratorQuery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roeibajayo%2FSourceGeneratorQuery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roeibajayo","download_url":"https://codeload.github.com/roeibajayo/SourceGeneratorQuery/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223751368,"owners_count":17196623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp-sourcegenerator","linq","query","query-builder","source-generator"],"created_at":"2024-08-01T22:01:16.323Z","updated_at":"2024-11-08T20:31:41.774Z","avatar_url":"https://github.com/roeibajayo.png","language":"C#","readme":"# SourceGeneratorQuery\nC# class library that helps you query the GeneratorExecutionContext, and also adds LINQ support.\n\nYou can read about Source Generators on [Microsoft's site](https://learn.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview). \n\nInstallation\n---\nThis library is distributed via NuGet.\n\n\u003e PM\u003e Install-Package [SourceGeneratorQuery](https://www.nuget.org/packages/SourceGeneratorQuery)\n\nQuick Start\n---\n```csharp\n//..\n        public void Execute(GeneratorExecutionContext context)\n        {\n            var classes = context\n                .NewQuery() // start new query\n                .WithPath(\"./Social\") // filter search on specific path\n                .GetClasses()\n                .WithName(x =\u003e x.EndsWith(\"Client\")); // classes ends with 'Client'\n\n            var syntaxNodes = classes.Select(x =\u003e x.SyntaxNode); // get the syntax nodes if you want\n\n            // example of iteration\n            foreach (var c in classes)\n            {\n                var publicMethodsWithMyAttributeAndStartsWithGet = c.GetMethods()\n                            .WithAttribute(\"MyAttribute\")\n                            .WithPublic()\n                            .WithName(name =\u003e name.StartsWith(\"Get\"));\n\n                var methodsSyntaxNodes = publicMethodsWithMyAttributeAndStartsWithGet.Select(x =\u003e x.SyntaxNode);\n\n                var stringifyMethods = publicMethodsWithMyAttributeAndStartsWithGet\n                    .Select(x =\u003e $\"{string.Join(\" \", x.Modifiers)} {x.Name}({string.Join(\", \", x.Parameters.Select(p =\u003e $\"{p.Type} {p.Name}\"))})\")\n                    .ToArray();\n            }\n        }\n//..\n```\n\nExamples\n---\nSee \u003ccode\u003e/src/examples\u003c/code\u003e folder for more examples.","funding_links":[],"categories":["Source Generators","Do not want to test 112 ( old ISourceGenerator )"],"sub_categories":["Metaprogramming","1. [ThisAssembly](https://ignatandrei.github.io/RSCG_Examples/v2/docs/ThisAssembly) , in the [EnhancementProject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) category"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froeibajayo%2FSourceGeneratorQuery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froeibajayo%2FSourceGeneratorQuery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froeibajayo%2FSourceGeneratorQuery/lists"}