[mlir] Add hover support to mlir-lsp-server
authorRiver Riddle <riddleriver@gmail.com>
Sat, 8 May 2021 00:55:52 +0000 (17:55 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Sat, 8 May 2021 01:09:01 +0000 (18:09 -0700)
commit5c84195b8ccb0c1352cd040a01b7b56374dd7ba6
treea42e53267f9b26e8a2f37e1e97a307ae60345639
parentddff81f6925655ac82fc70ebeb6edc511a62b3b5
[mlir] Add hover support to mlir-lsp-server

This provides information when the user hovers over a part of the source .mlir file. This revision adds the following hover behavior:
* Operation:
  - Shows the generic form.
* Operation Result:
  - Shows the parent operation name, result number(s), and type(s).
* Block:
  - Shows the parent operation name, block number, predecessors, and successors.
* Block Argument:
  - Shows the parent operation name, parent block, argument number, and type.

Differential Revision: https://reviews.llvm.org/D101113
mlir/docs/Tools/MLIRLSP.md
mlir/include/mlir/Parser/AsmParserState.h
mlir/lib/Parser/AsmParserState.cpp
mlir/lib/Tools/mlir-lsp-server/LSPServer.cpp
mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
mlir/lib/Tools/mlir-lsp-server/MLIRServer.h
mlir/lib/Tools/mlir-lsp-server/lsp/Protocol.cpp
mlir/lib/Tools/mlir-lsp-server/lsp/Protocol.h
mlir/test/mlir-lsp-server/hover.test [new file with mode: 0644]
mlir/test/mlir-lsp-server/initialize-params.test