redhat-developer / redhat-developer/lsp4ij

Support PyCharm's built-in macros in DAP configuration fields (especially File)

Open
#1,669 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
344
Forks
113
Avg merge
5h 22m
Merged PRs (30d)
15

Description

I'm trying to make a Run/Debug Configuration for a Debug Adapter Protocol (in launch mode) that uses whatever file the editor is focused on (rather than hardcoding a specific path that I need to change every time I jump to a different file). This should be possible using PyCharm built-in macros (e.g., $FilePath$), but they only work in a few places (and not where I need them).

Partial support seems to already exist - built-in macros can be used as expected on the Server tab:
Image

However, those same macros don't work anywhere on the Configuration tab:
Image

Explanation of image annotations:

  1. $ContentRoot$ is specified in the Working Directory field.
  2. ${workspaceFolder} (a different kind of macro?) is specified in the DAP parameters field.
    • Note: this kind of macro works as expected.
  3. $FilePath$ is specified directly in the DAP parameters field.
  4. When the launch request is sent to the DAP server, both built-in macros ultimately remain unexpanded.

Please extend support for PyCharm's built-in macros to the Configuration tab (ideal), or at least allow something like $FilePath$ in the File and/or DAP parameters field.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the DAP launch configuration handles the Configuration tab's File, Working Directory, and DAP parameters fields, then compare it with the existing macro expansion on the Server tab. Reproduce the launch request using $FilePath$ and $ContentRoot$; done means the selected PyCharm file and other built-in macros are expanded before the request is sent.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.