Page MenuHomePhabricator

[mlir:PDLL] Add better support for providing Constraint/Pattern/Rewrite documentation
ClosedPublic

Authored by rriddle on May 3 2022, 2:30 PM.

Details

Summary

This commit enables providing long-form documentation more seamlessly to the LSP
by revamping decl documentation. For ODS imported constructs, we now also import
descriptions and attach them to decls when possible. For PDLL constructs, the LSP will
now try to provide documentation by parsing the comments directly above the decls
location within the source file. This commit also adds a new parser flag
enableDocumentation that gates the import and attachment of ODS documentation,
which is unnecessary in the normal build process (i.e. it should only be used/consumed
by tools).

Diff Detail

Event Timeline

rriddle created this revision.May 3 2022, 2:30 PM
Herald added a project: Restricted Project. · View Herald Transcript
rriddle requested review of this revision.May 3 2022, 2:30 PM
rriddle updated this revision to Diff 429574.May 15 2022, 3:25 PM
rriddle edited the summary of this revision. (Show Details)
rriddle updated this revision to Diff 430291.May 18 2022, 2:19 AM
rriddle updated this revision to Diff 430851.May 19 2022, 4:38 PM
rriddle updated this revision to Diff 431755.May 24 2022, 12:23 PM
jpienaar accepted this revision.Wed, Jun 1, 6:44 PM

Nice

mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
151

OOC should we check for docstring?

This revision is now accepted and ready to land.Wed, Jun 1, 6:44 PM
rriddle marked an inline comment as done.Thu, Jun 2, 2:38 PM
rriddle added inline comments.
mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
151

I think for simplicity it's good to just use whatever comments precede the decl, which should cover any form of //, ///, etc.

rriddle marked an inline comment as done.Thu, Jun 2, 2:44 PM