mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
C#: Cleanup C# source code file and add a test case for namespace delcarations.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
namespace MyFileScopedNamespace;
|
||||
|
||||
public class MyFileScopedNamespaceClass
|
||||
{
|
||||
private readonly object myField = new object();
|
||||
public object MyProp { get; set; }
|
||||
public void MyMethod() { }
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
| FileScopedNamespace.cs:1:11:1:31 | MyFileScopedNamespace | FileScopedNamespace.cs:2:14:2:39 | MyFileScopedNamespaceClass |
|
||||
| FileScopedNamespace.cs:1:11:1:31 | MyFileScopedNamespace | FileScopedNamespace.cs:4:29:4:35 | myField |
|
||||
| FileScopedNamespace.cs:1:11:1:31 | MyFileScopedNamespace | FileScopedNamespace.cs:5:19:5:24 | MyProp |
|
||||
| FileScopedNamespace.cs:1:11:1:31 | MyFileScopedNamespace | FileScopedNamespace.cs:6:17:6:24 | MyMethod |
|
||||
fileScopedNamespace
|
||||
| FileScopedNamespace.cs:1:11:1:31 | MyFileScopedNamespace | FileScopedNamespace.cs:3:14:3:39 | MyFileScopedNamespaceClass |
|
||||
| FileScopedNamespace.cs:1:11:1:31 | MyFileScopedNamespace | FileScopedNamespace.cs:5:29:5:35 | myField |
|
||||
| FileScopedNamespace.cs:1:11:1:31 | MyFileScopedNamespace | FileScopedNamespace.cs:6:19:6:24 | MyProp |
|
||||
| FileScopedNamespace.cs:1:11:1:31 | MyFileScopedNamespace | FileScopedNamespace.cs:7:17:7:24 | MyMethod |
|
||||
namespaceDeclaration
|
||||
| FileScopedNamespace.cs:1:11:1:31 | namespace ... { ... } | FileScopedNamespace.cs:1:11:1:31 | MyFileScopedNamespace |
|
||||
|
||||
@@ -8,3 +8,5 @@ query predicate fileScopedNamespace(Namespace n, Member m) {
|
||||
m.getLocation().toString().matches("%FileScopedNamespace.cs%")
|
||||
)
|
||||
}
|
||||
|
||||
query predicate namespaceDeclaration(NamespaceDeclaration nd, Namespace n) { n = nd.getNamespace() }
|
||||
|
||||
Reference in New Issue
Block a user