Prototype Assembly support for Clangd

Hi all, I work on the Linux kernel for PowerPC, which uses a fair number of Assembly files. These files also make liberal use of the C preprocessor (#ifdef regions, #define’d macros, etc.) that behave very differently depending on the particular build configuration, so it can be quite challenging to understand what the files are doing.

Therefore I prototyped extending Clangd to support Assembly files as well. You can find the work in my fork below. It supports the normal C preprocessor features (disabled regions, macro spelling) and has basic support for instruction syntax highlighting. It also has specific support for PowerPC instruction documentation, which helps out when you aren’t familiar with all the instructions in the ISA.

To use, make sure your client editor is sending Assembly files to the server.

I hope there is interest in getting a refined implemention upstreamed into Clangd proper. The current patches are a bit hacky, but I think it shows there is good potential.

Example screenshots:

1 Like

And another screenshot:

Last screenshot

Very cool!

You may want to start a Github discussion about this for greater visibility.