Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable support for Pycharm using the built-in web server #16

Merged
merged 1 commit into from
Mar 7, 2021

Conversation

rnw159
Copy link

@rnw159 rnw159 commented Feb 8, 2021

Pycharm has a built-in webserver that makes it easy to open files. I have been using this locally for a while and decided to make a pr to share my work.

Cheers!

There might be better ways to do this, but this works really well for me.

@@ -17,6 +17,7 @@ <h3>Open GitHub links in your IDE</h3>
<option value="phpstorm">PhpStorm</option>
<option value="intellij-idea">IntelliJ IDEA</option>
<option value="webstorm">WebStorm</option>
<option value="pycharm">Pycharm (Built-in web server)</option>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<option value="pycharm">Pycharm (Built-in web server)</option>
<option value="pycharm">PyCharm (built-in web server)</option>

Comment on lines +75 to +77
const Http = new XMLHttpRequest();
Http.open("GET", url)
Http.send();
Copy link
Owner

@lmichelin lmichelin Mar 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const Http = new XMLHttpRequest();
Http.open("GET", url)
Http.send();
void fetch(url)

@@ -19,6 +19,7 @@ This browser extension allows you to open files in your IDE directly from GitHub
- VS Code Insiders
- PhpStorm
- IntelliJ IDEA
- Pycharm (Built-in web server)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Pycharm (Built-in web server)
- PyCharm (built-in web server)

name: "Pycharm (Built-in web server)",
icon: "icons/intellij-idea32.png",
openIDE: (repo: string, file: string, line?: string) => {
const url = `http://localhost:63342/api/file?file=${OPTIONS.localPathForRepositories}/${repo}/${file}&line=${line ? `${line}` : "1"}`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const url = `http://localhost:63342/api/file?file=${OPTIONS.localPathForRepositories}/${repo}/${file}&line=${line ? `${line}` : "1"}`
const url = `http://localhost:63342/api/file?file=${OPTIONS.localPathForRepositories}/${repo}/${file}&line=${line ?? "1"}`

@@ -28,6 +29,8 @@ PhpStorm & IntelliJ IDEA support is native on MacOS, but on Linux and Windows yo

I have not tested WebStorm support yet, feedbacks are welcome!

If you wish to use Pycharm (Built-in web server) then you must enable the intellij built-in web server (see [here](https://www.jetbrains.com/help/idea/php-built-in-web-server.html#configuring-built-in-web-server)) on port 63342
Copy link
Owner

@lmichelin lmichelin Mar 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you wish to use Pycharm (Built-in web server) then you must enable the intellij built-in web server (see [here](https://www.jetbrains.com/help/idea/php-built-in-web-server.html#configuring-built-in-web-server)) on port 63342
If you wish to use PyCharm (Built-in web server) then you must enable the intellij built-in web server (see [here](https://www.jetbrains.com/help/idea/php-built-in-web-server.html#configuring-built-in-web-server)) on port 63342.

@lmichelin lmichelin merged commit 302e863 into lmichelin:master Mar 7, 2021
@lmichelin
Copy link
Owner

lmichelin commented Mar 7, 2021

Thanks @rnw159 for your contribution 😉

I made some updates to your PR in commit 7511be7:

  • replace "PyCharm" with "JetBrains" as the build-in web server is available in many JetBrains editors
  • add a JetBrains icon
  • use fetch instead of XMLHttpRequest
  • show an alert if the API call fails
  • refactor some code

I just published v1.1.7 to Chrome Web Store and Firefox Addons.

@rnw159
Copy link
Author

rnw159 commented Mar 8, 2021

Hey thanks for merging! I love this extension 💚

lmichelin added a commit that referenced this pull request Mar 14, 2021
lmichelin added a commit that referenced this pull request Mar 14, 2021
Enable support for Pycharm using the built-in web server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants