Skip to content

Commit

Permalink
Merge pull request #17439 from tamasvajk/feature/include-razor-files-…
Browse files Browse the repository at this point in the history
…in-fromSource

C#: Include `.razor` files in `File::fromSource`
  • Loading branch information
tamasvajk authored Sep 12, 2024
2 parents a4c1ec7 + da3c5f4 commit 9250c29
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 9250c29

Please sign in to comment.