-
Notifications
You must be signed in to change notification settings - Fork 16
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
[BUG] Formating comment lines #110
Comments
Looking at the code that handles formatting, comment lines should already be ignored. I use a zero margin in my own user settings, so haven't noticed what you're reporting. I'll take a look at what might be causing this "regression". |
Could we have a workspace setting that would indent comments to the level of the associated code, left justified or to a comment margin which would likely be set to 0? This might require two settings if comment margin is an option.
From: Kevin Powick <[email protected]>
Reply-To: mvextensions/mvbasic <[email protected]>
Date: Friday, June 12, 2020 at 8:51 AM
To: mvextensions/mvbasic <[email protected]>
Cc: Subscribed <[email protected]>
Subject: Re: [mvextensions/mvbasic] [BUG] Formating comment lines (#110)
Looking at the code that handles formatting, comment lines should already be ignored. I use a zero margin in my own user settings, so haven't noticed what you're reporting.
I'll take a look at what might be causing this "regression".
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#110 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACOODLYWI3PW56UAX5GFJ5DRWIXGTANCNFSM4N4KWCFQ>.
|
@dthiot That's an interesting idea. If it's something you would like to see, would you please enter it as a new enhancement request? Otherwise, it may get lost in the comments thread of this issue. |
I’m happy to create the enhancement request. I just thought I would float the idea first for discussion. I’ll create the request.
From: Kevin Powick <[email protected]>
Reply-To: mvextensions/mvbasic <[email protected]>
Date: Friday, June 12, 2020 at 8:59 AM
To: mvextensions/mvbasic <[email protected]>
Cc: Dick Thiot <[email protected]>, Mention <[email protected]>
Subject: Re: [mvextensions/mvbasic] [BUG] Formating comment lines (#110)
@dthiot<https://github.com/dthiot> That's an interesting idea. If it's something you would like to see, would you please enter it as a new enhancement request? Otherwise, it may get lost in the comments thread of this issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#110 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACOODL2GVYN73QH5MWGDT4TRWIYEZANCNFSM4N4KWCFQ>.
|
Thanks, @dthiot ! I get what you're saying and hope I didn't give the impression that I was trying to dismiss your idea or put you off. It makes sense to ask, right? Why bother creating a new request if nobody is really interested? I was just trying to preemptively keep the comments on this issue from drifting into a discussion not specifically on topic for it. For example, participants agree that your idea is a good one, then start discussing how it should be implemented, options available, naming conventions, etc. |
While on the issue of formatting comments, wED has two comment settings: one for '*' comments and one for '!' comments. Each can be set to indent none, margin or code level. No special formatting is provided for REM statements. |
@brentlblair This issue is resolved. Comment lines are now ignored when it comes to indentation. This actually used to be the case, and I'm still trying to figure out where this "regression" crept in. Maybe @itsxallwater can produce a hotfix for this? I'm not sure if an entirely new release is needed. I suppose I should figure out how to build a VSIX file. |
I think I'd like this feature toggled to be honest. I tend to keep comments indented with code. I could be in the minority (or alone altogether) but this feels like the kind of thing that we'd be better served to make an option. |
Re: building a vsix I've got you covered @kpowick! Check this: #96 (comment) |
I agree with making this a setting. You will never get everyone to agree
on a coding style. I forgot that WED had the 3 settings for comments. I
think the default is no indent, so that's what I have always used.
*Brent Blair* <http://www.linkedin.com/in/BrentLBlair>
Vice President of IT
Encompass
Phone 954.474.0300
Fort Lauderdale, FL
<https://www.google.com/maps/place/Encompass+Parts+Distribution/@26.145357,-80.2482168,12.46z/data=!4m5!3m4!1s0x0:0xb2bfe23d3412449!8m2!3d26.0920996!4d-80.2409538>
[email protected]
encompass.com
…On Fri, Jun 12, 2020 at 10:59 AM Mike Wright ***@***.***> wrote:
I think I'd like this feature toggled to be honest. I tend to keep
comments indented with code. I could be in the minority (or alone
altogether) but this feels like the kind of thing that we'd be better
served to make an option.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#110 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFRDR4O4N2Q6TSNFFHMWHVLRWI7GPANCNFSM4N4KWCFQ>
.
|
I like Pete’s suggestion of the way that he does it on Accuterm in terms of none, margin or code. I think that margin is the standard indent margin, right? That means only one workspace parameter required.
From: Mike Wright <[email protected]>
Reply-To: mvextensions/mvbasic <[email protected]>
Date: Friday, June 12, 2020 at 9:59 AM
To: mvextensions/mvbasic <[email protected]>
Cc: Dick Thiot <[email protected]>, Mention <[email protected]>
Subject: Re: [mvextensions/mvbasic] [BUG] Formating comment lines (#110)
I think I'd like this feature toggled to be honest. I tend to keep comments indented with code. I could be in the minority (or alone altogether) but this feels like the kind of thing that we'd be better served to make an option.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#110 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACOODL76HPCSETBX42TUFQDRWI7GPANCNFSM4N4KWCFQ>.
|
@itsxallwater I like my comments aligned with code as well, and the latest commit to |
Feature request submitted. Please feel free to modify. I have suggested 4 options instead of Pete’s 3. None means that comments are left in place. Left means that comments are moved to the left edge. Margin and code remain the same as Accuterm.
From: Brent Blair <[email protected]>
Reply-To: mvextensions/mvbasic <[email protected]>
Date: Friday, June 12, 2020 at 10:04 AM
To: mvextensions/mvbasic <[email protected]>
Cc: Dick Thiot <[email protected]>, Mention <[email protected]>
Subject: Re: [mvextensions/mvbasic] [BUG] Formating comment lines (#110)
I agree with making this a setting. You will never get everyone to agree
on a coding style. I forgot that WED had the 3 settings for comments. I
think the default is no indent, so that's what I have always used.
*Brent Blair* <http://www.linkedin.com/in/BrentLBlair>
Vice President of IT
Encompass
Phone 954.474.0300
Fort Lauderdale, FL
<https://www.google.com/maps/place/Encompass+Parts+Distribution/@26.145357,-80.2482168,12.46z/data=!4m5!3m4!1s0x0:0xb2bfe23d3412449!8m2!3d26.0920996!4d-80.2409538>
[email protected]
encompass.com
On Fri, Jun 12, 2020 at 10:59 AM Mike Wright ***@***.***> wrote:
I think I'd like this feature toggled to be honest. I tend to keep
comments indented with code. I could be in the minority (or alone
altogether) but this feels like the kind of thing that we'd be better
served to make an option.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#110 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFRDR4O4N2Q6TSNFFHMWHVLRWI7GPANCNFSM4N4KWCFQ>
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#110 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACOODL6J77FRBYTUOFZTTV3RWI7W5ANCNFSM4N4KWCFQ>.
|
@itsxallwater Thanks for that. I've got a vsix for the extension (still at 2.0.8) that @brentlblair can use to update his extension. Two questions:
|
You can attach files here in your comment. I've found that's become the most handy, the link is shareable beyond just the comment and it keeps things close to home. Now that the vsix is tiny it works well! Edit: regarding the version number, yeah ideally you'd bump it up apologies for that. |
@brentlblair Attached is a vsix file for a patched version of the extension 2.0.8. To Install
You'll have to do a document reload for the change to take effect. Please let me know how it goes. |
Didn't see your edit until after posting the vsix. As the formatting option was the only change, it's probably ok just to leave it as is for now, don't you think? |
Thank you, it works great.
*Brent Blair* <http://www.linkedin.com/in/BrentLBlair>
Vice President of IT
Encompass
Phone 954.474.0300
Fort Lauderdale, FL
<https://www.google.com/maps/place/Encompass+Parts+Distribution/@26.145357,-80.2482168,12.46z/data=!4m5!3m4!1s0x0:0xb2bfe23d3412449!8m2!3d26.0920996!4d-80.2409538>
[email protected]
encompass.com
…On Fri, Jun 12, 2020 at 1:20 PM Kevin Powick ***@***.***> wrote:
@brentlblair <https://github.com/brentlblair> Attached is a vsix file for
a patched version of the extension 2.0.8.
*To Install*
1. Download the attached zip file and extract the file
mvbasic-2.0.8.patched.vsix
2. Open VS Code
3. Open the Command Palette cmd+shift+P or menu/view/Command Palette
4. Type vsix to find the option Extensions: Install from VSIX...
5. Select that option.
6. From the file dialogue that opens, select the file
mvbasic-2.0.8.patched.vsix and click on the "install" button.
You'll have to do a document reload for the change to take effect.
Please let me know how it goes.
mvbasic-2.0.8.patched.zip
<https://github.com/mvextensions/mvbasic/files/4772242/mvbasic-2.0.8.patched.zip>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#110 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFRDR4JO7KDCAYLVNVAM4BTRWJPUBANCNFSM4N4KWCFQ>
.
|
* RegEx fix for labels with leading spaces. * 98-Issue linting with multiple levels of quoting * RegEx improvement for quoted strings * Replace parenthesis and quoted strings with empty ones. - Removed repetitive Trim()s - Removed unnecessary RegEx tests - Simplified line split on semicolon due to above changes. - Results: Faster execution. Better coverage for split on semicolon * - Cleanup lines[] array at start so repeated test/replace not needed - Removed unnecessary trim()s - Removed boolean equality tests. if(x.test == true) vs if(x.test) - Fixed GOTO/GOSUB when followed by more than one space GOTO <s><s> 100 * RegEx fix-ups to support recent changes * Corrected comment * Linter RegEx cleanup * FOR/NEXT tracking improvements and updated error messages - Nested For/Next statements now validated - NEXT with no variable is now allowed - One line per error: Removed extraneous, repeated diagnostic messages - Reworded / Clarified some error messages for consistency * Minor code clean-up * Replace char-at-a-time split on ; with split(";") * Maintain original character spacing for Intellisense error markers - RegEx improvements and consistency between client and server - Improved getWord() function * Corrected indentation for ELSE END with trailing comment (issue #45) * Corrects Label error with GOTO/GOSUB. Issue #99 - Also now allows dotted numeric labels such as GOTO 100.5 * Revert "Corrects Label error with GOTO/GOSUB. Issue #99" This reverts commit 68b0166. * Inspect TM Scopes->Inspect Editor Token and Scopes * Fix error processing customWordPath when last line is blank. May relate to #24. * Changed GOTO/GOSUB scope jumping message from Error to Warning * Numerous updates related to For/Next and Label tracking - Issue #45: Alignment of If/Else - Issue #96: Allow periods in labels - Issue #99: Corrected Label error with GOTO/GOSUB. - Issue #104: Corrected For/Next with leading label - Issue #105: Changed GOTO scope jumping message from Error to Warning - RegEx: Label comments to include "REM, *, and !" - NEXT can be used without FOR variable. * Shipping 2.0.7 * Re-introduce accidentally deleted /doc files * Fixes issue 107: FOR/NEXT error when no whitespace after FOR variable. * Shipping 2.0.8 * Issue #110: Do not change indentation of comment lines * Issue #111: Added user setting to control indentation of comment lines. * Bump elliptic from 6.5.2 to 6.5.3 (#119) Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](indutny/elliptic@v6.5.2...v6.5.3) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Extension Guide.md Updated AccuTerm connector and host program links. * Feature request 113 (#121) * Update package.json Added MVBasic.customFunctionPath * Update server.ts added functionality to Load CustomFunction definition * Add files via upload * Update Extension Guide.md added documentation for Custom functions and subroutines 6.8 * Update server.ts Removed `data: functions[i].index,` for now since Microsoft has not responded yet. It works without it, and it's no longer in the Microsoft API documentation. * - Fix issue with startLoop/endLoop in server code parser - Clean up unused variable in server - Expand docs on new customFunctions feature * Shipping 2.0.9 Co-authored-by: Kevin Powick <[email protected]> Co-authored-by: Ian McGowan <[email protected]> Co-authored-by: Peter Schellenbach <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brent Blair <[email protected]>
2.0.9 released! Closing issue. |
* RegEx fix for labels with leading spaces. * 98-Issue linting with multiple levels of quoting * RegEx improvement for quoted strings * Replace parenthesis and quoted strings with empty ones. - Removed repetitive Trim()s - Removed unnecessary RegEx tests - Simplified line split on semicolon due to above changes. - Results: Faster execution. Better coverage for split on semicolon * - Cleanup lines[] array at start so repeated test/replace not needed - Removed unnecessary trim()s - Removed boolean equality tests. if(x.test == true) vs if(x.test) - Fixed GOTO/GOSUB when followed by more than one space GOTO <s><s> 100 * RegEx fix-ups to support recent changes * Corrected comment * Linter RegEx cleanup * FOR/NEXT tracking improvements and updated error messages - Nested For/Next statements now validated - NEXT with no variable is now allowed - One line per error: Removed extraneous, repeated diagnostic messages - Reworded / Clarified some error messages for consistency * Minor code clean-up * Replace char-at-a-time split on ; with split(";") * Maintain original character spacing for Intellisense error markers - RegEx improvements and consistency between client and server - Improved getWord() function * Corrected indentation for ELSE END with trailing comment (issue #45) * Corrects Label error with GOTO/GOSUB. Issue #99 - Also now allows dotted numeric labels such as GOTO 100.5 * Revert "Corrects Label error with GOTO/GOSUB. Issue #99" This reverts commit 68b0166. * Inspect TM Scopes->Inspect Editor Token and Scopes * Fix error processing customWordPath when last line is blank. May relate to #24. * Changed GOTO/GOSUB scope jumping message from Error to Warning * Numerous updates related to For/Next and Label tracking - Issue #45: Alignment of If/Else - Issue #96: Allow periods in labels - Issue #99: Corrected Label error with GOTO/GOSUB. - Issue #104: Corrected For/Next with leading label - Issue #105: Changed GOTO scope jumping message from Error to Warning - RegEx: Label comments to include "REM, *, and !" - NEXT can be used without FOR variable. * Shipping 2.0.7 * Re-introduce accidentally deleted /doc files * Fixes issue 107: FOR/NEXT error when no whitespace after FOR variable. * Shipping 2.0.8 * Issue #110: Do not change indentation of comment lines * Issue #111: Added user setting to control indentation of comment lines. * Bump elliptic from 6.5.2 to 6.5.3 (#119) Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](indutny/elliptic@v6.5.2...v6.5.3) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update Extension Guide.md Updated AccuTerm connector and host program links. * Feature request 113 (#121) * Update package.json Added MVBasic.customFunctionPath * Update server.ts added functionality to Load CustomFunction definition * Add files via upload * Update Extension Guide.md added documentation for Custom functions and subroutines 6.8 * Update server.ts Removed `data: functions[i].index,` for now since Microsoft has not responded yet. It works without it, and it's no longer in the Microsoft API documentation. * - Fix issue with startLoop/endLoop in server code parser - Clean up unused variable in server - Expand docs on new customFunctions feature * Shipping 2.0.9 * Update server.ts It looks like I left the line `customFunctionPath = settings.MVBasic.customFunctionPath;` out of the merge. * Shipping v2.0.10 Co-authored-by: Kevin Powick <[email protected]> Co-authored-by: Ian McGowan <[email protected]> Co-authored-by: Peter Schellenbach <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brent Blair <[email protected]>
Not sure if this is considered a bug or the intended outcome. Either way, it's a minor issue. I noticed that the
format document
also indents the comments lines to the configured code margin. I think the comment lines should either be ignored or moved to zero margin. In my opinion, it makes the program harder to read.This is what I think the formatted document should look like:
This is what the format document looks like today:
The text was updated successfully, but these errors were encountered: