<commit_before>#include "codemodel/dastedmodel.h"
#include "codemodel/dastedmessages.h"

#include "dlangdebughelper.h"
#include "dlangeditorutils.h"

#include <QTcpSocket>
#include <QMutex>
#include <QMutexLocker>
#include <QTimer>

#include <msgpack.hpp>

using namespace Dasted;

// Converting utils
DCodeModel::Symbol conv(const Dasted::Symbol &sym)
{
    DCodeModel::Symbol res;
    res.name = QString::fromStdString(sym.name.impl);
    res.location.filename = QString::fromStdString(sym.location.filename.impl);
    res.location.position = sym.location.cursor;
    res.type = fromChar(sym.type);
    res.subType = subTypefromChar(sym.subType);
    res.typeName = QString::fromStdString(sym.typeName.impl);
    for (const auto& p : sym.templateParameters.impl) {
        res.templateParameters += QString::fromStdString(p.impl) + QChar(' ');
    }
    res.templateParameters.remove(res.templateParameters.length() -1, 1);
    return res;
}

DastedServer::DastedServer(const QString &processName, int port, QObject *parent)
    : DlangEditor::Utils::ServerDaemon(parent, processName), m_port(port)
{
    setArguments(QStringList(arguments()) << "-p" << QString::number(port)
                 << "-d");
}

DastedServer::~DastedServer()
{

}

int DastedServer::port() const
{
    return m_port;
}

#define ENFORCE(op, exc) if (!(op)) throw std::runtime_error(exc)

// ClientPrivate<commit_msg>Fix template arguments formatting for Dasted model<commit_after>#include "codemodel/dastedmodel.h"
#include "codemodel/dastedmessages.h"

#include "dlangdebughelper.h"
#include "dlangeditorutils.h"

#include <QTcpSocket>
#include <QMutex>
#include <QMutexLocker>
#include <QTimer>

#include <msgpack.hpp>

using namespace Dasted;

// Converting utils
DCodeModel::Symbol conv(const Dasted::Symbol &sym)
{
    DCodeModel::Symbol res;
    res.name = QString::fromStdString(sym.name.impl);
    res.location.filename = QString::fromStdString(sym.location.filename.impl);
    res.location.position = sym.location.cursor;
    res.type = fromChar(sym.type);
    res.subType = subTypefromChar(sym.subType);
    res.typeName = QString::fromStdString(sym.typeName.impl);
    for (const auto& p : sym.templateParameters.impl) {
        res.templateParameters += QString::fromStdString(p.impl) + QLatin1String(", ");
    }
    res.templateParameters.remove(res.templateParameters.length() - 2, 2);
    return res;
}

DastedServer::DastedServer(const QString &processName, int port, QObject *parent)
    : DlangEditor::Utils::ServerDaemon(parent, processName), m_port(port)
{
    setArguments(QStringList(arguments()) << "-p" << QString::number(port)
                 << "-d");
}

DastedServer::~DastedServer()
{

}

int DastedServer::port() const
{
    return m_port;
}

#define ENFORCE(op, exc) if (!(op)) throw std::runtime_error(exc)

// ClientPrivate
{'fraction_non_alphanumeric': 0.145679012345679, 'fraction_numerical': 0.001763668430335097, 'mean_word_length': 4.811475409836065, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '336045', 'n_tokens_mistral': 944, 'n_tokens_neox': 941, 'n_words': 169}