-
Notifications
You must be signed in to change notification settings - Fork 3k
Add parameter in tools settings to show error/warning as Link #5948
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
Conversation
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.
User not whitelisted, CI not run. |
The change seems fine. I would also like to see an environment variable method for configuring this feature. With the env-var, we could have a |
Nice idea, but how do I add a new environment variable? How does it get parsed from ".mbed"? |
@DBS06 The The other environment variables are setup in line 82 of settings.py (on your branch). You could look at that code for inspiration, or add your var's name to the |
@theotherjimmy Hi I'm taking over from Philipp since he is on vacation. Well I tried your suggestion and it doesn't work. The reason behind this is the follwing code in the mbed cli (as I found out recently): def get_env(self):
env = os.environ.copy()
env['PYTHONPATH'] = os.path.abspath(self.path)
compilers = ['ARM', 'GCC_ARM', 'IAR', 'ARMC6']
for c in compilers:
if self.get_cfg(c+'_PATH'):
env['MBED_'+c+'_PATH'] = self.get_cfg(c+'_PATH') So as you can see only the variable names which are within the compilers list are going to be defined as environment variables from the .mbed file. Therefore we would also need to adapt the mbed cli if you want this feature. |
@EmbedEngineer Github killed that code formatting. You should start the block with: I'm suggesting that this change be made compatible with a future change to Mbed CLI that would "do the right thing"(tm) and specify that option as an env var. I apologize for misleading you. |
@theotherjimmy Thank you for fixing my post and no worries. I will implement the config feature then to work with future version of the mbed CLI. |
@DBS06 Do you need any assistance with this PR? (rebase is needed once updated) |
Please reopen with an update |
Hi, I am back from my travel, and should I create a new Pull Request or should I create new branch or should I just update the branch? |
for future use (mbed-cli) an environment variable was created to activate/deactivate this setting with the cli. Therefore the mbed-cli must be adapted. Also this setting was add to default_settings.py.
@DBS06 Updating the branch is fine/expected. Github handles rebases poorly, but we're used to it. |
Superseded by #6270 |
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 --profile release
note: mcu (TARGET) must/should be configured in ".mbed"