Skip to content

Commit c3058f4

Browse files
authored
Merge pull request github#5749 from tamasvajk/feature/fix-fromsource
C#: Adjust 'fromSource' to hold only on files passed to the compiler as a source file
2 parents 6f2103f + ed42c87 commit c3058f4

File tree

1 file changed

+1
-1
lines changed
  • csharp/ql/src/semmle/code/csharp

1 file changed

+1
-1
lines changed

csharp/ql/src/semmle/code/csharp/File.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class File extends Container, @file {
192192
override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }
193193

194194
/** Holds if this file contains source code. */
195-
predicate fromSource() { this.getNumberOfLinesOfCode() > 0 }
195+
predicate fromSource() { files(this, _, _, "cs", _) }
196196

197197
/** Holds if this file is a library. */
198198
predicate fromLibrary() {

0 commit comments

Comments
 (0)