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

fix cpp task labels and ensure they can be run #6419

Merged
merged 1 commit into from
Oct 24, 2019
Merged

Conversation

elaihau
Copy link
Contributor

@elaihau elaihau commented Oct 20, 2019

This pull request fixes the following problems:

  • cpp task labels are displayed as "undefined: xxxx" and it is wrong
  • Theia always fails to run tasks defined in cpp extension. When they are started from the "Run Task", users either get "launch config not found" error, or an exception that says "Error attaching to terminal".

fixed #6204

How to test

  1. define cpp build task(s) in the preference editor
  2. open the "Terminal -> Run Task" from top menu bar and check if the task label(s) are correct
  3. start the defined cpp build task(s) to check if they can be run

Peek 2019-10-20 10-02

Review checklist

This pull request fixes the following problems:
- cpp task labels are displayed as "undefined: xxxx" and it is wrong
- Theia always fails to run tasks defined in cpp extension. When they are started from the "Run Task", users either get "launch config not found" error, or an exception that says "Error attaching to terminal".

fixed #6204
@akosyakov akosyakov added cpp issues related to the C/C++ language tasks issues related to the task system labels Oct 21, 2019
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

It works well for me, I do not see undefined as a title any longer, and the tasks themselves can now execute successfully! 👍 I verified existing tasks in tasks/test-resources and they work correctly as well.

I'll let @lmcbout try it out as well.

Copy link
Contributor

@lmcbout lmcbout left a comment

Choose a reason for hiding this comment

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

Question 1:
When I run a task from "tasks.json" you ask for the "problem matcher" configuration, then you adjust it in the "tasks.json" file. So for the next run, no question asked.
When I create a task from the preference ( cpp.buildConfigurations ), it is created as a "Detected task", but when calling "Terminal -> Run task", you keep asking which "problem matcher" to use, you don't save the information inside the preference setting, is it supposed to work like this ?

Question 2:
From the "Quick menu item" for the detected task, you have the "settings button" at the end of the line, but nothing happen for the detected task when selecting it, is it normal? For a task define in "tasks.json", you open the file "tasks.json" so should we open the preference setting for the detected task ?

@vince-fugnitto
Copy link
Member

Question 1:
When I run a task from "tasks.json" you ask for the "problem matcher" configuration, then you adjust it in the "tasks.json" file. So for the next run, no question asked.
When I create a task from the preference ( cpp.buildConfigurations ), it is created as a "Detected task", but when calling "Terminal -> Run task", you keep asking which "problem matcher" to use, you don't save the information inside the preference setting, is it supposed to work like this ?

This is only true for the cpp build config. Other detected tasks do not behave the same way and their problemMatcher preference is stored in their respective tasks.json. I'm not sure what we can do differently only for the cppBuildConfigurations. Ideally I would have liked to separate the preference into it's own file and do more custom changes.

Question 2:
From the "Quick menu item" for the detected task, you have the "settings button" at the end of the line, but nothing happen for the detected task when selecting it, is it normal? For a task define in "tasks.json", you open the file "tasks.json" so should we open the preference setting for the detected task ?

I believe this is correct, the detected task is already defined in the settings.json which can support tasks. Correct me if I'm wrong @elaihau. The difference is that other detected tasks do not act the same way, but for the cpp extension, things are different.

@elaihau
Copy link
Contributor Author

elaihau commented Oct 21, 2019

Hi @lmcbout, thank you for the review!

cpp tasks are different from others in nature: unlike the regular detected tasks that we know which root fold they come from, cpp tasks are defined in preference and not bound to any root folders. If you take a closer look at the GIF I attached to the “how to test” session, you would find the “directory” property was set “/home/elaihau/dev”, a folder that is not even part of my workspace.

I understand that it is more consistent to save the user-chosen problem matchers somewhere so users don’t get prompted every time the task is started, but unfortunately I really have no idea where could that information be kept.
Do you have any suggestions?

Copy link
Contributor

@lmcbout lmcbout left a comment

Choose a reason for hiding this comment

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

@elaihau I have no suggestion for the moment, but we should keep it in mind.

@elaihau elaihau merged commit c9f3a63 into master Oct 24, 2019
@elaihau elaihau deleted the Liang/cpp_task branch October 24, 2019 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cpp issues related to the C/C++ language tasks issues related to the task system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cpp build task does not work
4 participants