### Example: Register backend location with specific IDE path Source: https://www.jetbrains.com/help/pycharm/remote-development-a.html Example command to register a specific IDE installation using the registerBackendLocationForGateway command. ```bash sh WebStorm-221.5591.52/bin/remote-dev-server.sh registerBackendLocationForGateway ``` -------------------------------- ### Create setup.py for Cython module Source: https://www.jetbrains.com/help/pycharm/cython.html Setup script for building the Cython module. It defines an Extension named 'example' from 'example.pyx' and configures the setup with name 'cythonTest', version '1.0', and author 'jetbrains'. This is used with the build_ext task to compile the module. ```python from setuptools import setup, Extension module = Extension ('example', sources=['example.pyx']) setup( name='cythonTest', version='1.0', author='jetbrains', ext_modules=[module] ) ``` -------------------------------- ### Switch to the PyCharm bin subdirectory Source: https://www.jetbrains.com/help/pycharm/installation-guide.html Changes into the bin subdirectory of the unpacked PyCharm installation to run the IDE. Replace the example path with your actual installation folder. ```bash cd /pycharm-*/bin ``` ```bash cd /opt/pycharm-2022.2.4/bin ``` -------------------------------- ### Install plugins on remote backend with remote-dev-server installPlugins Source: https://www.jetbrains.com/help/pycharm/remote-development-overview.html The first block shows the general syntax for installing plugins on the remote backend using the remote-dev-server command. The second block is a concrete example that installs the IdeaVIM plugin. Requires a network connection to JetBrains Marketplace. ```text remote-dev-server installPlugins ... ``` ```text remote-dev-server installPlugins IdeaVIM ``` -------------------------------- ### Create example Python files for navigation tutorials Source: https://www.jetbrains.com/help/pycharm/tutorial-exploring-navigation-and-search.html Example files for the navigation tutorials. mammalia.py defines the base Mammalia class and several subclasses, ending with a call to Cat.feeds(). carnivorae.py and herbivorae.py define Carnivorae and Herbivorae, each with a food() method that prints its diet. Create these files under the animals directory before starting the tutorials. ```python from Animals.Carnivorae import Carnivorae from Animals.Herbivorae import Herbivorae class Mammalia(object): extremities = 4 def feeds(self): print ("milk") def proliferates(self): pass class Marsupialia(Mammalia): def proliferates(self): print("poach") class Placentalia(Mammalia): def proliferates(self): print("placenta") class TasmanianDevil(Marsupialia, Carnivorae): pass class Duckbill(Marsupialia, Herbivorae): pass class Cat(Carnivorae, Placentalia): pass class Tiger(Placentalia,Carnivorae): pass class Cow(Placentalia, Herbivorae): pass Cat.feeds() ``` ```python from animals.mammalia import Mammalia class Carnivorae(Mammalia): def food(self): print("meat") pass ``` ```python from animals.mammalia import Mammalia class Herbivorae (Mammalia): def food(self): print("grass") pass ``` -------------------------------- ### Generate karma.conf.js on Windows Source: https://www.jetbrains.com/help/pycharm/running-unit-tests-on-karma.html First install karma-cli globally, then run karma init to start the configuration wizard. This is the Windows alternative to the macOS/Linux command. ```bash npm install -g karma-cli karma init ``` -------------------------------- ### Bootstrap pip on Windows (example path) Source: https://www.jetbrains.com/help/pycharm/troubleshooting-product.html Example command to bootstrap pip on Windows using a specific Python path. ```bash C:\Python27\python.exe -m ensurepip --default-pip ``` -------------------------------- ### Launch PyCharm from command line (Linux) Source: https://www.jetbrains.com/help/pycharm/configure-an-interpreter-using-command-line.html Launches PyCharm using the launcher script in the installation directory. Replace with the path to the PyCharm installation directory, for example /opt/pycharm/. If a symbolic link is created, you can just type 'pycharm'. ```shell sh /bin/pycharm.sh ``` -------------------------------- ### Windows: Install plugin from custom repository Source: https://www.jetbrains.com/help/pycharm/install-plugins-from-the-command-line.html Installs a plugin with ID com.example.myplugin from a custom repository URL on Windows. ```plaintext pycharm64.exe installPlugins com.example.myplugin http://plugins.example.com:8080/updatePlugins.xml ``` -------------------------------- ### Linux: Install plugin from custom repository Source: https://www.jetbrains.com/help/pycharm/install-plugins-from-the-command-line.html Installs a plugin with ID com.example.myplugin from a custom repository URL on Linux. ```plaintext pycharm.sh installPlugins com.example.myplugin http://plugins.example.com:8080/updatePlugins.xml ``` -------------------------------- ### Bootstrap pip on macOS/Linux (example path) Source: https://www.jetbrains.com/help/pycharm/troubleshooting-product.html Example command to bootstrap pip on macOS or Linux using a specific Python path. ```bash /Users/jetbrains/anaconda3/bin/python -m ensurepip --default-pip ``` -------------------------------- ### HTTP request with comment Source: https://www.jetbrains.com/help/pycharm/exploring-http-syntax.html Start a line with // or # to add a comment. This example shows a basic GET request with a comment line. ```http // A basic request GET http://example.com/a/ ``` -------------------------------- ### Launch PyCharm from command line (Windows) Source: https://www.jetbrains.com/help/pycharm/configure-an-interpreter-using-command-line.html Launches PyCharm using the full path to the executable in the installation directory. Replace with the path to the PyCharm installation directory, for example C:\Program Files\JetBrains\PyCharm. If the executable is added to PATH, you can just type 'pycharm'. ```shell \bin\pycharm64.exe ``` -------------------------------- ### Start Podman virtual machine Source: https://www.jetbrains.com/help/pycharm/podman.html Command to start the Podman virtual machine after initialization. Required on Windows and macOS. See podman machine start for details. ```bash podman machine start ``` -------------------------------- ### Install plugins via Gateway with --give-consent-to-use-third-party-plugins Source: https://www.jetbrains.com/help/pycharm/work-inside-remote-project.html Commands for installing plugins before starting JetBrains Gateway. The first command does not automatically download third-party plugins; the second command bypasses the prompt by using the --give-consent-to-use-third-party-plugins option. ```bash gateway installPlugins *idPlugin* ``` ```bash gateway installPlugins *idPlugin* --give-consent-to-use-third-party-plugins ``` -------------------------------- ### Example WSL Terraform executable path Source: https://www.jetbrains.com/help/pycharm/terraform.html Example of a WSL Terraform executable path for an Ubuntu distribution. Use this format in the Terraform executable path field when Terraform is installed in WSL. ```text \\wsl$\Ubuntu\usr\bin\terraform ``` -------------------------------- ### Install HTTP Client CLI via Homebrew Source: https://www.jetbrains.com/help/pycharm/http-client-cli.html Installs the HTTP Client CLI on macOS using the Homebrew package manager. After installation, you can check the version with the command shown in the following example. ```bash brew install ijhttp ``` -------------------------------- ### Example: Run script with Python interpreter path Source: https://www.jetbrains.com/help/pycharm/troubleshooting-product.html Example command using a specific Python interpreter path and script path. This is a concrete example of the previous command. ```bash /Users/jetbrains/bin/python3 /Users/jetbrains/Samples/my_script.py ``` -------------------------------- ### macOS: Install plugin from custom repository Source: https://www.jetbrains.com/help/pycharm/install-plugins-from-the-command-line.html Installs a plugin with ID com.example.myplugin from a custom repository URL on macOS. ```plaintext pycharm installPlugins com.example.myplugin http://plugins.example.com:8080/updatePlugins.xml ``` -------------------------------- ### Example extends with SCSS config Source: https://www.jetbrains.com/help/pycharm/using-stylelint-code-quality-tool.html Example configuration using the stylelint-config-standard-scss shared config. ```json { "extends": "stylelint-config-standard-scss" } ``` -------------------------------- ### Install latest Astro language server with npm Source: https://www.jetbrains.com/help/pycharm/language-services.html Use this command to install the latest Astro language server via npm. This is recommended to get performance improvements and fix issues. ```bash npm install --save-dev @astrojs/language-server ``` -------------------------------- ### Install latest Vue language server with npm Source: https://www.jetbrains.com/help/pycharm/language-services.html Use this command to install the latest Vue language server via npm. This is recommended to get performance improvements and fix issues. ```bash npm install --save-dev @vue/language-server ``` -------------------------------- ### Install ESLint with npm Source: https://www.jetbrains.com/help/pycharm/eslint.html Install ESLint in the current project and generate a configuration file, install it as a development dependency, or install it globally using npm. Answer the wizard questions to generate an eslint.config.js file. ```bash npm init @eslint/config@latest ``` ```bash npm install --save-dev eslint ``` ```bash npm install --g eslint ``` -------------------------------- ### Install ESLint with pnpm Source: https://www.jetbrains.com/help/pycharm/eslint.html Install ESLint in the current project and generate a configuration file, install it as a development dependency, or install it globally using pnpm. Answer the wizard questions to generate an eslint.config.js file. ```bash pnpm create @eslint/config@latest ``` ```bash pnpm add -D eslint ``` ```bash pnpm add -g eslint ``` -------------------------------- ### Install and run JetBrains Toolbox on Linux Source: https://www.jetbrains.com/help/pycharm/installation-guide.html These commands are used to install and launch the JetBrains Toolbox App on Linux. First, extract the downloaded tarball to the desired installation directory. Then, run the application from the bin directory. The third line shows the directory where Toolbox application files are initialized. ```bash tar -xvf jetbrains-toolbox-.tar.gz -C ``` ```bash ./bin/jetbrains-toolbox ``` ```text ~/.local/share/JetBrains/Toolbox ``` -------------------------------- ### JetBrains URLs for automatic installer fetch Source: https://www.jetbrains.com/help/pycharm/remote-development-starting-page.html Required URLs that must be reachable from the remote server when the IDE installer is automatically fetched from JetBrains installers storage. ```text https://code-with-me.jetbrains.com https://download.jetbrains.com https://download-cf.jetbrains.com https://cache-redirector.jetbrains.com ``` -------------------------------- ### Command-line inspector example (Windows) Source: https://www.jetbrains.com/help/pycharm/command-line-code-inspector.html Example of running the inspector on Windows with maximum verbosity, inspecting a specific directory, and saving results to an XML file. ```bash pycharm64.exe inspect C:\MyProject C:\MyProject\.idea\inspectionProfiles\MyProfile.xml C:\MyProject\InspectionResults -v2 -d C:\MyProject\src ``` -------------------------------- ### Example Dev Container CLI distribution link Source: https://www.jetbrains.com/help/pycharm/dev-container-cli.html Example link to a deployed distribution of the Dev Container CLI ZIP archive. ```text https://download.jetbrains.com/resources/intellij/dev-containers/243.19420.43/intellij-devcontainers-cli.zip ``` -------------------------------- ### Install ESLint with yarn Source: https://www.jetbrains.com/help/pycharm/eslint.html Install ESLint in the current project and generate a configuration file, install it as a development dependency, or install it globally using yarn. Answer the wizard questions to generate an eslint.config.js file. ```bash yarn create @eslint/config ``` ```bash yarn add -D eslint ``` ```bash yarn add eslint ``` -------------------------------- ### Install all dependencies from package.json Source: https://www.jetbrains.com/help/pycharm/installing-and-removing-external-software-using-node-package-manager.html Commands to install all dependencies listed in a package.json file from the current folder. Run these in the built-in Terminal (Alt+F12) or your command-line shell. ```bash npm install ``` ```bash yarn install ``` ```bash pnpm install ``` -------------------------------- ### Install pyaudio using pipwin Source: https://www.jetbrains.com/help/pycharm/package-installation-issues.html Workaround for pyaudio installation failure with 'Cannot open include file: 'portaudio.h''. Run these commands with admin privileges. ```bash pip install pipwin pipwin install pyaudio ``` -------------------------------- ### Example .http file with import and pre-request script Source: https://www.jetbrains.com/help/pycharm/http-client-in-product-code-editor.html Example HTTP request file that imports a module using a common block and uses it in a pre-request script. ```http ={% import { logMessage } from "logger" %} ### < {% logMessage(); %} GET https://examples.http-client.intellij.net/get ``` -------------------------------- ### Short form GET request Source: https://www.jetbrains.com/help/pycharm/exploring-http-syntax.html For GET requests, you can omit the method and only specify the URI. This example shows a comment followed by the URI. ```http // A basic request https://example.com/a/ ``` -------------------------------- ### Example JDBC URL for Snowflake with Okta SSO and Duo MFA Source: https://www.jetbrains.com/help/pycharm/create-snowflake-data-sources-with-okta-and-duo.html Example JDBC URL for a Snowflake connection using Okta SSO and Duo MFA. Replace the example values with your own credentials and connection details. ```text jdbc:snowflake://myorg-myconnection.snowflakecomputing.com/?warehouse=AUTH_WH&db=TESTDB&schema=MYSCHEMA&user=MYUSERNAME@DOMAIN.COM&password=DUMMY-PASSWORD&authenticator=externalbrowser ``` -------------------------------- ### Install Stylelint and standard config Source: https://www.jetbrains.com/help/pycharm/using-stylelint-code-quality-tool.html Installs Stylelint and its standard configuration as dev dependencies. Run this in your command-line shell or the embedded Terminal (Alt+F12). ```bash npm install --save-dev stylelint stylelint-config-standard ``` -------------------------------- ### Install Next.js dependencies with npm install Source: https://www.jetbrains.com/help/pycharm/next.html Install Next.js and its required dependencies in an empty PyCharm project. Also used for npm version 5.1 and earlier when installing create-next-app manually. ```bash npm install --save-dev next react react-dom ``` -------------------------------- ### Windows: Install GitHub plugin Source: https://www.jetbrains.com/help/pycharm/install-plugins-from-the-command-line.html Installs the GitHub plugin by its ID on Windows. ```plaintext pycharm64.exe installPlugins org.jetbrains.plugins.github ``` -------------------------------- ### Example .ws-context configuration for multiple frameworks Source: https://www.jetbrains.com/help/pycharm/angular.html This example shows a `.ws-context` file that sets a default framework and overrides it for specific files and folders using GLOB patterns. It demonstrates the use of the `framework` and `angular-template-syntax` properties, and shows how to set a context to `null` to inherit the default. ```json { "framework": "vue", "angular-template-syntax": "V_2", "src/**/app/**": { "framework": null, "app.component.html" : { "framework": "angular", "angular-template-syntax": "V_17" } }, "src/**/p*-editor/*.html" : { "framework" : "angular" } } ``` -------------------------------- ### Install @nuxt/types as dev dependency Source: https://www.jetbrains.com/help/pycharm/nuxt.html Install the @nuxt/types package as a development dependency to get better code completion for Nuxt versions earlier than 4. PyCharm may suggest this installation via a notification popup or the Event Log. ```bash npm install --save-dev @nuxt/types ``` -------------------------------- ### Install plugin from command line (pycharm64.exe, open -na, pycharm.sh) Source: https://www.jetbrains.com/help/pycharm/managing-plugins.html Installs a plugin by its Plugin ID from the command line. Requires the IDE to be closed. For Windows, navigate to the bin directory under the PyCharm installation directory and run pycharm64.exe. For macOS, use the open command with the PyCharm.app path. For Linux, navigate to the bin directory and run pycharm.sh. Replace with the actual plugin ID (e.g., org.jetbrains.plugins.github). ```command line pycharm64.exe installPlugins ``` ```command line pycharm64.exe installPlugins org.jetbrains.plugins.github ``` ```command line open -na "PyCharm.app" --args installPlugins ``` ```command line open -na "PyCharm.app" --args installPlugins org.jetbrains.plugins.github ``` ```command line pycharm.sh installPlugins ``` ```command line pycharm.sh installPlugins org.jetbrains.plugins.github ``` -------------------------------- ### inspect.sh example Source: https://www.jetbrains.com/help/pycharm/command-line-code-inspector.html Example of running the inspect.sh script on macOS/Linux with maximum verbosity, inspecting a specific directory, and saving results to an XML file. ```bash inspect.sh ~/MyProject ~/MyProject/.idea/inspectionProfiles/MyProfile.xml ~/MyProject/InspectionResults -v2 -d ~/MyProject/src ``` -------------------------------- ### Linux: Install GitHub plugin Source: https://www.jetbrains.com/help/pycharm/install-plugins-from-the-command-line.html Installs the GitHub plugin by its ID on Linux. ```plaintext pycharm.sh installPlugins org.jetbrains.plugins.github ``` -------------------------------- ### Send URL-encoded {{variable}} in GET request Source: https://www.jetbrains.com/help/pycharm/http-client-variables.html Use URL-encoded curly braces to avoid variable substitution. The example sends a GET request with the literal text '{{variable}}' as a query parameter. ```http ### send URL-encoded {{variable}} GET https://www.example.com/search?q=%7B%7Bvariable%7D%7D ``` -------------------------------- ### JDBC URL example with user and password Source: https://www.jetbrains.com/help/pycharm/create-amazon-redshift-data-source-with-okta.html An example JDBC URL that includes the user and password parameters in addition to the Okta SAML parameters. ```text jdbc:redshift:iam://examplecluster.abc123xyz789.us-west-2.redshift.amazonaws.com:5439/dev?plugin_name=com.amazon.redshift.plugin.BrowserSamlCredentialsProvider&login_url=https://example.okta.com/app/example_1/abc012/sso/saml&user=&password= ``` -------------------------------- ### Run setup.py task command format Source: https://www.jetbrains.com/help/pycharm/creating-and-running-setup-py.html Command-line format for running tasks defined in setup.py. Use it to build, install, and distribute packages described in the setup.py file. ```text setup.py ``` -------------------------------- ### Install latest Astro language server with yarn Source: https://www.jetbrains.com/help/pycharm/language-services.html Use this command to install the latest Astro language server via yarn. This is recommended to get performance improvements and fix issues. ```bash yarn add --dev @astrojs/language-server ``` -------------------------------- ### Install latest Astro language server with pnpm Source: https://www.jetbrains.com/help/pycharm/language-services.html Use this command to install the latest Astro language server via pnpm. This is recommended to get performance improvements and fix issues. ```bash pnpm add --save-dev @astrojs/language-server ``` -------------------------------- ### Install Chai expectation library Source: https://www.jetbrains.com/help/pycharm/unit-testing-node-js.html Run this command in the terminal to install Chai as a development dependency for your project. ```bash npm install --save-dev chai ``` -------------------------------- ### Example platform properties file Source: https://www.jetbrains.com/help/pycharm/tuning-the-ide.html Example platform properties file. Specify each property on a separate line. The properties override the corresponding values from the default idea.properties file. ```properties idea.max.intellisense.filesize=5000 idea.cycle.buffer.size=1024 ``` -------------------------------- ### Example: Run remote-dev-server.sh with actual values Source: https://www.jetbrains.com/help/pycharm/remote-development-a.html Example command using a specific IDE path, project path, and SSH host. This is a concrete invocation of the remote-dev-server.sh script. ```bash ~/PY-213.5744.248/bin/remote-dev-server.sh run ~/home/jetbrains/PythonProjects/SampleApp/ --ssh-link-host ec2-13-50-136-85.eu-north-1.compute.amazonaws.com ``` -------------------------------- ### Install latest Vue language server with yarn Source: https://www.jetbrains.com/help/pycharm/language-services.html Use this command to install the latest Vue language server via yarn. This is recommended to get performance improvements and fix issues. ```bash yarn add --dev @vue/language-server ``` -------------------------------- ### Start systemd socket for rootful Podman Source: https://www.jetbrains.com/help/pycharm/podman.html Command to start the systemd socket for rootful Podman as root. ```bash sudo systemctl start podman.socket ``` -------------------------------- ### Install latest Vue language server with pnpm Source: https://www.jetbrains.com/help/pycharm/language-services.html Use this command to install the latest Vue language server via pnpm. This is recommended to get performance improvements and fix issues. ```bash pnpm add --save-dev @vue/language-server ``` -------------------------------- ### Project structure with multiple environment files Source: https://www.jetbrains.com/help/pycharm/http-client-variables.html Project structure example showing multiple environment files in different directories. The comments describe the contents of each file, illustrating how environments are resolved for requests in different directories. ```text root/http-client.env.json # public file with 'dev' environment and 'host' variable root/service1/http-client.private.env.json # private file with 'dev' environment and "key": "myKey1" variable root/service2/http-client.private.env.json # private file with 'dev' environment and "key": "myKey2" variable ``` -------------------------------- ### Verify Poetry installation Source: https://www.jetbrains.com/help/pycharm/poetry.html Verify the Poetry installation. A successful installation shows output like `Poetry (version 1.2.0)`. ```bash poetry --version ``` -------------------------------- ### Example Dev Container build command Source: https://www.jetbrains.com/help/pycharm/dev-container-cli.html Example command that builds a Dev Container for the spring-petclinic project using its devcontainer.json configuration. ```bash ./ijdevc --config /Users/jetbrains/spring-petclinic/.devcontainer/devcontainer.json /Users/jetbrains/spring-petclinic ``` -------------------------------- ### Install Tailwind CSS Language Server globally Source: https://www.jetbrains.com/help/pycharm/tailwind-css.html Run this command to install the latest version of the @tailwindcss/language-server package globally. ```bash npm install -g @tailwindcss/language-server ``` -------------------------------- ### Install PyCharm to /opt Source: https://www.jetbrains.com/help/pycharm/installation-guide.html Installs PyCharm to the recommended /opt directory using sudo. Follows the filesystem hierarchy standard (FHS). ```bash sudo tar xzf pycharm-*.tar.gz -C /opt/ ``` -------------------------------- ### Install karma-coverage package Source: https://www.jetbrains.com/help/pycharm/running-unit-tests-on-karma.html Run this command in the terminal to install the karma-coverage package as a dev dependency. ```bash npm install --save-dev karma-coverage ``` -------------------------------- ### Install latest TypeScript language service with yarn Source: https://www.jetbrains.com/help/pycharm/language-services.html Use this command to install the latest TypeScript language service via yarn. This is recommended to get performance improvements and fix issues. ```bash yarn add --dev typescript ``` -------------------------------- ### Install latest TypeScript language service with pnpm Source: https://www.jetbrains.com/help/pycharm/language-services.html Use this command to install the latest TypeScript language service via pnpm. This is recommended to get performance improvements and fix issues. ```bash pnpm add --save-dev typescript ``` -------------------------------- ### Create productsInfoUrl file Source: https://www.jetbrains.com/help/pycharm/fully-offline-mode.html Creates a file containing the URL to products.json generated by the backend downloader. The placeholder is replaced by JetBrains Gateway with the corresponding product code. ```bash $ cat productsInfoUrl https://internal.site/backends//products.json ``` -------------------------------- ### Install latest TypeScript language service with npm Source: https://www.jetbrains.com/help/pycharm/language-services.html Use this command to install the latest TypeScript language service via npm. This is recommended to get performance improvements and fix issues. ```bash npm install --save-dev typescript ``` -------------------------------- ### Install dependencies with npm install Source: https://www.jetbrains.com/help/pycharm/developing-node-js-applications.html Run this command in your command-line shell or the embedded Terminal (Alt+F12) to download the project dependencies. Alternatively, you can select 'Run npm install' from the context menu of the package.json file in your project root. ```shell npm install ``` -------------------------------- ### Install Compass gem Source: https://www.jetbrains.com/help/pycharm/transpiling-compass-to-css.html Installs the Compass gem. Requires Ruby and the gem.bat file to be available in the command-line environment. ```shell gem install compass ``` -------------------------------- ### Install pydevd-pycharm package on remote machine Source: https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html Install the pydevd-pycharm package on the remote machine. The version must match the local PyCharm version; the second command shows an example with version 242.20224.428. ```bash pip install pydevd-pycharm~= ``` ```bash pip install pydevd-pycharm~=242.20224.428) ``` -------------------------------- ### Install Flow globally Source: https://www.jetbrains.com/help/pycharm/using-the-flow-type-checker.html Use this command in the terminal to install Flow globally on your system. ```bash npm install --global flow-bin ``` -------------------------------- ### getElementsByTagName example in HTTP Client response handler Source: https://www.jetbrains.com/help/pycharm/javascript-api-supported-by-http-client.html Use getElementsByTagName to retrieve a collection of elements with a given tag name from the response body. The example gets the first 'slide' element and logs it. ```http GET https://examples.http-client.intellij.net/xml > {% const slide = response.body.getElementsByTagName("slide")[0] console.log(slide) %} ``` -------------------------------- ### Show jetbrains-clients-downloader help Source: https://www.jetbrains.com/help/pycharm/fully-offline-mode.html Displays detailed syntax and options for the JetBrains Client Downloader. Useful when filters are not used, as by default everything gets downloaded. ```bash jetbrains-clients-downloader -h ``` -------------------------------- ### Example of using XPath in a response handler Source: https://www.jetbrains.com/help/pycharm/http-client-in-product-code-editor.html Example of a GET request that includes a response handler script using the xpath function. The response is an XML document, and the handler extracts data using XPath. ```http GET https://examples.http-client.intellij.net/xml ``` -------------------------------- ### Install Tailwind CSS with npm Source: https://www.jetbrains.com/help/pycharm/tailwind-css.html Run this command in the terminal to install Tailwind CSS as a development dependency. ```bash npm install -D tailwindcss ``` -------------------------------- ### macOS config JSON example Source: https://www.jetbrains.com/help/pycharm/fully-offline-mode.html Example JSON content for the macOS configuration file, setting `versionManagementEnabled` to `"true"`. ```json { "versionManagementEnabled": "true" } ``` -------------------------------- ### Install latest Svelte language server and plugin with yarn Source: https://www.jetbrains.com/help/pycharm/language-services.html Use this command to install the latest Svelte language server and TypeScript plugin via yarn. This is recommended to get performance improvements and fix issues. ```bash yarn add --dev svelte-language-server typescript-svelte-plugin ``` -------------------------------- ### #parse directive example with header.py Source: https://www.jetbrains.com/help/pycharm/parse-directive.html Example of using #parse to insert the include template named header.py into another template. ```plaintext #parse("header.py") ``` -------------------------------- ### Install nyc Source: https://www.jetbrains.com/help/pycharm/unit-testing-node-js.html Install nyc, the command-line interface for Istanbul, to monitor code coverage. Run this command in your command-line shell or embedded Terminal. ```bash npm install --save-dev nyc ``` -------------------------------- ### Install ESLint 8 with npm Source: https://www.jetbrains.com/help/pycharm/linting-typescript.html Install ESLint 8 and earlier with the TypeScript ESLint parser and plugin using npm. ```bash npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint typescript ``` -------------------------------- ### Install latest Svelte language server and plugin with pnpm Source: https://www.jetbrains.com/help/pycharm/language-services.html Use this command to install the latest Svelte language server and TypeScript plugin via pnpm. This is recommended to get performance improvements and fix issues. ```bash pnpm add --save-dev svelte-language-server typescript-svelte-plugin ``` -------------------------------- ### Install Mocha locally Source: https://www.jetbrains.com/help/pycharm/running-unit-tests-on-mocha.html Installs Mocha in the current project. Use this command in the command-line shell or embedded Terminal. ```bash npm install mocha ``` -------------------------------- ### Windows: three-way merge example Source: https://www.jetbrains.com/help/pycharm/command-line-merge-tool.html Example of a three-way merge on Windows. Specify paths for two modified versions, the base revision, and the output file. ```bash pycharm64.exe merge C:\MyProjectCopy\Readme.md C:\FriendsProjectCopy\Readme.md C:\Archive\Readme.md C:\MainProject\Readme.md ``` -------------------------------- ### Install latest Svelte language server and plugin with npm Source: https://www.jetbrains.com/help/pycharm/language-services.html Use this command to install the latest Svelte language server and TypeScript plugin via npm. This is recommended to get performance improvements and fix issues. ```bash npm install --save-dev svelte-language-server typescript-svelte-plugin ``` -------------------------------- ### Install Stylelint with SCSS shared config Source: https://www.jetbrains.com/help/pycharm/using-stylelint-code-quality-tool.html Installs Stylelint together with the shared config for SCSS. Use this when linting stylesheets different from CSS. ```bash npm install --save-dev stylelint stylelint-config-standard-scss ``` -------------------------------- ### Install ESLint and eslint-plugin-react Source: https://www.jetbrains.com/help/pycharm/react.html Run these commands in the built-in Terminal to install ESLint and the React plugin as dev dependencies. Required before configuring ESLint for React JSX syntax. ```bash npm install --save-dev eslint npm install --save-dev eslint-plugin-react ``` -------------------------------- ### Install ESLint 9+ with npm Source: https://www.jetbrains.com/help/pycharm/linting-typescript.html Install ESLint 9 and later with the TypeScript ESLint packages using npm. ```bash npm install --save-dev eslint @eslint/js typescript typescript-eslint ``` -------------------------------- ### Mark end of request with ### separator Source: https://www.jetbrains.com/help/pycharm/exploring-http-syntax.html Type ### below a request to mark its end. This example shows a short-form GET request followed by the separator. ```http // A basic request https://example.com/a/ ### ``` -------------------------------- ### Install package with pip on Windows Source: https://www.jetbrains.com/help/pycharm/troubleshooting-product.html Command to install a package using the Python executable path on Windows. Replace the path and package name as needed. ```bash C:\Python27\python.exe -mpip install 'Flask' ``` -------------------------------- ### Syntax highlighting example Source: https://www.jetbrains.com/help/pycharm/python-code-insight.html Placeholder for a code example illustrating syntax highlighting in the PyCharm editor. The actual code content is not provided in the source. ```text Code snippet {...} ``` -------------------------------- ### Gateway link example Source: https://www.jetbrains.com/help/pycharm/remote-development-a.html Example of the Gateway link output, containing host-port-user, IDE and version information. When opened in a browser, it launches the local JetBrains Gateway application directly without a welcome page. ```text jetbrains-gateway://connect#idePath=%2Fhome%2Fubuntu%2F.cache%2FJetBrains%2FRemoteDev%2Fdist%2F3e4cd27bfbb95_ideaIU-2022.2.2&projectPath=%2Fhome%2Fubuntu%2Fdevelopment%2Fspring-petclinic&host=ec2-xx-xx-xxx-xx.eu-north-1.compute.amazonaws.com&port=22&user=ubuntu&type=ssh&deploy=false ``` -------------------------------- ### Http link example Source: https://www.jetbrains.com/help/pycharm/remote-development-a.html Example of the Http link output, containing host-port-user, IDE and version information. When opened in a browser, it displays a welcome page and tries to call the local Gateway application. ```text https://code-with-me.jetbrains.com/remoteDev#idePath=%2Fhome%2Fubuntu%2F.cache%2FJetBrains%2FRemoteDev%2Fdist%2F3e4cd27bfbb95_ideaIU-2022.2.2&projectPath=%2Fhome%2Fubuntu%2Fdevelopment%2Fspring-petclinic&host=ec2-xx-xx-xxx-xx.eu-north-1.compute.amazonaws.com&port=22&user=ubuntu&type=ssh&deploy=false ``` -------------------------------- ### Join link example Source: https://www.jetbrains.com/help/pycharm/remote-development-a.html Example of the Join link output, containing the local address and port where the remote IDE is listening. Ensure the remote machine is accessible by this local address. ```text tcp://127.0.0.1:5991#jt=71e779a1-070e-4fd3-a4e6-83c1f8cb65a5&p=IU&fp=A42F6041C2878D7A22339ECABF4A9C294F643BG05E91E3DFC06035E03DB71BF8&cb=222.4167.29&jb=17.0.4b469.53 ``` -------------------------------- ### package.json with ESLint devDependencies Source: https://www.jetbrains.com/help/pycharm/eslint.html Example package.json that includes ESLint in the devDependencies section. Ensure ESLint is listed there before running the package manager install command. ```json { "name": "node-eslint", "version": "0.0.0", "private": true, "scripts": { "start": "node ./bin/www" }, "dependencies": { "cookie-parser": "~1.4.4", "debug": "~2.6.9", "express": "~4.16.1", "http-errors": "~1.6.3", "morgan": "~1.9.1", "pug": "2.0.0-beta11" }, "devDependencies": { "@eslint/js": "^9.15.0", "eslint": "^9.15.0", "globals": "^15.12.0" } } ``` -------------------------------- ### Start local server with custom port and directory Source: https://www.jetbrains.com/help/pycharm/shared-indexes.html Starts the local server with a custom port and server directory. The --server-directory option overrides the default ./ij-shared-indexes-tool-data/server. Windows uses the .bat file, macOS and Linux use the shell command. ```bat .\bin\ij-shared-indexes-tool-cli.bat server --port 8080 --server-directory "C:\Users\jetbrains\ij-shared-indexes-tool-data\server" ``` ```bash ./bin/ij-shared-indexes-tool-cli server --port 8080 --server-directory "/Users/jetbrains/ij-shared-indexes-tool-data/server" ``` ```bash ./bin/ij-shared-indexes-tool-cli server --port 8080 --server-directory "/home/jetbrains/ij-shared-indexes-tool-data/server" ``` -------------------------------- ### Use request.templateValue() in response script Source: https://www.jetbrains.com/help/pycharm/http-client-variables.html Uses request.templateValue(Integer) to get the value by its index in the loop. The example sends two requests and logs the title and year. ```http ### Use templateValue < {% request.variables.set("books", [{ "books": { "title": "Ulysses", "year": 1922 } }, { "books": { "title": "Dune", "year": 1965 }}]) %} GET http://localhost:8080/books Content-Type: application/json { "bookTitle": "{{$.books..title}}", "bookYear": "{{$.books..year}}" } > {% let bookTitle = request.templateValue(0) client.log(`book title is: ${bookTitle}`) // prints Ulysses in 1st request, Dune in 2nd client.log(request.iteration()) let bookYear = request.templateValue(1) client.log(`book year is: ${bookYear}`) // prints 1922 in 1st request, 1965 in 2nd %} ``` -------------------------------- ### Install Flask with pip (version 1.0.2) Source: https://www.jetbrains.com/help/pycharm/troubleshooting-product.html Command to install Flask compatible with version 1.0.2 using the Python interpreter's pip. ```bash /Users/jetbrains/anaconda3/bin/python -mpip install 'Flask~=1.0.2' ``` -------------------------------- ### Parameter pattern example with %{2}(\w+_\d+) Source: https://www.jetbrains.com/help/pycharm/run-a-query.html Example query using the %%winnerpl_2 parameter. Requires the pattern %{2}(\w+_\d+) to be set in the User Parameters settings page. ```sql SELECT title, description, release_year FROM actor JOIN film_actor fa ON actor.actor_id = fa.actor_id JOIN film f ON f.film_id = fa.film_id WHERE last_name = '%%winnerpl_2'; ``` -------------------------------- ### Use request.iteration() in pre-request and response scripts Source: https://www.jetbrains.com/help/pycharm/http-client-variables.html Uses request.iteration() to get the current index in the loop. The example sends three requests and logs the iteration index. ```http ### Use request.iteration() < {% request.variables.set("clients", [ // test data {"id": 1, "firstName": "George", "lastName": "Franklin", balance: 100}, {"id": 2, "firstName": "John", "lastName": "Doe", balance: 1500}, {"id": 3, "firstName": "Eduardo", "lastName": "Rodriquez", balance: 10} ]) %} POST https://examples.http-client.intellij.net/post Content-Type: application/json { "clientId": {{$.clients..id}}, "firstName": "{{$.clients..firstName}}", "lastName": "{{$.clients..lastName}}", "balance": "{{$.clients..balance}}" } > {% client.log(request.iteration()) // prints 0 for 1st request, 1 for 2nd, 2 for 3rd let current = request.variables.get("clients")[request.iteration()] client.test(`Account ${current.lastName} has initial balance ${current.balance}`, () => { let responseBalance = jsonPath(response.body, "$.json.balance") client.assert(responseBalance == current.balance) }) %} ``` -------------------------------- ### Django test options example Source: https://www.jetbrains.com/help/pycharm/run-debug-configuration-django-test.html Example of parameters to pass to Django tests when the Options checkbox is selected. Parameters are prepended with '--' and delimited by spaces. ```text --noinput --failfast ``` -------------------------------- ### Multiple requests in a single file Source: https://www.jetbrains.com/help/pycharm/exploring-http-syntax.html Compose several requests in one file by separating them with ###. This example shows two GET requests, the second using a query string. ```http // A basic request https://example.com/a/ ### // A second request using the GET method https://example.com:8080/api/html/get?id=123&value=content ``` -------------------------------- ### Package.json for a Node.js project with Mocha Source: https://www.jetbrains.com/help/pycharm/running-unit-tests-on-mocha.html The package.json file is checked in the Docker setup to ensure Mocha is listed in the devDependencies section. This example shows the required dependencies and devDependencies. ```json { "name": "node-express", "version": "0.0.0", "private": true, "dependencies": { "cookie-parser": "~1.4.4", "debug": "~2.6.9", "express": "~4.16.1", "http-errors": "~1.6.3", "morgan": "~1.9.1", "pug": "^3.0.2" }, "devDependencies": { "chai": "^4.3.4", "eslint": "^8.1.0", "http-server": "^14.0.0", "mocha": "^9.1.3" } } ``` -------------------------------- ### Create bower.json with bower init Source: https://www.jetbrains.com/help/pycharm/using-bower-package-manager.html Navigates to your project folder and initializes Bower, which creates a bower.json file. You will be prompted to specify settings such as the testing framework, browsers to capture, and test file patterns. ```bash cd ``` ```bash bower init ``` -------------------------------- ### PKCE configuration example Source: https://www.jetbrains.com/help/pycharm/oauth-2-0-authorization.html Example of a PKCE configuration that customizes the code challenge method and code verifier. Use "Code Challenge Method" with "Plain" or "SHA-256". ```json { "PKCE": { "Code Challenge Method": "Plain", "Code Verifier": "YYLzIBzrXpVaH5KRx86itubKLXHNGnJBogEwkhveM" } } ``` -------------------------------- ### Add JetBrains plugin to devcontainer.json Source: https://www.jetbrains.com/help/pycharm/customizing-devcontainer-json-file.html Add this code inside the customizations section of devcontainer.json to install a plugin from the JetBrains marketplace. Replace the plugin ID with the ID copied from the plugin page, for example org.intellij.plugins.hcl. ```json { "customizations": { "jetbrains": { "plugins": [ "org.intellij.plugins.hcl" ] } } } ``` -------------------------------- ### Specify IDE backend in devcontainer.json Source: https://www.jetbrains.com/help/pycharm/customizing-devcontainer-json-file.html Add this code inside the customizations section of devcontainer.json to specify the IDE backend that will be launched automatically when starting the Dev Container. Replace with the IDE name, for example IntelliJ. ```json { "customizations": { "jetbrains": { "backend": "" } } } ``` -------------------------------- ### Initialize TSLint configuration file Source: https://www.jetbrains.com/help/pycharm/linting-typescript.html Run these commands in the project root to create a tslint.json configuration file. The first command changes to the project root; the second runs the TSLint initializer. ```bash cd tslint --init ``` -------------------------------- ### Example metrics file name Source: https://www.jetbrains.com/help/pycharm/open-telemetry-tracing-and-metrics.html Example of the generated metrics file name. Files are written in the logs folder at both frontend and backend, with .gz extension. ```text open-telemetry-connection-metrics.2023-03-29-15-48-40.gz ``` -------------------------------- ### Introduce Field: Initialize in getter (Example 1) Source: https://www.jetbrains.com/help/pycharm/specific-typescript-refactorings.html Shows the Rectangle class after introducing the _calcArea field and initializing it in the get area() method. The field is declared as private and assigned within the getter before returning its value. ```TypeScript class Rectangle { constructor(public height: number, public width: number) { this.height = height; this.width = width; } private _calcArea: number; get area() { this._calcArea = this.calcArea(); return this._calcArea; } calcArea() { return this.height * this.width; } } ``` -------------------------------- ### Add IDE bin to user PATH with PowerShell Source: https://www.jetbrains.com/help/pycharm/working-with-the-ide-features-from-command-line.html Permanently adds the IDE's bin directory to the user PATH environment variable using PowerShell. Note that the example uses the IntelliJ IDEA path; adjust it to your PyCharm installation path. ```powershell [Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';C:\Program Files\JetBrains\IntelliJ IDEA\bin', 'User') ``` -------------------------------- ### Unit tests for Car class using unittest Source: https://www.jetbrains.com/help/pycharm/testing-your-first-python-application.html Example unit tests for a Car class using the unittest framework. The tests cover initial state, acceleration, and braking behavior, including edge cases like preventing negative speed. The setUp method creates a fresh Car instance for each test. ```python from unittest import TestCase from car import Car class TestCar(TestCase): def setUp(self): self.car = Car() class TestInit(TestCar): def test_initial_speed(self): self.assertEqual(self.car.speed, 0) def test_initial_odometer(self): self.assertEqual(self.car.odometer, 0) def test_initial_time(self): self.assertEqual(self.car.time, 0) def test_initial_average_speed(self): self.assertEqual(self.car.average_speed(), 0) class TestAccelerate(TestCar): def test_accelerate_from_zero(self): self.car.accelerate() self.assertEqual(self.car.speed, 5) def test_multiple_accelerates(self): for _ in range(3): self.car.accelerate() self.assertEqual(self.car.speed, 15) class TestBrake(TestCar): def test_brake_once(self): self.car.accelerate() self.car.brake() self.assertEqual(self.car.speed, 0) def test_multiple_brakes(self): for _ in range(5): self.car.accelerate() for _ in range(3): self.car.brake() self.assertEqual(self.car.speed, 10) def test_should_not_allow_negative_speed(self): self.car.brake() self.assertEqual(self.car.speed, 0) def test_multiple_brakes_at_zero(self): for _ in range(3): self.car.brake() self.assertEqual(self.car.speed, 0) ``` -------------------------------- ### Update README.md with demo project description Source: https://www.jetbrains.com/help/pycharm/working-with-git-tutorial.html Replace the existing content of README.md with this description to demonstrate Git operations in the tutorial project. ```markdown # Demo This is a demo project where you will learn how to commit and push changes, create and merge branches. Refer to `git-features.md` to check the list of Git operations. ``` -------------------------------- ### Install pipenv with pip install --user pipenv Source: https://www.jetbrains.com/help/pycharm/pipenv.html Installs pipenv for the current user. When the installation completes, you will see a confirmation message. ```bash $ pip install --user pipenv ``` -------------------------------- ### JDBC URL examples for Snowflake key pair authentication (Linux, Windows, WSL, macOS) Source: https://www.jetbrains.com/help/pycharm/create-snowflake-data-source-with-key-pair-authentication.html Example JDBC URLs for different platforms. Note the different private key file paths: Linux uses /home/myuser/snowflake/rsa_key.p8, Windows uses С:/Users/myuser/snowflake/rsa_key.p8 (note the Cyrillic С), WSL uses //wsl$/Ubuntu/home/myuser/snowflake/rsa_key.p8, and macOS uses /Users/myuser/snowflake/rsa_key.p8. ```text jdbc:snowflake://myorg-myconnection.snowflakecomputing.com/?warehouse=AUTH_WH&db=TESTDB&schema=MYSCHEMA&user=MYUSERNAME&private_key_file=/home/myuser/snowflake/rsa_key.p8 ``` ```text jdbc:snowflake://myorg-myconnection.snowflakecomputing.com/?warehouse=AUTH_WH&db=TESTDB&schema=MYSCHEMA&user=MYUSERNAME&private_key_file=С:/Users/myuser/snowflake/rsa_key.p8 ``` ```text jdbc:snowflake://myorg-myconnection.snowflakecomputing.com/?warehouse=AUTH_WH&db=TESTDB&schema=MYSCHEMA&user=MYUSERNAME&private_key_file=//wsl$/Ubuntu/home/myuser/snowflake/rsa_key.p8 ``` ```text jdbc:snowflake://myorg-myconnection.snowflakecomputing.com/?warehouse=AUTH_WH&db=TESTDB&schema=MYSCHEMA&user=MYUSERNAME&private_key_file=/Users/myuser/snowflake/rsa_key.p8 ``` -------------------------------- ### Create a React Native application with Expo Source: https://www.jetbrains.com/help/pycharm/react-native.html Commands to create a new React Native application that uses Expo. First, switch to the parent folder where you want to create the application, then run the npx command to start generating the application. The wizard will ask questions, such as whether to install the create-expo-app package or which Expo SDK version to use. ```bash cd ``` ```bash npx create-expo-app@latest ``` -------------------------------- ### Install ios-sim and ios-deploy globally Source: https://www.jetbrains.com/help/pycharm/using-phonegap-cordova.html Install the ios-sim and ios-deploy command-line tools globally to emulate the iOS platform. Run these commands in your command-line shell or the embedded Terminal (Alt+F12). ```shell npm install -g ios-sim ``` ```shell npm install -g ios-deploy ``` -------------------------------- ### Set idea.config.path in idea.properties Source: https://www.jetbrains.com/help/pycharm/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html Set the configuration directory path in the idea.properties file. Use forward slashes, including for Windows paths (for example, C:/idea/system). You can use variables like ${user.home} to specify paths relative to the user's home directory. Do not specify the same directory in different properties, as this may prevent PyCharm from starting. ```properties idea.config.path=${user.home}/MyIdeaConfiguration ``` -------------------------------- ### Install pydevd-pycharm Source: https://www.jetbrains.com/help/pycharm/run-debug-configuration-python-remote-debug.html Install the pydevd-pycharm package to enable remote debugging. The version should match your PyCharm installation. ```bash pip install pydevd-pycharm~=191.3490 ```