zls icon indicating copy to clipboard operation
zls copied to clipboard

Don't show inlay hints in "zig fmt off" areas

Open vadim-za opened this issue 11 months ago • 1 comments

Usually the reason to use zig fmt: off is that one wants the text to preserve the exact formatting given by the author. Inlay hints are quite disruptive in such cases and probably should be automatically turned off in the same areas as well. There could be an independent option zls inlay-hints: off but that's probably redundant.

vadim-za avatar Feb 08 '25 07:02 vadim-za

This smacks of magic to me. zig fmt: off means one thing: don't format the region of code. For anyone whose intuitions perfectly align with yours, the mysterious failure of type inlays to appear within that region would be a blessing. For everyone else, a bug.

My workflow involves frequent toggling of inlay hints, I would be most aggravated if this were to mysteriously fail for any reason. Especially if the root cause was something like this.

mnemnion avatar May 23 '25 19:05 mnemnion