Skip to content

Commit fe4605c

Browse files
committed
CompilationDatabaseInteface: add all_files_unique()
1 parent 60a9f90 commit fe4605c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

compdb/models.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,19 @@ def get_compile_commands(self, filepath):
6868
def get_all_files(self):
6969
"""Return an iterable of path strings.
7070
71-
A same path can be returned multiple times,
72-
store the result in a set if uniqueness is required."""
71+
It is ok to return the same path multiple times
72+
unless all_files_unique() returns True.
73+
"""
7374
raise compdb.NotImplementedError
7475

76+
def all_files_unique(self):
77+
"""Whether or not get_all_files() returns unique paths.
78+
79+
Override this if get_all_files() is guaranteed to return unique paths,
80+
this fact can be used for optimization.
81+
"""
82+
return False
83+
7584
def get_all_compile_commands(self):
7685
"""Return an iterable of CompileCommand."""
7786
raise compdb.NotImplementedError

0 commit comments

Comments
 (0)