Files
clang-p2996/mlir/lib/Tools/tblgen-lsp-server/LSPServer.h
River Riddle 5de12bb703 [mlir][Tablegen-LSP] Add support for a basic TableGen language server
This follows the same general structure of the MLIR and PDLL language
servers. This commits adds the basic functionality for setting up the server,
and initially only supports providing diagnostics. Followon commits will
build out more comprehensive behavior.

Realistically this should eventually live in llvm/, but building in MLIR is an easier
initial step given that:
* All of the necessary LSP functionality is already here
* It allows for proving out useful language features (e.g. compilation databases)
  without affecting wider scale tablegen users
* MLIR has a vscode extension that can immediately take advantage of it

Differential Revision: https://reviews.llvm.org/D125440
2022-05-16 16:03:51 -07:00

30 lines
898 B
C++

//===- LSPServer.h - TableGen LSP Server ------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LIB_MLIR_TOOLS_TBLGENLSPSERVER_LSPSERVER_H
#define LIB_MLIR_TOOLS_TBLGENLSPSERVER_LSPSERVER_H
#include <memory>
namespace mlir {
struct LogicalResult;
namespace lsp {
class JSONTransport;
class TableGenServer;
/// Run the main loop of the LSP server using the given TableGen server and
/// transport.
LogicalResult runTableGenLSPServer(TableGenServer &server,
JSONTransport &transport);
} // namespace lsp
} // namespace mlir
#endif // LIB_MLIR_TOOLS_TBLGENLSPSERVER_LSPSERVER_H