Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ build/
build_*/
install/
install_*/

# Mac OS specific files
.DS_Store
22 changes: 14 additions & 8 deletions plugins/csharp/parser/src/csharpparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ bool CsharpParser::parse()
bool success = true;

std::vector<std::string> paths = _ctx.options["input"].as<std::vector<std::string>>();
if (paths.empty())
{
LOG(error) << "No input path specified for C# parser!";
return false;
}
std::string buildPath = _ctx.options["build-dir"].as<std::string>();

if (acceptProjectBuildPath(buildPath))
Expand Down Expand Up @@ -86,14 +91,11 @@ bool CsharpParser::parseProjectBuildPath(
command.append("' ");
command.append(std::to_string(_ctx.options["jobs"].as<int>()));

for (auto p : paths_)
for (const auto& inputPath : paths_)
{
if (fs::is_directory(p))
{
command.append(" '");
command.append(p);
command.append("' ");
}
command.append(" '");
command.append(inputPath);
command.append("'");
Comment thread
mcserep marked this conversation as resolved.
}

LOG(debug) << "CSharpParser command: " << command;
Expand All @@ -113,7 +115,7 @@ bool CsharpParser::parseProjectBuildPath(

while(std::getline(log_str, line, '\n'))
{
if (line[0] == '+' || line[0] == '-')
if (!line.empty() && (line[0] == '+' || line[0] == '-'))
{
addSource(line.substr(1), line[0] == '-');
if (line[0] == '+')
Expand All @@ -125,6 +127,10 @@ bool CsharpParser::parseProjectBuildPath(
countPart++;
}
}
else if (!line.empty())
{
LOG(debug) << "[CSharpParser] " << line;
}
}

ch::steady_clock::time_point after = ch::steady_clock::now();
Expand Down
1 change: 1 addition & 0 deletions plugins/csharp/parser/src_csharp/CSharpParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.14.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.14.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.14.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.20" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.20">
<PrivateAssets>all</PrivateAssets>
Expand Down
Loading
Loading