Page MenuHomePhabricator

[clangd] Show hex value of numeric constants
ClosedPublic

Authored by sammccall on Mon, Feb 22, 2:06 PM.

Details

Summary

Don't show negative numbers
Don't show numbers <10 (hex is the same as decimal)
Show numeric enum values in hex too

Diff Detail

Event Timeline

sammccall created this revision.Mon, Feb 22, 2:06 PM
sammccall requested review of this revision.Mon, Feb 22, 2:06 PM
kadircet accepted this revision.Tue, Feb 23, 2:03 AM

thanks, lgtm!

should we also have some tests for a negative value in hover?

clang-tools-extra/clangd/Hover.cpp
398–400

are we okay with printing negatives as hex in here? as in theory one can have

enum {
  foo = -1,
}
This revision is now accepted and ready to land.Tue, Feb 23, 2:03 AM
sammccall updated this revision to Diff 325807.Tue, Feb 23, 8:55 AM

Add tests
Print negative values too, sign-extended to 32/64 bits

kadircet accepted this revision.Wed, Feb 24, 9:56 AM

still lgtm

This revision was automatically updated to reflect the committed changes.