This is an archive of the discontinued LLVM Phabricator instance.

[mlir][PDLL] Add document link and hover support to mlir-pdll-lsp-server
ClosedPublic

Authored by rriddle on Apr 20 2022, 2:18 AM.

Details

Summary

This allows for navigating to included files on click, and also provides hover
information about the include file (similarly to clangd).

Diff Detail

Event Timeline

rriddle created this revision.Apr 20 2022, 2:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2022, 2:18 AM
rriddle requested review of this revision.Apr 20 2022, 2:18 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 20 2022, 2:18 AM
jpienaar accepted this revision.Apr 20 2022, 2:23 PM
jpienaar added inline comments.
mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
504

OOC does this enable linkage? Or would one need to write this in markdown formatting?

mlir/test/mlir-pdll-lsp-server/include/included.td
1 ↗(On Diff #423849)

Are the empty new lines at top on purpose? File heading missing?

This revision is now accepted and ready to land.Apr 20 2022, 2:23 PM
rriddle updated this revision to Diff 424288.Apr 21 2022, 2:04 PM
rriddle edited the summary of this revision. (Show Details)
rriddle marked 2 inline comments as done.
rriddle added inline comments.Apr 21 2022, 2:04 PM
mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
504

The documentLink automatically has linkage, that is what gets you the ctrl+click behavior. The hover here is just additional information about the include. I just modeled the info in the hover after what clangd provides.

mlir/test/mlir-pdll-lsp-server/include/included.td
1 ↗(On Diff #423849)

Dropped the newlines at the top. I didn't add a file heading because no other tests I could find have them, and these files are not tested directly (thus no RUN lines), they are only used when testing other files.

This revision was landed with ongoing or failed builds.Apr 26 2022, 6:34 PM
This revision was automatically updated to reflect the committed changes.