Skip to content

Commit 8a10c39

Browse files
committed
Refactor: factor constant into a variable
1 parent 436b811 commit 8a10c39

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/quick-lint-js/diagnostic.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ enum class diagnostic_arg_type : std::uint8_t {
4141
variable_kind,
4242
};
4343

44+
// If we support more than two infos (i.e. more than one note), the VS Code
45+
// plugin needs to be updated. See NOTE(multiple notes).
46+
constexpr int diagnostic_max_message_count = 2;
47+
4448
struct diagnostic_message_arg_info {
4549
// offset_shift is how many bits are removed in compact_offset.
4650
//
@@ -83,9 +87,7 @@ struct diagnostic_info {
8387

8488
std::uint16_t code : 14;
8589
diagnostic_severity severity : 2 QLJS_WORK_AROUND_GCC_BUG_105191;
86-
// If we support more than two infos (i.e. more than one note), the VS Code
87-
// plugin needs to be updated. See NOTE(multiple notes).
88-
diagnostic_message_info messages[2];
90+
diagnostic_message_info messages[diagnostic_max_message_count];
8991
};
9092

9193
const diagnostic_info &get_diagnostic_info(error_type) noexcept;

0 commit comments

Comments
 (0)