summaryrefslogtreecommitdiff
path: root/mlir/lib/Tools/lsp-server-support/CompilationDatabase.cpp
AgeCommit message (Collapse)Author
2025-09-11[LLVM][MLIR] Move LSP server support library from MLIR into LLVM (#157885)Bertik23
This is a second PR on this patch (first #155572), that fixes the linking problem for `flang-aarch64-dylib` test. The SupportLSP library was made a component library. --- This PR moves the generic Language Server Protocol (LSP) server support code that was copied from clangd into MLIR, into the LLVM tree so it can be reused by multiple subprojects. Centralizing the generic LSP support in LLVM lowers the barrier to building new LSP servers across the LLVM ecosystem and avoids each subproject maintaining its own copy. The code originated in clangd and was copied into MLIR for its LSP server. MLIR had this code seperate to be reused by all of their LSP server. This PR relocates the MLIR copy into LLVM as a shared component into LLVM/Support. If this is not a suitable place, please suggest a better one. A follow up to this move could be deduplication with the original clangd implementation and converge on a single shared LSP support library used by clangd, MLIR, and future servers. What changes mlir/include/mlir/Tools/lsp-server-support/{Logging, Protocol, Transport}.h moved to llvm/include/llvm/Support/LSP mlir/lib/Tools/lsp-server-support/{Logging, Protocol, Transport}.cpp moved to llvm/lib/Support/LSP and their namespace was changed from mlir to llvm I ran clang-tidy --fix and clang-format on the whole moved files (last two commits), as they are basically new files and should hold up to the code style used by LLVM. MLIR LSP servers where updated to include these files from their new location and account for the namespace change. This PR is made as part of the LLVM IR LSP project ([RFC](https://discourse.llvm.org/t/rfc-ir-visualization-with-vs-code-extension-using-an-lsp-server/87773))
2025-09-09Revert "[LLVM][MLIR] Move LSP server support library from MLIR into LLVM ↵Nikita Popov
(#155572)" This reverts commit c0aee322f7024250fd4a2c49f56534011178d07c. This reverts commit a0b8d548fd250c92c8f9274b57e38ad3f0b215e9. Fails to link with MLIR dylib build.
2025-09-09[LLVM][MLIR] Move LSP server support library from MLIR into LLVM (#155572)Bertik23
This PR moves the generic Language Server Protocol (LSP) server support code that was copied from clangd into MLIR, into the LLVM tree so it can be reused by multiple subprojects. Centralizing the generic LSP support in LLVM lowers the barrier to building new LSP servers across the LLVM ecosystem and avoids each subproject maintaining its own copy. The code originated in clangd and was copied into MLIR for its LSP server. MLIR had this code seperate to be reused by all of their LSP server. This PR relocates the MLIR copy into LLVM as a shared component into `LLVM/Support`. If this is not a suitable place, please suggest a better one. A follow up to this move could be deduplication with the original clangd implementation and converge on a single shared LSP support library used by clangd, MLIR, and future servers. ### What changes * `mlir/include/mlir/Tools/lsp-server-support/{Logging, Protocol, Transport}.h` moved to `llvm/include/llvm/Support/LSP` * `mlir/lib/Tools/lsp-server-support/{Logging, Protocol, Transport}.cpp` moved to `llvm/lib/Support/LSP` and their namespace was changed from `mlir` to `llvm` I ran clang-tidy --fix and clang-format on the whole moved files (last two commits), as they are basically new files and should hold up to the code style used by LLVM. MLIR LSP servers where updated to include these files from their new location and account for the namespace change. This PR is made as part of the LLVM IR LSP project ([RFC](https://discourse.llvm.org/t/rfc-ir-visualization-with-vs-code-extension-using-an-lsp-server/87773))
2025-03-29[mlir] Use SetVector::insert_range (NFC) (#133595)Kazu Hirata
2023-01-27[mlir][NFC] Move the headers for lsp-server-support to include/River Riddle
This makes it a bit easier to share the functionality for building language servers, and makes the API public. No real functional change, as the API was already intended for this anyways. Differential Revision: https://reviews.llvm.org/D142790
2022-05-30[mlir:PDLL-LSP] Add a custom LSP command for viewing the output of PDLLRiver Riddle
This commit adds a new PDLL specific LSP command, pdll.viewOutput, that allows for viewing the intermediate outputs of a given PDLL file. The available intermediate forms currently mirror those in mlir-pdll, namely: AST, MLIR, CPP. This is extremely useful for a developer of PDLL, as it simplifies various testing, and is also quite useful for users as they can easily view what is actually being generated for their PDLL files. This new command is added to the vscode client, and is available in the right client context menu of PDLL files, or via the vscode command palette. Differential Revision: https://reviews.llvm.org/D124783
2022-05-27[mlir][Tablegen-LSP] Add support for a compilation databaseRiver Riddle
This provides a format for externally specifying the include directories for a source file. The format of the tablegen database is exactly the same as that for PDLL, namely it includes the absolute source file name and the set of include directories. The database format is shared to simplify the infra, and also because the format itself is general enough to share. Even if we desire to expand in the future to contain the actual compilation command, nothing there is specific enough that we would need two different formats. As with PDLL, support for generating the database is added to our mlir_tablegen cmake command. Differential Revision: https://reviews.llvm.org/D125441