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

Build support #3826

Closed
egamma opened this issue Mar 8, 2016 · 15 comments
Closed

Build support #3826

egamma opened this issue Mar 8, 2016 · 15 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded

Comments

@egamma
Copy link
Member

egamma commented Mar 8, 2016

From @JanKok on March 8, 2016 8:36

I'm trying to do C code development using gcc and make and using WebFreak001's gdb debugger extension. I added "preLaunchTask": "make" to launch.json and

{
    "version": "0.1.0",
    "command": "make",
    "isShellCommand": false,
    // Show the output window only if unrecognized errors occur.
    "showOutput": "always", //"silent",

    // use the standard tsc problem matcher to find compile problems
    // in the output.
    "problemMatcher": "$tsc"
}

in tasks.json and now make runs each time I click start, which is pretty good. But,

  1. If there are compile errors (resulting in make returning an error value), Code doesn't stop. It tries to run the program anyway.
  2. The make output window appears momentarily but is replaced with the debug console (which BTW displays the cryptic message undefined=thread-group-added,id="i1"). I'd like the output window to remain visible if there are make errors.
  3. F8, Ctrl-Shift-M etc., don't work to let me visit the errors in my source code. What does it take to make that work?

Copied from original issue: microsoft/vscode-docs#215

@egamma
Copy link
Member Author

egamma commented Mar 8, 2016

  1. If there are compile errors (resulting in make returning an error value), Code doesn't stop. It tries to run the program anyway.

Does the problem matcher work and return the errors properly. You can test this by opening View > Show Errors and Warnings.

@isidorn @dbaeumer any other ideas?

@weinand weinand added the info-needed Issue requires more information from poster label Mar 8, 2016
@isidorn
Copy link
Contributor

isidorn commented Mar 8, 2016

  1. Works with the VSCode February release, thus if a task returns an error code we will not launch the program. If the task is a watch task there was an issue that is fixed and will be availbe in the March release

Here are the related issues which are fixed:
#2370
#3626

@JanKok
Copy link

JanKok commented Mar 8, 2016

@egamma > Does the problem matcher work and return the errors properly. You can test this by opening View > Show Errors and Warnings.

View > Errors and Warnings brings up the input window at the top of the Code window and on the line below that it says No errors or warnings.

@isidorn Is the March release available yet? According to https://code.visualstudio.com/docs?dv=linux64 February is the latest. I'll be happy to try out the latest if you tell me how to get it.

By the way, the February download file I have is named VSCode-linux-x64-stable.zip. Shouldn't there be a version number in the name so one can tell the releases apart?

@isidorn
Copy link
Contributor

isidorn commented Mar 8, 2016

@JanKok I got the months confused in my previous comment. I updated the comment now, so in february it should work, but the watch task bug will be fixed in march release

@JanKok
Copy link

JanKok commented Mar 8, 2016

What should work? F8 doesn't step through the gcc errors. Should I use a different problem matcher?

@isidorn
Copy link
Contributor

isidorn commented Mar 8, 2016

Sorry for not being clear, the following should work: if a task returns an error code VSCode will not launch the program.

@JanKok
Copy link

JanKok commented Mar 8, 2016

That's not what I'm seeing, as I reported in item #1 above. If I edit an error into my C program and hit the start button in Code, make runs and returns error code 2. The Code goes on and tries to run the program.

@isidorn
Copy link
Contributor

isidorn commented Mar 8, 2016

Does the task finish - if yes, then it would be great if you could create a new issue and if you could include a minimal repository for which you can reproduce this so we investigate.
If the task is a watching task which does not finish - this will be fixed in the next vscode release

@JanKok
Copy link

JanKok commented Mar 8, 2016

The make task finishes with a return code = 2. If Code is testing for return code == 1 (the usual Unix error return code) then that might explain why Code isn't stopping on the error. Other than that, I don't think I'm doing anything at all special. I'll open a new issue for this tonight if you haven't already resolved it by then. :-)

@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues and removed info-needed Issue requires more information from poster labels Mar 9, 2016
@isidorn
Copy link
Contributor

isidorn commented Mar 9, 2016

  1. No, we are testing for return code > 1. If you can create a new issue with your repository so we can investigate. Edit: great I see you created launch occurs even if preLaunchTask fails #3895 - thanks
  2. The output window will remain visible if debug does not start
  3. This is because the task frameworkd does not recognize the errors from your task -> forwading to Dirk

@isidorn isidorn assigned dbaeumer and unassigned isidorn Mar 9, 2016
@JanKok
Copy link

JanKok commented Mar 9, 2016

With VSCode v0.10.10 items 1 & 2 are OK now, but I'm still having problem with 3. Thanks.

@isidorn
Copy link
Contributor

isidorn commented Mar 9, 2016

Thanks for trying it with the latest VSCode

@dbaeumer
Copy link
Member

dbaeumer commented Mar 9, 2016

@JanKok to get the problem in VSCode you need to define a problem matcher. The one you have configured is the one for the tsc compiler which will for sure not capture C problems. See the documentation here http://code.visualstudio.com/docs/editor/tasks#_defining-a-problem-matcher on how to configure a problem matcher for gcc. This could be used as a starting point.

@dbaeumer dbaeumer closed this as completed Mar 9, 2016
@JanKok
Copy link

JanKok commented Mar 11, 2016

Thanks @dbaeumer The code at defining-a-problem-matcher works as a starting point - and an ending point, i.e. it works fine without modifications! :-)

Instead of creating a separate Ctrl-Shift-M menu of errors, could you make it so the user can just click on the error messages in the output window? That would feel more similar to how it's done in both Emacs and Visual Studio.

@isidorn
Copy link
Contributor

isidorn commented Mar 11, 2016

We plan to improve our error list experience in the future.

@dbaeumer dbaeumer added the verified Verification succeeded label May 27, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants