some update.
This commit is contained in:
@@ -14,14 +14,7 @@ public:
|
||||
return instance;
|
||||
}
|
||||
|
||||
void load(std::string_view path) {
|
||||
std::string error;
|
||||
database = clang::tooling::CompilationDatabase::loadFromDirectory(path, error);
|
||||
if(!database) {
|
||||
llvm::errs() << "Failed to load compilation database. " << error << "\n";
|
||||
std::terminate();
|
||||
}
|
||||
}
|
||||
void load(std::string_view path);
|
||||
|
||||
auto lookup(std::string_view path) {
|
||||
auto commands = database->getCompileCommands(path);
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
|
||||
static std::unique_ptr<ParsedAST> build(std::string_view path,
|
||||
const std::shared_ptr<CompilerInvocation>& invocation,
|
||||
const std::shared_ptr<Preamble>& preamble);
|
||||
const Preamble& preamble);
|
||||
|
||||
auto& Tokens() { return tokens.value; }
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class Server {
|
||||
std::map<std::string_view, void (*)(std::string_view)> methods;
|
||||
|
||||
public:
|
||||
int run();
|
||||
int run(int argc, char** argv);
|
||||
int exit();
|
||||
void handle_message(std::string_view message);
|
||||
|
||||
|
||||
16
include/LSP/Setting.h
Normal file
16
include/LSP/Setting.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <string_view>
|
||||
|
||||
namespace clice {
|
||||
|
||||
/// Settings for the LSP server
|
||||
struct Setting {
|
||||
/// compile_commands.json file path
|
||||
std::string compile_commands_dictionary = "/build";
|
||||
/// mode of the server: ["pipe", "socket", "index"]
|
||||
std::string mode = "pipe";
|
||||
};
|
||||
|
||||
/// global setting instance
|
||||
inline Setting setting = {};
|
||||
|
||||
} // namespace clice
|
||||
@@ -128,11 +128,11 @@ public:
|
||||
|
||||
Task(handle_type handle) : handle(handle) {}
|
||||
|
||||
~Task() {
|
||||
if(handle && !handle.done()) {
|
||||
handle.destroy();
|
||||
}
|
||||
}
|
||||
//~Task() {
|
||||
// if(handle && !handle.done()) {
|
||||
// handle.destroy();
|
||||
// }
|
||||
//}
|
||||
|
||||
void resume() { handle.resume(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user