Debian Codegraph @

LanguageServer/LSPCTagsdDetector.cpp

raw
1 #include "LSPCTagsdDetector.hpp"
2
3 #include "cl_standard_paths.h"
4 #include "file_logger.h"
5 #include "globals.h"
6
7 #include <wx/filename.h>
8
9 LSPCTagsdDetector::LSPCTagsdDetector()
10 : LSPDetector("ctagsd")
11 {
12 }
13
14 LSPCTagsdDetector::~LSPCTagsdDetector() {}
15
16 bool LSPCTagsdDetector::DoLocate()
17 {
18 wxFileName ctagsd(clStandardPaths::Get().GetBinaryFullPath("ctagsd"));
19 if(ctagsd.FileExists()) {
20 ConfigureFile(ctagsd);
21 return true;
22 }
23 return false;
24 }
25
26 void LSPCTagsdDetector::ConfigureFile(const wxFileName& ctagsd_exe)
27 {
28 clDEBUG() << "==> Found" << ctagsd_exe << endl;
29 wxString command;
30 command << ctagsd_exe.GetFullPath();
31 ::WrapWithQuotes(command);
32
33 command << " --port 45634 --log-level ERR";
34 SetCommand(command);
35 // Add support for the languages
36 GetLangugaes().Add("c");
37 GetLangugaes().Add("cpp");
38 SetConnectionString("tcp://127.0.0.1:45634");
39 SetPriority(50); // clangd takes precedence over ctagsd
40 SetEnabled(false); // for now, disable it
41 }