Skip to content

Commit

Permalink
C#: Include .razor files in File::fromSource
Browse files Browse the repository at this point in the history
  • Loading branch information
tamasvajk committed Sep 11, 2024
1 parent d374935 commit da3c5f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion csharp/ql/integration-tests/all-platforms/cshtml/Files.ql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import csharp

from File f
where f.fromSource() or f.getExtension() = "cshtml"
where f.fromSource()
select f
2 changes: 1 addition & 1 deletion csharp/ql/lib/semmle/code/csharp/File.qll
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class File extends Container, Impl::File {

/** Holds if this file contains source code. */
final predicate fromSource() {
this.getExtension() = ["cs", "cshtml"] and
this.getExtension() = ["cs", "cshtml", "razor"] and
not this.isStub()
}

Expand Down

0 comments on commit da3c5f4

Please sign in to comment.