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) ...@@ -150,16 +150,34 @@ static QJsonObject merge(const QJsonObject &bottom, const QJsonObject &top)
// map (highlight)mode to lsp languageId // map (highlight)mode to lsp languageId
static QString languageId(const QString &mode) static QString languageId(const QString &mode)
{ {
// special cases // lookup in cache first
static QHash<QString, QString> m; static QHash<QString, QString> m;
auto it = m.find(mode); auto it = m.find(mode);
if (it != m.end()) { if (it != m.end()) {
return *it; return *it;
} }
// assume sane naming
/**
* try to normalize the highlighting name
* - lower-case
* - transform some special characters
*/
QString result = mode.toLower(); QString result = mode.toLower();
result = result.replace(QStringLiteral("++"), QStringLiteral("pp")); 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 // helper guard to handle revision (un)lock
......
...@@ -15,6 +15,11 @@ ...@@ -15,6 +15,11 @@
"command": ["dls", "--stdio"], "command": ["dls", "--stdio"],
"url": "https://github.com/d-language-server/dls" "url": "https://github.com/d-language-server/dls"
}, },
"fortran": {
"command": ["fortls"],
"rootIndicationFileNames": [".fortls"],
"url": "https://github.com/hansec/fortran-language-server"
},
"latex": { "latex": {
"command": ["texlab"], "command": ["texlab"],
"url": "https://texlab.netlify.com/" "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