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

Octave support #206

Closed
daniel-molina opened this issue Jun 6, 2020 · 1 comment
Closed

Octave support #206

daniel-molina opened this issue Jun 6, 2020 · 1 comment

Comments

@daniel-molina
Copy link

Hello,

It would be nice to have Octave support. Octave should be equivalent to Matlab but # is also a valid comment character. From Octave documentation:

In the Octave language, a comment starts with either the sharp sign character, ‘#’, or the percent symbol ‘%’ and continues to the end of the line.

I read #72 and it seems that no support was added for %% in Matlab. According to Octave style guide (Comments section), used to develop Octave itself, I think ## should be wrapped too:

Comments that start with a single sharp-sign, #, are used to explain the code on the same line as the comment itself. These comments should all be aligned to the same column to the right of the source code.

Comments that start with a double sharp-sign, ##, are stand-alone comments that occupy an entire line. These comments should be aligned to the same level of indentation as the code. Such comments usually describe the purpose of the following lines or the state of the program at that point.

A note about %! can be found in the previous link too.

stkb added a commit that referenced this issue Jun 15, 2020
Octave has some special rules meaning it can't just be supported via an
extension.
- Either `%` or `#` can be used for line comments and either `%{ ... %}`
  or `#{ ... #}` for block comments.
- According to the style guide, `##` can be used for whole-line comments
  as opposed to end-of-line comments
  (https://wiki.octave.org/Octave_style_guide#Comments).
- The `%!` combination is however excluded since this is for test and
  demo blocks. The content of these is generally code so shouldn't be
  wrapped (https://wiki.octave.org/Tests).
- However, it would be good if we could support comments inside the code
  inside these "comments", once we have the capability.

Octave uses the .m file extension (like MATLAB) but this isn't added
since it's already taken by Objective-C. Since vanilla VSCode sees .m
files as Objective-C, an Octave language extension is required to pass
in the "octave" language id to Rewrap.

Another note: it's not required in F# strings to always double-up
backslashes if the character after it doesn't form one of the known
escape sequences.
@stkb stkb added the in pre-release version Is in pre-release version but not in stable yet label Jun 15, 2020
@stkb
Copy link
Owner

stkb commented Jun 20, 2020

This is now in v1.12.0. The content of %! blocks is not wrapped. It would be nice to still wrap comments in those blocks though, and I've added #215 to track that feature.

@stkb stkb closed this as completed Jun 20, 2020
@stkb stkb removed the in pre-release version Is in pre-release version but not in stable yet label Jun 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants