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
22 lines
903 B
Plaintext
22 lines
903 B
Plaintext
// RUN: echo -e '--- !FileInfo:\n filepath: "/foo.td"\n includes: "%/S;%/S/../../include"' > %t.yml
|
|
// RUN: tblgen-lsp-server -tablegen-compilation-database=%t.yml -lit-test < %s | FileCheck %s
|
|
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"tablegen","capabilities":{},"trace":"off"}}
|
|
// -----
|
|
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
|
|
"uri":"test:///foo.td",
|
|
"languageId":"tablegen",
|
|
"version":1,
|
|
"text":"include \"include/included.td\""
|
|
}}}
|
|
// Check that we can properly process the includes without errors.
|
|
// CHECK: "method": "textDocument/publishDiagnostics",
|
|
// CHECK-NEXT: "params": {
|
|
// CHECK-NEXT: "diagnostics": [],
|
|
// CHECK-NEXT: "uri": "test:///foo.td",
|
|
// CHECK-NEXT: "version": 1
|
|
// CHECK-NEXT: }
|
|
// -----
|
|
{"jsonrpc":"2.0","id":7,"method":"shutdown"}
|
|
// -----
|
|
{"jsonrpc":"2.0","method":"exit"}
|