Skip to content

Add parameter in tools settings to show error/warning as Link #6270

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

Merged
merged 1 commit into from
Mar 15, 2018

Conversation

DBS06
Copy link
Contributor

@DBS06 DBS06 commented Mar 5, 2018

Description

This feature increases the comfortability of the mbed-cli within an offline IDE.
It allows the developer to jump directly to the error/warning instead of searching for the file and position.

Per default, mbed compile prints errors/warnings on output not in a link format, therefore it is not possible to click, i.e. in an IDE, on the errors/warnings and jump to the position of the file, or even know where (path) it is.
This feature generates an absolute path, because some IDEs are not parsing relatives paths correctly (i.e. VSCode).

In the linked picture, a compare between the default compile output and the newly one with the link is visualized.
compare mbed compile output

It is possible to activate/deactive the feature by setting this define
PRINT_COMPILER_OUTPUT_AS_LINK = False
in the application specific "mbed_settings.py" to true

Status

READY

Migrations

I think nothing has to be changed, it just makes the error/warning output from "mbed-cli compile" more useful in an offline IDE.

NO

Steps to test or reproduce

Insert in the application specific "mbed_settings.py":
PRINT_COMPILER_OUTPUT_AS_LINK = True

Start mbed compile with:
mbed compile -t GCC_ARM
note: mcu (TARGET) must/should be configured in ".mbed"

Per default mbed compile prints errors/warnings on output not in a link format, therefore it is not possible to click, i.e. in an IDE, on the errors/warnings and jump to the position in the file.

The settings parameter lets you decide in witch format do you want to have it.
If it is enabled then the output will look like:
[Error/Warning] [absolute\path\to\file.ext]:[line]:[column]: [msg]

with this format nearly every common known IDE can deal with this link and lets you jump to the file
Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks.

@theotherjimmy
Copy link
Contributor

@cmonr Are we in a CI freeze right now?

@cmonr
Copy link
Contributor

cmonr commented Mar 5, 2018

@theotherjimmy Nope!

/morph build

@cmonr
Copy link
Contributor

cmonr commented Mar 6, 2018

...
/morph build

@cmonr
Copy link
Contributor

cmonr commented Mar 6, 2018

Also, @DBS06, would you mind signing the CLA: https://developer.mbed.org/contributor_agreement/ ?

@DBS06
Copy link
Contributor Author

DBS06 commented Mar 6, 2018

Of course not, but I already did it ☺

@mbed-ci
Copy link

mbed-ci commented Mar 6, 2018

Build : SUCCESS

Build number : 1370
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6270/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Mar 7, 2018

@mbed-ci
Copy link

mbed-ci commented Mar 7, 2018

Test : FAILURE

Build number : 1151
Test logs :http://mbed-os-logs.s3-website-us-west-1.amazonaws.com/?prefix=logs/6270/1151

@DBS06
Copy link
Contributor Author

DBS06 commented Mar 7, 2018

I looked into the test which failed, but I didn't understand which assertion failed and why... :-(

@cmonr
Copy link
Contributor

cmonr commented Mar 7, 2018

@DBS06 Thanks for taking a look. Unfortunately, this is an intermittent issue that we're still working to root cause.

/morph test

(Fyi @studavekar )

@DBS06
Copy link
Contributor Author

DBS06 commented Mar 8, 2018

@cmonr good to know, seems to be a really weird issue...

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 8, 2018

/morph test
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Mar 9, 2018

Test : SUCCESS

Build number : 1176
Test logs :http://mbed-os-logs.s3-website-us-west-1.amazonaws.com/?prefix=logs/6270/1176

@@ -74,7 +77,7 @@
# User Settings (env vars)
##############################################################################
_ENV_PATHS = ['ARM_PATH', 'GCC_ARM_PATH', 'GCC_CR_PATH', 'IAR_PATH',
'ARMC6_PATH']
'ARMC6_PATH', 'PRINT_COMPILER_OUTPUT_AS_LINK']
Copy link
Contributor

Choose a reason for hiding this comment

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

@theotherjimmy Is this the right location for this new variable to be defined?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

_ENV_PATHS should be named _ENV_PARAMETERS or similar.

Copy link
Contributor

Choose a reason for hiding this comment

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

Neat. We'll save that renaming for a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also wondered at typing this specific line of code, if this would be the right location :-) I also thought about it to rename the variable right away, but come to the conclusion that this should be a separate PR.

@cmonr cmonr merged commit 0828727 into ARMmbed:master Mar 15, 2018
DBS06 pushed a commit to evva-sfw/mbed-os that referenced this pull request May 23, 2018
PR ARMmbed#6270 added a parameter which allows the user to decide in case of an error or warning to print the output as a link.
This extension of this option also prints the ARM-GCC output in a link format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants