|
1 | 1 | package com.dropbox.plugins.mypy_plugin;
|
2 | 2 |
|
| 3 | +import com.dropbox.plugins.mypy_plugin.model.MypyConfig; |
3 | 4 | import com.dropbox.plugins.mypy_plugin.model.MypyError;
|
4 | 5 | import com.dropbox.plugins.mypy_plugin.model.MypyResult;
|
5 | 6 | import com.intellij.openapi.application.ApplicationManager;
|
@@ -29,24 +30,18 @@ public final class MypyRunner {
|
29 | 30 | MypyResult runMypyDaemon() {
|
30 | 31 | Process process;
|
31 | 32 | String directory = project.getBaseDir().getPath();
|
32 |
| - MypyConfigService config = MypyConfigService.getInstance(project); |
| 33 | + MypyConfig config = MypyConfigLoader.findMypyConfig(project); |
33 | 34 |
|
34 | 35 | ProcessBuilder processBuilder = new ProcessBuilder();
|
35 | 36 | Map<String, String> envProcess = processBuilder.environment();
|
36 | 37 | Map<String, String> env = System.getenv();
|
37 | 38 |
|
38 | 39 | envProcess.putAll(env);
|
39 |
| - String extraPath = config != null ? config.getPathSuffix() : null; |
40 |
| - if (extraPath == null) { // config deleted |
41 |
| - extraPath = MypyToolWindowFactory.DEFAULT_MYPY_PATH_SUFFIX; |
42 |
| - } |
| 40 | + String extraPath = config.getPathSuffix(); |
43 | 41 | if (!extraPath.equals("")) {
|
44 | 42 | envProcess.put("PATH", envProcess.get("PATH") + File.pathSeparator + extraPath);
|
45 | 43 | }
|
46 |
| - String mypyCommand = config != null ? config.getExecutableName() : null; |
47 |
| - if ((mypyCommand == null) || (mypyCommand.equals(""))) { |
48 |
| - mypyCommand = MypyToolWindowFactory.DEFAULT_MYPY_COMMAND; |
49 |
| - } |
| 44 | + String mypyCommand = config.getExecutableName(); |
50 | 45 | processBuilder.command("/bin/bash", "-c", mypyCommand);
|
51 | 46 | processBuilder.redirectErrorStream(true);
|
52 | 47 | processBuilder.redirectInput(new File("/dev/null"));
|
@@ -79,7 +74,7 @@ MypyResult runMypyDaemon() {
|
79 | 74 | noteCount++;
|
80 | 75 | }
|
81 | 76 | } else if (line.matches("PASSED") | line.matches("FAILED")) {
|
82 |
| - // these will bre shown in status line anyway |
| 77 | + // these will be shown in status line anyway |
83 | 78 | break;
|
84 | 79 | } else {
|
85 | 80 | debug.add(new MypyError(line, MypyError.DEBUG));
|
|
0 commit comments