PMunch / nimlsp

Language Server Protocol implementation for Nim
MIT License
418 stars 51 forks source link

Explicitly bind logging procs in templates #168

Closed metagn closed 1 year ago

metagn commented 1 year ago

The logging templates in logger reference procs like error, info, warn etc. from the logging module. These are implicitly bound, as they have exactly 1 overload in the scope of the template definitions (https://github.com/nim-lang/Nim/issues/11184).

If this behavior of Nim or the context in logger were to change, these would start preferring procs like macros.error instead and cause issues. Explicitly binding them keeps the current behavior consistent.

An alternative would be to directly call logging.error join(args) etc.