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

Add debug configuration for the first time is hard coded to use .theia folder #5634

Closed
amiramw opened this issue Jul 4, 2019 · 2 comments · Fixed by #5678
Closed

Add debug configuration for the first time is hard coded to use .theia folder #5634

amiramw opened this issue Jul 4, 2019 · 2 comments · Fixed by #5678
Labels
bug bugs found in the application debug issues that related to debug functionality

Comments

@amiramw
Copy link
Member

amiramw commented Jul 4, 2019

Description

when you add debug configuration for the first time it also ignores the preference (.vscode and .theia folders): https://github.com/theia-ide/theia/blob/af00d42b3d71b0d0b723cb970fefafb9c8500281/packages/debug/src/browser/debug-configuration-manager.ts#L255

Reproduction Steps

  1. Clean .vscode or .theia folder from the workspace if there is any
  2. Override preference configuration to getPaths return only .vscode
  3. Run command add debug configuration
  4. The configuration is created anyway in .theia folder due to the hard coded name in the code above

OS and Theia version: All

Diagnostics:
N/A

Question:

If I want to fix it what is the correct API to call? Is it PreferenceConfigurations.getPaths()[0] or is there any abstraction on top of it that I should use?

@akosyakov akosyakov added bug bugs found in the application debug issues that related to debug functionality labels Jul 5, 2019
@akosyakov
Copy link
Member

One does not need to override anything to reproduce the issue, it should also work in the following case:

  • make sure that .theia folder does not contain any settings
  • create .vscode folder and settings file in it
  • try to add a new launch configuration
  • since there is only vscode settings, launch file should be created in .vscode folder

We have such logic already when we use PreferenceService to set preferences. Maybe we can reuse it somehow.

@akosyakov
Copy link
Member

@amiramw maybe just for your use case we can replace hardcoded variable with the first path? then it should work for you? Could you make a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application debug issues that related to debug functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants