An open API service indexing awesome lists of open source software.

https://github.com/angularsen/codequery

Experimenting with Roslyn to analyze and query code, until ReSharper or Rider/Visual Studio gets native support for something like this.
https://github.com/angularsen/codequery

Last synced: 4 months ago
JSON representation

Experimenting with Roslyn to analyze and query code, until ReSharper or Rider/Visual Studio gets native support for something like this.

Awesome Lists containing this project

README

          

# CodeQuery
Experimenting with Roslyn to analyze and query code, until ReSharper or Rider/Visual Studio gets native support for something like this.

### Examples
```
$ dotnet run
Supported commands:
methods solution-or-project-or-source-file [--projects regex] [--namespaces regex] [--method-param-type regex]

Examples:
---

Query all methods with a parameter of type System.DateTime -or- System.DateTime?
CodeQuery.exe methods "C:/dev/CodeQuery/CodeQuery.sln" --projects "^(CodeQuery)$" --method-param-type "System.DateTime\??"
```

#### Find all methods with a parameter of type `System.DateTime` or the nullable `System.DateTime?`
Note that `Nullable` and `T?` is handled as if the same.

```cmd
dotnet run -- methods ../CodeQuery.sln --method-param-type "System.DateTime\??"
```

Output
```
File: C:/dev/CodeQuery/CodeQuery.sln
Projects: (all)
Namespaces: (all)
Method param type: System.DateTime\??
00:00:01.1675201 001 CodeQuery.SampleClass.NormalDateTime(System.DateTime)
00:00:01.2013137 002 CodeQuery.SampleClass.NullableDateTime1(System.DateTime?)
00:00:01.2120629 003 CodeQuery.SampleClass.NullableDateTime2(System.DateTime?)
```