Skip to content

Task Provider Feature#5659

Merged
elahehrashedi merged 65 commits into
masterfrom
elrashed/3674_2
Sep 22, 2020
Merged

Task Provider Feature#5659
elahehrashedi merged 65 commits into
masterfrom
elrashed/3674_2

Conversation

@elahehrashedi

@elahehrashedi elahehrashedi commented Jun 18, 2020

Copy link
Copy Markdown
Contributor

#3674 : Add support to run cpp build tasks (Tasks: Run Build Task)

Will also fix these bugs:
#4278
#5285
#4278
#5270

Edited:
Refactoring the Task tools: Task: Configure Task and Task: Run Build Task, and C/C++: Build and Debug Active File
The multi-root is not implemented in this version yet.
You have to use the insider Vs Code to test the proposed API for this feature (1.49.0-insider).

These are the behavior of the current version:

when Task: Run Build Task is called:

  1. If there is a tasks.json file exists:
  • if there is a default build task: the default build task will be run (no task will be shown to the user to choose from).
    image

  • if there is NO default task: The list of all defined tasks in tasks.json will be shown to the user to choose from.
    image

  1. If tasks.json file doesn't exist:
  • the detected build tasks will be shown to the user to choose from. no tasks.json will be created.
    image

P.S. right now only Task: Configure Task and C/C++: Build and Debug Active File can create a tasks.json file for the first time.

Comment thread Extension/src/LanguageServer/cppbuildTaskProvider.ts Outdated
Comment thread Extension/src/LanguageServer/cppbuildTaskProvider.ts Outdated

@sean-mcmanus sean-mcmanus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not finished reviewing...

Comment thread Extension/package.json Outdated
Comment thread Extension/package.json Outdated
Comment thread Extension/package.json Outdated
Comment thread Extension/package.nls.json Outdated
Comment thread Extension/src/Debugger/configurationProvider.ts Outdated
Comment thread Extension/src/LanguageServer/cppbuildTaskProvider.ts Outdated
Comment thread Extension/src/LanguageServer/cppbuildTaskProvider.ts Outdated
Comment thread Extension/src/LanguageServer/cppbuildTaskProvider.ts Outdated
Comment thread Extension/src/LanguageServer/extension.ts
Comment thread Extension/src/LanguageServer/cppbuildTaskProvider.ts Outdated
@sean-mcmanus

sean-mcmanus commented Jun 19, 2020

Copy link
Copy Markdown
Contributor

I'm seeing an issue when there are spaces in the ${file} path. I'm not able to get mingw or cl.exe to work. When the workspace folder is named "New folder", I get cl : Command line warning D9024 : unrecognized source file type 'folder', object file assumed . That scenario works with 0.28.3.

Comment thread Extension/src/LanguageServer/cppbuildTaskProvider.ts Outdated
@sean-mcmanus

sean-mcmanus commented Jun 19, 2020

Copy link
Copy Markdown
Contributor

Build errors are not reported:

Build finished with error:
        Command failed: 

I think we would need to implement our own problem matcher to report the errors and/or forward the results to the terminal?

@sean-mcmanus

sean-mcmanus commented Jun 19, 2020

Copy link
Copy Markdown
Contributor

Also, I'm seeing unusual tab and newline behavior in the terminal output with cl.exe.

image

This is the 0.28.3 result:
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.28919.3 for x86
Copyright (C) Microsoft Corporation. All rights reserved.

test2.c
...\Test1\test2.c(5): error C2143: syntax error: missing ';' before '}'

@sean-mcmanus sean-mcmanus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@elahehrashedi

Copy link
Copy Markdown
Contributor Author
  • A sample results of a compiler error (the file name includes Space as well):
    image
    image

Comment thread Extension/package.json Outdated
"preview": true,
"icon": "LanguageCCPP_color_128x.png",
"readme": "README.md",
"enableProposedApi": true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can't check in this line

@elahehrashedi
elahehrashedi requested review from Colengms and removed request for Colengms September 21, 2020 19:39
@elahehrashedi elahehrashedi removed this from the 1.1.0 milestone Sep 22, 2020
@elahehrashedi
elahehrashedi merged commit 40e28c2 into master Sep 22, 2020
"c_cpp.taskDefinitions.command.description": "The path to either a compiler or script that performs compilation.",
"c_cpp.taskDefinitions.args.description": "Additional arguments to pass to the compiler or compilation script.",
"c_cpp.taskDefinitions.options.description": "Additional command options.",
"c_cpp.taskDefinitions.name.description": "The name of the task",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should these periods have remained?

@elahehrashedi
elahehrashedi deleted the elrashed/3674_2 branch October 5, 2020 11:26
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants