This commit adds code completion support to the language server,
and initially supports providing completions for: Member access,
attributes/constraint/dialect/operation names, and pattern metadata.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Tools/PDLL/Parser/Lexer.h | ||
---|---|---|
40 | This feels special as a token, well even more special than the other markers. Why does it need to be a Token kind? | |
mlir/lib/Tools/PDLL/Parser/Parser.cpp | ||
255 | This seems unrelated to the main change here. | |
1664 | Why an unconditional failure? | |
mlir/lib/Tools/lsp-server-support/Protocol.h | ||
671 | Is this a standard enum? Could we point to the origin? (url to doc) | |
mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp | ||
608 | You use .str() on some conversions from twine but not on others, | |
658 | Why `c++ ? | |
711 | of type ? |
mlir/lib/Tools/PDLL/Parser/Lexer.h | ||
---|---|---|
40 | It's a marker token for when we've reached a code completion location. It doesn't have to be a token, but it's more natural (and less complex) to be one. The modeling here is also kept similar to how this is done in other projects, e.g. this is how clang handles completion as well. | |
mlir/lib/Tools/PDLL/Parser/Parser.cpp | ||
255 | It's used during code completion to provide more accurate completions for the current context. | |
1664 | We just return failure from any completion point to stop parsing. Added a comment. | |
mlir/lib/Tools/lsp-server-support/Protocol.h | ||
671 | Yes, it's from the LSP specification. All of the enums/structs/etc. in this file are based on the specification (and have the same naming). The header comment contains a link to the spec (updated the link in the header given that the location of the spec has changed). | |
mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp | ||
608 | This should be fixed now. | |
658 | It provides a nicer presentation of the C++ class of the result's constraint (provides syntax highlighting). |
This feels special as a token, well even more special than the other markers. Why does it need to be a Token kind?