Skip to content

Commit

Permalink
[html] Fix static HTML report files
Browse files Browse the repository at this point in the history
Previously `id` attribute was not set for source files when generated static
HTML report files for example with the `CodeChecker parse` command.
The JavaScript part used this attributes but it was always `undefined`.
This way if a user opened a report which bug step referenced mulitple different
source files, changing between the bug steps didn't change the source file.
  • Loading branch information
csordasmarton committed Jan 6, 2022
1 parent 8ddb9bd commit 9788918
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class HTMLReport(TypedDict):


class FileSource(TypedDict):
id: str
filePath: str
content: str

Expand Down Expand Up @@ -170,7 +171,7 @@ def _add_source_file(self, file: File) -> FileSource:
file_content = InvalidFileContentMsg

self.files[file.id] = {
'filePath': file.path, 'content': file_content}
'id': file.id, 'filePath': file.path, 'content': file_content}

return self.files[file.id]

Expand Down

0 comments on commit 9788918

Please sign in to comment.