mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #13274 from ethereum/lsp-fix-include-path
lsp: Fixes initialization phase if `include-paths` was not set at all then also no error should be generated.
This commit is contained in:
commit
ed039abb97
@ -149,25 +149,28 @@ void LanguageServer::changeConfiguration(Json::Value const& _settings)
|
|||||||
{
|
{
|
||||||
m_settingsObject = _settings;
|
m_settingsObject = _settings;
|
||||||
Json::Value jsonIncludePaths = _settings["include-paths"];
|
Json::Value jsonIncludePaths = _settings["include-paths"];
|
||||||
int typeFailureCount = 0;
|
|
||||||
|
|
||||||
if (jsonIncludePaths && jsonIncludePaths.isArray())
|
if (jsonIncludePaths)
|
||||||
{
|
{
|
||||||
vector<boost::filesystem::path> includePaths;
|
int typeFailureCount = 0;
|
||||||
for (Json::Value const& jsonPath: jsonIncludePaths)
|
if (jsonIncludePaths.isArray())
|
||||||
{
|
{
|
||||||
if (jsonPath.isString())
|
vector<boost::filesystem::path> includePaths;
|
||||||
includePaths.emplace_back(boost::filesystem::path(jsonPath.asString()));
|
for (Json::Value const& jsonPath: jsonIncludePaths)
|
||||||
else
|
{
|
||||||
typeFailureCount++;
|
if (jsonPath.isString())
|
||||||
|
includePaths.emplace_back(boost::filesystem::path(jsonPath.asString()));
|
||||||
|
else
|
||||||
|
typeFailureCount++;
|
||||||
|
}
|
||||||
|
m_fileRepository.setIncludePaths(move(includePaths));
|
||||||
}
|
}
|
||||||
m_fileRepository.setIncludePaths(move(includePaths));
|
else
|
||||||
}
|
++typeFailureCount;
|
||||||
else
|
|
||||||
++typeFailureCount;
|
|
||||||
|
|
||||||
if (typeFailureCount)
|
if (typeFailureCount)
|
||||||
m_client.trace("Invalid JSON configuration passed. \"include-paths\" must be an array of strings.");
|
m_client.trace("Invalid JSON configuration passed. \"include-paths\" must be an array of strings.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LanguageServer::compile()
|
void LanguageServer::compile()
|
||||||
|
Loading…
Reference in New Issue
Block a user