Merge pull request #9401 from jakubroztocil/feature/pycharm

Added support for PyCharm as external editor on macOS
This commit is contained in:
Rafael Oleza 2020-04-02 00:58:31 -07:00 committed by GitHub
commit 7981a5ccda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -12,6 +12,7 @@ export enum ExternalEditor {
SublimeText = 'Sublime Text',
BBEdit = 'BBEdit',
PhpStorm = 'PhpStorm',
PyCharm = 'PyCharm',
RubyMine = 'RubyMine',
TextMate = 'TextMate',
Brackets = 'Brackets',
@ -52,6 +53,9 @@ export function parse(label: string): ExternalEditor | null {
if (label === ExternalEditor.PhpStorm) {
return ExternalEditor.PhpStorm
}
if (label === ExternalEditor.PyCharm) {
return ExternalEditor.PyCharm
}
if (label === ExternalEditor.RubyMine) {
return ExternalEditor.RubyMine
}
@ -111,6 +115,8 @@ function getBundleIdentifiers(editor: ExternalEditor): ReadonlyArray<string> {
return ['com.barebones.bbedit']
case ExternalEditor.PhpStorm:
return ['com.jetbrains.PhpStorm']
case ExternalEditor.PyCharm:
return ['com.jetbrains.PyCharm']
case ExternalEditor.RubyMine:
return ['com.jetbrains.RubyMine']
case ExternalEditor.IntelliJ:
@ -177,6 +183,8 @@ function getExecutableShim(
return Path.join(installPath, 'Contents', 'Helpers', 'bbedit_tool')
case ExternalEditor.PhpStorm:
return Path.join(installPath, 'Contents', 'MacOS', 'phpstorm')
case ExternalEditor.PyCharm:
return Path.join(installPath, 'Contents', 'MacOS', 'pycharm')
case ExternalEditor.RubyMine:
return Path.join(installPath, 'Contents', 'MacOS', 'rubymine')
case ExternalEditor.TextMate:
@ -242,6 +250,7 @@ export async function getAvailableEditors(): Promise<
sublimePath,
bbeditPath,
phpStormPath,
pyCharmPath,
rubyMinePath,
textMatePath,
bracketsPath,
@ -262,6 +271,7 @@ export async function getAvailableEditors(): Promise<
findApplication(ExternalEditor.SublimeText),
findApplication(ExternalEditor.BBEdit),
findApplication(ExternalEditor.PhpStorm),
findApplication(ExternalEditor.PyCharm),
findApplication(ExternalEditor.RubyMine),
findApplication(ExternalEditor.TextMate),
findApplication(ExternalEditor.Brackets),
@ -310,6 +320,10 @@ export async function getAvailableEditors(): Promise<
results.push({ editor: ExternalEditor.PhpStorm, path: phpStormPath })
}
if (pyCharmPath) {
results.push({ editor: ExternalEditor.PyCharm, path: pyCharmPath })
}
if (rubyMinePath) {
results.push({ editor: ExternalEditor.RubyMine, path: rubyMinePath })
}

View file

@ -262,6 +262,7 @@ These editors are currently supported:
- [Sublime Text](https://www.sublimetext.com/)
- [BBEdit](http://www.barebones.com/products/bbedit/)
- [JetBrains PhpStorm](https://www.jetbrains.com/phpstorm/)
- [JetBrains PyCharm](https://www.jetbrains.com/pycharm/)
- [JetBrains RubyMine](https://www.jetbrains.com/rubymine/)
- [TextMate](https://macromates.com)
- [Brackets](http://brackets.io/)