From f69b79b0c8408e703fdc4e2157953772fd47348a Mon Sep 17 00:00:00 2001 From: Steven Remot Date: Mon, 6 Sep 2021 18:14:08 +0200 Subject: [PATCH] Allow connecting to a remote Sonarqube / Sonarcloud instance --- lsp-sonarlint.el | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/lsp-sonarlint.el b/lsp-sonarlint.el index 07807d5..6c993a6 100644 --- a/lsp-sonarlint.el +++ b/lsp-sonarlint.el @@ -83,7 +83,41 @@ Example: `{**/test/**,**/*test*,**/*Test*}`" :group 'lsp-sonarlint :type 'string) -(defcustom lsp-sonarlint-sonarqube-server-url "" +(defcustom lsp-sonarlint-connections-sonarqube [] + "Connections to sonarqube instances. + +Ex: +\(setq lsp-sonarlint-connections-sonarqube '[((serverUrl . \"https://...\") (token . \"my-token\"))]\)" + :group 'lsp-sonarlint + :type '(vector (alist :key-type symbol :value-type string))) + +(defcustom lsp-sonarlint-connections-sonarcloud [] + "Connections to sonarcloud instances. + +Ex: +\(setq lsp-sonarlint-connections-sonarqube '[((connectionId . \"my-connection\") (organizationKey . \"my-organization-key\") (token . \"my-token\"))]\)" + :group 'lsp-sonarlint + :type '(vector (alist :key-type symbol :value-type string))) + +(defcustom lsp-sonarlint-servers [] + :group 'lsp-sonarlint + :type '(vector (alist :key-type symbol :value-type string))) + +(defcustom lsp-sonarlint-project '() + "Sonar project configuration. + +Ex: +\(setq lsp-sonarlint-project '((projectKey . \"my-project\"))\)" + :group 'lsp-sonarlint + :type '(alist :key-type symbol :value-type string)) + +(defcustom lsp-sonarlint-sonarqube-server-token "" + "URL of the server. +e.g https://" + :group 'lsp-sonarlint + :type 'string) + +(defcustom lsp-sonarlint-project-key "" "URL of the server. e.g https://" :group 'lsp-sonarlint @@ -163,7 +197,11 @@ analyzer" '(("sonarlint.disableTelemetry" lsp-sonarlint-disable-telemetry) ("sonarlint.testFilePattern" lsp-sonarlint-test-file-pattern) ("sonarlint.output.showAnalyzerLogs" lsp-sonarlint-show-analyzer-logs) - ("sonarlint.ls.vmargs" lsp-sonarlint-vmargs))) + ("sonarlint.ls.vmargs" lsp-sonarlint-vmargs) + ("sonarlint.connectedMode.servers" lsp-sonarlint-servers) + ("sonarlint.connectedMode.connections.sonarqube" lsp-sonarlint-connections-sonarqube) + ("sonarlint.connectedMode.connections.sonarcloud" lsp-sonarlint-connections-sonarcloud) + ("sonarlint.connectedMode.project" lsp-sonarlint-project))) (lsp-register-client (make-lsp-client