Skip to content

Commit 3af9782

Browse files
authored
Merge pull request #8 from gueorgui/master
Add Typescript support
2 parents ef32b6f + 6914d1e commit 3af9782

File tree

5 files changed

+81
-13
lines changed

5 files changed

+81
-13
lines changed

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
[![MELPA Stable](https://stable.melpa.org/packages/lsp-sonarlint-badge.svg)](https://stable.melpa.org/#/lsp-sonarlint)
55
<a href="https://www.sonarlint.org/"> <img align="right" width="120" src="./images/SonarLint_icon.svg"></a>
66

7-
8-
97
SonarLint™ is a free IDE extension that lets you fix coding issues before they exist!
108

119
Like a spell checker,it highlights Bugs and Security Vulnerabilities as you write code, with clear remediation guidance so you can fix them before the code is even committed.
@@ -64,7 +62,7 @@ the URL defined in **lsp-sonarlint-LANGUAGENAME-download-url**.
6462

6563

6664
#### Complete config example
67-
In this example, we have a multiple language project, with javascript,HTML and PHP:
65+
In this example, we have a multiple language project, with Javascript Typescript, HTML and PHP:
6866

6967
``` lisp
7068
(require 'lsp-sonarlint)
@@ -75,12 +73,14 @@ In this example, we have a multiple language project, with javascript,HTML and P
7573
(require 'lsp-sonarlint-html)
7674
(setq lsp-sonarlint-html-enabled t)
7775
78-
7976
(require 'lsp-sonarlint-javascript)
8077
(setq lsp-sonarlint-javascript-enabled t)
8178
79+
(require 'lsp-sonarlint-typescript)
80+
(setq lsp-sonarlint-typescript-enabled t)
8281
```
83-
Now we can active the lsp extension.
82+
83+
Now we can activate the lsp extension.
8484

8585
The extension will check every plugin path and ask if it is not find to download it,
8686
the default path is defined in **lsp-sonarlint-LANGUAGENAME-analyzer-path**.
@@ -118,8 +118,6 @@ This settigns are common for all the language plugins.
118118
* `lsp-sonarlint-LANGUAGE-doc-url` - Sonarsource official plugin documentation
119119
* `lsp-sonarlint-LANGUAGE-repository-url` - Plugin source code
120120

121-
122-
123121
## Data and telemetry
124122

125123
This extension collects anonymous usage data and sends it to SonarSource.
@@ -135,7 +133,6 @@ Click [here](https://github.com/SonarSource/sonarlint-vscode/blob/master/telemet
135133
* [treemacs](https://github.com/Alexander-Miller/treemacs) : Project viewer.
136134
* [lsp-treemacs](https://github.com/emacs-lsp/lsp-treemacs) : `lsp-mode` GUI controls implemented using treemacs.
137135

138-
139136
## Contributions
140137

141138
Contributions are very much welcome.

languages/javascript/lsp-sonarlint-javascript.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
(defgroup lsp-sonarlint-javascript nil
2929
"lsp-sonarlint javascript analyzer group"
3030
:group 'lsp-sonarlint
31-
:version '(lsp-sonarlint-javascript . "6.2.1"))
31+
:version '(lsp-sonarlint-javascript . "8.2.0"))
3232

3333
(defcustom lsp-sonarlint-javascript-enabled nil
3434
"Enable lsp-sonarlint-javascript plugin."
3535
:group 'lsp-sonarlint-javascript
3636
:type 'boolean)
3737

3838
(defcustom lsp-sonarlint-javascript-download-url
39-
"https://binaries.sonarsource.com/Distribution/sonar-javascript-plugin/sonar-javascript-plugin-6.2.1.12157.jar"
39+
"https://binaries.sonarsource.com/Distribution/sonar-javascript-plugin/sonar-javascript-plugin-8.2.0.16042.jar"
4040
"Javascript plugin download URL."
4141
:group 'lsp-sonarlint-javascript
4242
:type 'string)

languages/ruby/lsp-sonarlint-ruby.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
(defgroup lsp-sonarlint-ruby nil
2929
"lsp-sonarlint ruby analyzer group"
3030
:group 'lsp-sonarlint
31-
:version '(lsp-sonarlint-ruby . "1.7.0"))
31+
:version '(lsp-sonarlint-ruby . "1.8.3"))
3232

3333
(defcustom lsp-sonarlint-ruby-enabled nil
3434
"Enable lsp-sonarlint-ruby plugin."
3535
:group 'lsp-sonarlint-ruby
3636
:type 'boolean)
3737

3838
(defcustom lsp-sonarlint-ruby-download-url
39-
"https://binaries.sonarsource.com/Distribution/sonar-ruby-plugin/sonar-ruby-plugin-1.7.0.883.jar"
39+
"https://binaries.sonarsource.com/Distribution/sonar-ruby-plugin/sonar-ruby-plugin-1.8.3.2219.jar"
4040
"Ruby plugin download URL."
4141
:group 'lsp-sonarlint-ruby
4242
:type 'string)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
;;; lsp-sonarlint-typescript.el --- lsp-sonarlint typescript module -*- lexical-binding: t; -*-
2+
3+
;; Copyright (C) 2021 Gueorgui Tcherednitchenko
4+
;; Author: Gueorgui Tcherednitchenko <[email protected]>
5+
;; Keywords: languages
6+
7+
;; This program is free software; you can redistribute it and/or modify
8+
;; it under the terms of the GNU General Public License as published by
9+
;; the Free Software Foundation, either version 3 of the License, or
10+
;; (at your option) any later version.
11+
12+
;; This program is distributed in the hope that it will be useful,
13+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
;; GNU General Public License for more details.
16+
17+
;; You should have received a copy of the GNU General Public License
18+
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
19+
20+
;;; Commentary:
21+
;; Specific configuration for the sonarlint typescript plugin.
22+
23+
;; This is NOT and official Sonarlint extension.
24+
25+
26+
;;; Code:
27+
28+
(defgroup lsp-sonarlint-typescript nil
29+
"lsp-sonarlint typescript analyzer group"
30+
:group 'lsp-sonarlint
31+
:version '(lsp-sonarlint-typescript . "8.2.0"))
32+
33+
(defcustom lsp-sonarlint-typescript-enabled nil
34+
"Enable lsp-sonarlint-typescript plugin."
35+
:group 'lsp-sonarlint-typescript
36+
:type 'boolean)
37+
38+
(defcustom lsp-sonarlint-typescript-download-url
39+
"https://binaries.sonarsource.com/Distribution/sonar-javascript-plugin/sonar-javascript-plugin-8.2.0.16042.jar"
40+
"Typescript plugin download URL."
41+
:group 'lsp-sonarlint-typescript
42+
:type 'string)
43+
44+
(defcustom lsp-sonarlint-typescript-analyzer-path
45+
(concat
46+
(file-name-directory load-file-name)
47+
"sonar-typescript.jar")
48+
"Lsp-sonarlint typescript analyzer location."
49+
:group 'lsp-sonarlint-typescript
50+
:type 'file)
51+
52+
(defvar lsp-sonarlint-typescript-doc-url "https://www.sonarsource.com/ts/"
53+
"Documentation sonarsource URL.")
54+
55+
(defvar lsp-sonarlint-typescript-repository-url "https://github.com/SonarSource/SonarJS"
56+
"Official sonarlint code extension reposiroty.")
57+
58+
(provide 'lsp-sonarlint-typescript)
59+
;;; lsp-sonarlint-typescript.el ends here

lsp-sonarlint.el

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,19 @@
5252
:group 'lsp-sonarlint
5353
:type 'file)
5454

55-
(defcustom lsp-sonarlint-modes-enabled '(php-mode html-mode web-mode js-mode js2-mode python-mode java-mode ruby-mode scala-mode xml-mode nxml-mode)
55+
(defcustom lsp-sonarlint-modes-enabled '(php-mode
56+
html-mode
57+
web-mode
58+
js-mode
59+
js2-mode
60+
rjsx-mode
61+
typescript-mode
62+
typescript-tsx-mode
63+
python-mode java-mode
64+
ruby-mode
65+
scala-mode
66+
xml-mode
67+
nxml-mode)
5668
"List of enabled major modes."
5769
:group 'lsp-sonarlint
5870
:type 'file)

0 commit comments

Comments
 (0)