Commit 7846a5a5 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

initial support for Fortran LSP server

parent f30feb70
......@@ -150,16 +150,34 @@ static QJsonObject merge(const QJsonObject &bottom, const QJsonObject &top)
// map (highlight)mode to lsp languageId
static QString languageId(const QString &mode)
{
// special cases
// lookup in cache first
static QHash<QString, QString> m;
auto it = m.find(mode);
if (it != m.end()) {
return *it;
}
// assume sane naming
/**
* try to normalize the highlighting name
* - lower-case
* - transform some special characters
*/
QString result = mode.toLower();
result = result.replace(QStringLiteral("++"), QStringLiteral("pp"));
return result.replace(QStringLiteral("#"), QStringLiteral("sharp"));
result = result.replace(QStringLiteral("#"), QStringLiteral("sharp"));
/**
* we still need to take care of some languages that have "very" different names than the normalized lsp names
*/
if (result.contains(QLatin1String("fortran"))) {
result = QStringLiteral("fortran");
}
/**
* now, cache the resulting mapping and be done
*/
m[mode] = result;
return result;
}
// helper guard to handle revision (un)lock
......
......@@ -15,6 +15,11 @@
"command": ["dls", "--stdio"],
"url": "https://github.com/d-language-server/dls"
},
"fortran": {
"command": ["fortls"],
"rootIndicationFileNames": [".fortls"],
"url": "https://github.com/hansec/fortran-language-server"
},
"latex": {
"command": ["texlab"],
"url": "https://texlab.netlify.com/"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment