Skip to content

Commit 49aa462

Browse files
danrrJohnNilsson
authored andcommitted
Autodetect JetBrains IDEs (#2754)
Autodetect PyCharm (Pro and CE), WebStorm, PhpStorm, IntelliJ IDEA, RubyMine, CLion, and AppCode Added IntelliJ IDEA, RubyMine, CLion, and AppCode to list of IDEs. It has the same signature as WebStorm and PhpStorm `<editor> <projectPath> --line <number> <filePath>` so it can reuse the logic from those. Removed older integrations of AppCode, IntelliJ IDEA https://www.jetbrains.com/help/idea/opening-files-from-command-line.html https://www.jetbrains.com/help/pycharm/opening-files-from-command-line.html https://www.jetbrains.com/help/phpstorm/opening-files-from-command-line.html https://www.jetbrains.com/help/ruby/opening-files-from-command-line.html https://www.jetbrains.com/help/webstorm/opening-files-from-command-line.html Tested with Appcode 2017.1.3, CLion 2017.1.3, Intellij Idea 2017.1.5, PhpStorm 2017.1.4, PyCharm (Pro and CE) 2017.1.4, RubyMine 2017.1.5, and WebStorm 2017.1.4 on MacOS 10.12 Tested with 64-bit CLion 2017.1.3, Intellij Idea 2017.1.5, PhpStorm 2017.1.4, PyCharm (Pro and CE) 2017.1.4, RubyMine 2017.1.5, and WebStorm 2017.1.4 on a Windows 10 VM Relates to #2636
1 parent d81142e commit 49aa462

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

packages/react-dev-utils/launchEditor.js

+37-4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ const COMMON_EDITORS_OSX = {
3838
'/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2':
3939
'/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',
4040
'/Applications/Visual Studio Code.app/Contents/MacOS/Electron': 'code',
41+
'/Applications/AppCode.app/Contents/MacOS/appcode':
42+
'/Applications/AppCode.app/Contents/MacOS/appcode',
43+
'/Applications/CLion.app/Contents/MacOS/clion':
44+
'/Applications/CLion.app/Contents/MacOS/clion',
45+
'/Applications/IntelliJ IDEA.app/Contents/MacOS/idea':
46+
'/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',
47+
'/Applications/PhpStorm.app/Contents/MacOS/phpstorm':
48+
'/Applications/PhpStorm.app/Contents/MacOS/phpstorm',
49+
'/Applications/PyCharm.app/Contents/MacOS/pycharm':
50+
'/Applications/PyCharm.app/Contents/MacOS/pycharm',
51+
'/Applications/PyCharm CE.app/Contents/MacOS/pycharm':
52+
'/Applications/PyCharm CE.app/Contents/MacOS/pycharm',
53+
'/Applications/RubyMine.app/Contents/MacOS/rubymine':
54+
'/Applications/RubyMine.app/Contents/MacOS/rubymine',
55+
'/Applications/WebStorm.app/Contents/MacOS/webstorm':
56+
'/Applications/WebStorm.app/Contents/MacOS/webstorm',
4157
};
4258

4359
const COMMON_EDITORS_WIN = [
@@ -46,6 +62,18 @@ const COMMON_EDITORS_WIN = [
4662
'atom.exe',
4763
'sublime_text.exe',
4864
'notepad++.exe',
65+
'clion.exe',
66+
'clion64.exe',
67+
'idea.exe',
68+
'idea64.exe',
69+
'phpstorm.exe',
70+
'phpstorm64.exe',
71+
'pycharm.exe',
72+
'pycharm64.exe',
73+
'rubymine.exe',
74+
'rubymine64.exe',
75+
'webstorm.exe',
76+
'webstorm64.exe',
4977
];
5078

5179
function addWorkspaceToArgumentsIfExists(args, workspace) {
@@ -65,9 +93,7 @@ function getArgumentsForLineNumber(editor, fileName, lineNumber, workspace) {
6593
case 'sublime':
6694
case 'sublime_text':
6795
case 'wstorm':
68-
case 'appcode':
6996
case 'charm':
70-
case 'idea':
7197
return [fileName + ':' + lineNumber];
7298
case 'notepad++':
7399
return ['-n' + lineNumber, fileName];
@@ -87,12 +113,19 @@ function getArgumentsForLineNumber(editor, fileName, lineNumber, workspace) {
87113
['-g', fileName + ':' + lineNumber],
88114
workspace
89115
);
90-
case 'webstorm':
91-
case 'webstorm64':
116+
case 'appcode':
117+
case 'clion':
118+
case 'clion64':
119+
case 'idea':
120+
case 'idea64':
92121
case 'phpstorm':
93122
case 'phpstorm64':
94123
case 'pycharm':
95124
case 'pycharm64':
125+
case 'rubymine':
126+
case 'rubymine64':
127+
case 'webstorm':
128+
case 'webstorm64':
96129
return addWorkspaceToArgumentsIfExists(
97130
['--line', lineNumber, fileName],
98131
workspace

0 commit comments

Comments
 (0)