| 1 |
#include "LSPRustAnalyzerDetector.hpp" |
| 2 |
|
| 3 |
#include "Platform.hpp" |
| 4 |
#include "asyncprocess.h" |
| 5 |
#include "clRustup.hpp" |
| 6 |
#include "file_logger.h" |
| 7 |
#include "globals.h" |
| 8 |
#include "macros.h" |
| 9 |
|
| 10 |
#include <wx/tokenzr.h> |
| 11 |
|
| 12 |
LSPRustAnalyzerDetector::LSPRustAnalyzerDetector() |
| 13 |
: LSPDetector("rust-analyzer") |
| 14 |
{ |
| 15 |
} |
| 16 |
|
| 17 |
LSPRustAnalyzerDetector::~LSPRustAnalyzerDetector() {} |
| 18 |
|
| 19 |
bool LSPRustAnalyzerDetector::DoLocate() |
| 20 |
{ |
| 21 |
wxString analyzer_path; |
| 22 |
if(!ThePlatform->Which("rust-analyzer", &analyzer_path)) { |
| 23 |
return false; |
| 24 |
} |
| 25 |
|
| 26 |
// we check for the binary in both |
| 27 |
wxString command; |
| 28 |
command << analyzer_path; |
| 29 |
::WrapWithQuotes(command); |
| 30 |
SetCommand(command); |
| 31 |
|
| 32 |
// Add support for the languages |
| 33 |
GetLangugaes().Add("rust"); |
| 34 |
SetConnectionString("stdio"); |
| 35 |
SetPriority(100); // Give it a higher priority over the rls |
| 36 |
return true; |
| 37 |
} |