|
1 | | -package org.netbeans.modules.python; |
2 | | - |
3 | | -/** |
4 | | - * |
5 | | - */ |
6 | | -import java.io.IOException; |
7 | | -import org.netbeans.api.editor.mimelookup.MimeRegistration; |
8 | | -import org.netbeans.modules.lsp.client.spi.LanguageServerProvider; |
9 | | -import org.openide.util.Exceptions; |
10 | | -import org.openide.util.Lookup; |
11 | | - |
12 | | -@MimeRegistration(mimeType = PythonUtility.PYTHON_MIME_TYPE, |
13 | | - service = LanguageServerProvider.class) |
14 | | -public class PythonLspClient implements LanguageServerProvider { |
15 | | - |
16 | | - @Override |
17 | | - public LanguageServerDescription startServer(Lookup lkp) { |
18 | | - try { |
19 | | - Process p = new ProcessBuilder( |
20 | | - PythonUtility.getLspPythonExe(), |
21 | | - "-m", |
22 | | - "pylsp", |
23 | | - "--log-file", |
24 | | - PythonUtility.PYLSP_VENV_DIR.toPath().resolve("lsp_log_file").toString() |
25 | | - //, |
26 | | - //"-v" |
27 | | - ) |
28 | | - .redirectError(ProcessBuilder.Redirect.INHERIT) |
29 | | - .start(); |
30 | | - return LanguageServerDescription.create(p.getInputStream(), |
31 | | - p.getOutputStream(), p |
32 | | - ); |
33 | | - } catch (IOException ex) { |
34 | | - Exceptions.printStackTrace(ex); |
35 | | - return null; |
36 | | - } |
37 | | - } |
38 | | - |
39 | | -} |
| 1 | +package org.netbeans.modules.python; |
| 2 | + |
| 3 | +/** |
| 4 | + * |
| 5 | + */ |
| 6 | +import java.io.IOException; |
| 7 | +import org.netbeans.api.editor.mimelookup.MimeRegistration; |
| 8 | +import org.netbeans.modules.lsp.client.spi.LanguageServerProvider; |
| 9 | +import org.openide.util.Exceptions; |
| 10 | +import org.openide.util.Lookup; |
| 11 | + |
| 12 | +@MimeRegistration(mimeType = PythonUtility.PYTHON_MIME_TYPE, |
| 13 | + service = LanguageServerProvider.class) |
| 14 | +public class PythonLspClient implements LanguageServerProvider { |
| 15 | + |
| 16 | + @Override |
| 17 | + public LanguageServerDescription startServer(Lookup lkp) { |
| 18 | + try { |
| 19 | + Process p = new ProcessBuilder( |
| 20 | + PythonUtility.getLspPythonExe(), |
| 21 | + "-m", |
| 22 | + "pylsp", |
| 23 | + "--verbose", |
| 24 | + "--log-file", |
| 25 | + PythonUtility.PYLSP_VENV_DIR.toPath().resolve("lsp_log_file").toString() |
| 26 | + //, |
| 27 | + //"-v" |
| 28 | + ) |
| 29 | + .redirectError(ProcessBuilder.Redirect.INHERIT) |
| 30 | + .start(); |
| 31 | + return LanguageServerDescription.create(p.getInputStream(), |
| 32 | + p.getOutputStream(), p |
| 33 | + ); |
| 34 | + } catch (IOException ex) { |
| 35 | + Exceptions.printStackTrace(ex); |
| 36 | + return null; |
| 37 | + } |
| 38 | + } |
| 39 | + |
| 40 | +} |
0 commit comments