|
72 | 72 | (warn (concat "The javascript-typescript-langserver (jsts-ls) is unmaintained; " |
73 | 73 | "it is recommended to use ts-ls or deno-ls instead."))))) |
74 | 74 |
|
| 75 | + |
| 76 | + |
75 | 77 | (defgroup lsp-typescript nil |
76 | 78 | "LSP support for TypeScript, using Theia/Typefox's TypeScript Language Server." |
77 | 79 | :group 'lsp-mode |
@@ -881,6 +883,7 @@ to run the command in." |
881 | 883 | error-callback) |
882 | 884 | error-callback)))) |
883 | 885 |
|
| 886 | + |
884 | 887 |
|
885 | 888 | (defgroup lsp-flow nil |
886 | 889 | "LSP support for the Flow Javascript type checker." |
@@ -956,6 +959,8 @@ particular FILE-NAME and MODE." |
956 | 959 | :activation-fn 'lsp-clients-flow-activate-p |
957 | 960 | :server-id 'flow-ls)) |
958 | 961 |
|
| 962 | + |
| 963 | + |
959 | 964 | (defgroup lsp-deno nil |
960 | 965 | "LSP support for the Deno language server." |
961 | 966 | :group 'lsp-mode |
@@ -1061,6 +1066,47 @@ Examples: `./import-map.json', |
1061 | 1066 | :activation-fn #'lsp-typescript-javascript-tsx-jsx-activate-p |
1062 | 1067 | :server-id 'deno-ls)) |
1063 | 1068 |
|
| 1069 | + |
| 1070 | + |
| 1071 | +(defgroup lsp-tsgo nil |
| 1072 | + "LSP support for the TypeScript (Go native) language server." |
| 1073 | + :group 'lsp-mode |
| 1074 | + :link '(url-link "https://github.com/microsoft/typescript-go")) |
| 1075 | + |
| 1076 | +(defcustom lsp-clients-tsgo-path "tsgo" |
| 1077 | + "Path to the tsgo binary." |
| 1078 | + :group 'lsp-tsgo |
| 1079 | + :risky t |
| 1080 | + :type 'string) |
| 1081 | + |
| 1082 | +(defcustom lsp-clients-tsgo-args '("--lsp" "--stdio") |
| 1083 | + "Extra arguments for the tsgo language server." |
| 1084 | + :group 'lsp-tsgo |
| 1085 | + :risky t |
| 1086 | + :type '(repeat string)) |
| 1087 | + |
| 1088 | +(lsp-dependency 'tsgo |
| 1089 | + '(:system lsp-clients-tsgo-path) |
| 1090 | + '(:npm :package "@typescript/native-preview" |
| 1091 | + :path "tsgo")) |
| 1092 | + |
| 1093 | +(lsp-register-client |
| 1094 | + (make-lsp-client :new-connection (lsp-stdio-connection (lambda () |
| 1095 | + `(,(lsp-package-path 'tsgo) |
| 1096 | + ,@lsp-clients-tsgo-args))) |
| 1097 | + :activation-fn 'lsp-typescript-javascript-tsx-jsx-activate-p |
| 1098 | + :priority -4 |
| 1099 | + :completion-in-comments? t |
| 1100 | + :initialized-fn (lambda (_workspace)) |
| 1101 | + :server-id 'tsgo |
| 1102 | + :download-server-fn (lambda (_client callback error-callback _update?) |
| 1103 | + (lsp-package-ensure |
| 1104 | + 'tsgo |
| 1105 | + callback |
| 1106 | + error-callback)))) |
| 1107 | + |
| 1108 | + |
| 1109 | + |
1064 | 1110 | (lsp-consistency-check lsp-javascript) |
1065 | 1111 |
|
1066 | 1112 | (provide 'lsp-javascript) |
|
0 commit comments