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
Block Comments should force a new line, else they're treated as line comments #31
Comments
I'm not sure this can be done outside of the extension without an enhancement from the core. Per some similar issues like this one:
In theory this should also be able to handle block comment openings/closures defined with line breaks, as in your example, but as currently implemented it's not handling it properly and I'm not literate enough in the language to figure out where it's going wrong. I think it's worth an issue on the VSCode repo. This can be implemented at the extension level but it would end up being a separate command from VSCode's. |
Before, adding block comments was not adding the comments correctly. It was adding block comments that were not in a correct format for Matlab. As proposed by @CelsoReyes in #31, I've added line breaks before and after the %{ and %} characters. This makes the block comments be recognized correctly by Matlab, but has the unfortunate drawback that we cannot remove them correctly. Unfortunately that's all we can do for now.
I've updated the extension with your proposal @CelsoReyes, I find it better than the previous behavior. I'm keeping the issue open for now, since it's not completely fixed. I'm putting it on hold though, because as @sco1 has explained, it's an issue related to how VSCode is managing those block comments. I've opened an issue on VSCode's repository: microsoft/vscode#48074 I'm putting this issue on hold until we know if that will be fixed. |
Thanks @Gimly tackling this! side note: Thanks for the acknowledgement, though my last name is misspelled in the release notes. Reyes (not Reys). |
Oops, sorry about the misspelling, will fix that in the next release.
Le mer. 18 avr. 2018 à 09:40, Celso <notifications@github.com> a écrit :
… Thanks @Gimly <https://github.com/Gimly> tackling this!
side note: Thanks for the acknowledgement, though my last name is
misspelled in the release notes. Reyes (not Reys).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#31 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKS3bGmqZmLIn2wmySL0n4TT-dY2abTks5tpu3qgaJpZM4RReGy>
.
|
With version 1.0 we've updated the syntax highlighting syntax which might have been the cause of the issue. Could you please tell me if you still experience the issue with that version? |
It seems to work fine. But it adds 2 blank lines and doesn't indent the comments (except for the first one). I tested on vs-code for Windows. Result: % here follows code, the first line of which I'd like to block comment
%{
disp(a)
disp(b)
%}
disp(c) Expected: % here follows code, the first line of which I'd like to block comment
%{
disp(a)
disp(b)
%}
disp(c) |
Hi,
I really enjoy your Matlab Extension. I find VSCode's editing capabilities far outpace Matlab's editor.
I noticed this anomaly while checking out various VSCode keyboard shortcuts.
How to reproduce:
select the first two disp(...) commands
Toggle block comment (on mac, shift-alt-A)
Result:
Expected:
Reasoning
MATLAB only understands block comments when they're alone on a line (with the exception of whitespace) In this particular case, the first line is treated as though it had the typical line comment. The second line is interpreted by MATLAB as though it ends with a commented-out closing brace.
What I tried:
By modifying the
matlab.configuration.json
file, I could add the line feeds, but then the line comment no longer toggled back off. Still, this behavior might be preferable to the existing behavior.side note: even MATLAB (r2017a) doesn't seem to have a shortcut key combo for this feature
The text was updated successfully, but these errors were encountered: