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

automated creation of config file WebStorm to use debugging #1073

Open
DutchmanNL opened this issue Nov 10, 2023 · 0 comments
Open

automated creation of config file WebStorm to use debugging #1073

DutchmanNL opened this issue Nov 10, 2023 · 0 comments

Comments

@DutchmanNL
Copy link

As discussed on our Telegram Dev-Chat and support, please add basic configuration for Webstorm IDE to handle debugging of Dev-Server.
Webstorm stores all its configuration files in ".idea/workspace.xml"

this part is needed to have an NodeJS debugger which start the Proces & attacks to its stream.

JS:

  <component name="RunManager" selected="Node.js.linked">
    <configuration name="adapterRun" type="NodeJSConfigurationType" application-parameters="--force --instance 0 --logs --debug" node-parameters="--preserve-symlinks --preserve-symlinks-main" path-to-js-file="node_modules/>AdapterNameSpace</build/main.js" working-dir="$PROJECT_DIR$/.dev-server/default/">
      <method v="2" />
    </configuration>
    <list>
      <item itemvalue="Node.js.linked" />
    </list>
  </component>

ts:

  <component name="RunManager" selected="Node.js.linked">
    <configuration name="adapterRun" type="NodeJSConfigurationType" application-parameters="--force --instance 0 --logs --debug" node-parameters="--preserve-symlinks --preserve-symlinks-main" path-to-js-file="node_modules/>AdapterNameSpace</build/main.js" working-dir="$PROJECT_DIR$/.dev-server/default/">
      <method v="2" />
    </configuration>
    <list>
      <item itemvalue="Node.js.linked" />
    </list>
  </component>

So an empty config XML looks like:

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
</project>

we need an entry in "" (which can be multiple) based on the examples I provided above

If you also would like to an and "AttachNodeJS debugger", so were you start the adapter manually and attach to the running proces, this configuration can be added to attach to the proces

    <configuration name="attachAdapter" type="ChromiumRemoteDebugType" factoryName="Chromium Remote" port="9229">
      <method v="2" />
    </configuration>

As last item, to be able to have a list of these items, we need to add

    <list>
      <item itemvalue="Attach to Node.js/Chrome.attachAdapter" />
      <item itemvalue="Node.js.adapterRun" />
    </list>

a complete config file with all these attribute would look like this:

JS: (for TS link must be set to build folder

<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
    <component name="RunManager" selected="Node.js.adapterRun">
        <configuration name="attachAdapter" type="ChromiumRemoteDebugType" factoryName="Chromium Remote" port="9229">
            <method v="2" />
        </configuration>
        <configuration name="adapterRun" type="NodeJSConfigurationType" application-parameters="--force --instance 0 --logs --debug" node-parameters="--preserve-symlinks --preserve-symlinks-main" path-to-js-file="node_modules/>AdapterNameSpace</main.js" working-dir="$PROJECT_DIR$/.dev-server/default/">
            <method v="2" />
        </configuration>
        <list>
            <item itemvalue="Attach to Node.js/Chrome.attachAdapter" />
            <item itemvalue="Attach to Node.js/Chrome.genericDev" />
            <item itemvalue="Node.js.adapterRun" />
        </list>
    </component>
</project>
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

No branches or pull requests

1 participant