forked from qt-creator/qt-creator
SilverSearcher: Fix finding the tool
The documentation tells the user to adapt the PATH in the Preferences >
Environment > System. Setting that as the environment got lost in
9a0285ba0e
Fixes: QTCREATORBUG-32335
Change-Id: I3e06fe6a5195b5571e723c0e58cb81c592bf1082
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -9,8 +9,9 @@
|
||||
#include <texteditor/findinfiles.h>
|
||||
|
||||
#include <utils/async.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/qtcsettings.h>
|
||||
|
||||
#include <QHBoxLayout>
|
||||
@@ -50,6 +51,7 @@ static bool isSilverSearcherAvailable()
|
||||
{
|
||||
Process silverSearcherProcess;
|
||||
silverSearcherProcess.setCommand({"ag", {"--version"}});
|
||||
silverSearcherProcess.setEnvironment(Environment::systemEnvironment());
|
||||
silverSearcherProcess.start();
|
||||
using namespace std::chrono_literals;
|
||||
return silverSearcherProcess.waitForFinished(1s)
|
||||
@@ -88,6 +90,7 @@ static void runSilverSeacher(QPromise<SearchResultItems> &promise,
|
||||
|
||||
arguments << "--" << parameters.text << parameters.searchDir.normalizedPathName().toString();
|
||||
process.setCommand({"ag", arguments});
|
||||
process.setEnvironment(Environment::systemEnvironment());
|
||||
};
|
||||
|
||||
FilePath lastFilePath;
|
||||
|
Reference in New Issue
Block a user