Autodesk-AutoCAD / AutoLispExt

Visual Studio Code Extension for AutoCAD® AutoLISP
https://marketplace.visualstudio.com/items?itemName=Autodesk.autolispext
Apache License 2.0
83 stars 29 forks source link

Trailing whitespaces are getting added where they're not #189

Open stephen147 opened 2 years ago

stephen147 commented 2 years ago

Describe the bug Trailing whitespaces are getting added when there were none.

To Reproduce Paste this code to the editor, there's whitespaces getting added after (errmsg) and errmsg.

  (defun *error* (errmsg) 
    (and acDoc (vla-EndUndoMark acDoc))
    (and errmsg 
         (not (wcmatch (strcase errmsg) "*CANCEL*,*EXIT*"))
         (princ (strcat "\n<< Error: " errmsg " >>\n"))
    )
  )

Expected behaviour It shouldn't be adding in trailing whitespaces when there were none.

Desktop (please complete the following information):

Additional context I have trim trailing whitespace set in VSCodes settings but this doesn't have any effect on this.

Sen-real commented 2 years ago

Hi @stephen147 , I can't reproduce this problem. This is the result after I pasted the code into VS Code: image

I then right-clicked in the editor, and clicked 'Format Document', and the result seems good too: image

I then tried to add a whitespace - changing (errmsg) to (errmsg ), and then ran 'Format Document', and that whitespace I added was removed.

I'm working with AutoLispExt v1.5.0. And I guess there's sth. else altering the text... image

stephen147 commented 2 years ago

Thanks for looking into this. My vscode install is fairly fresh. I'll unzip and new install and install this extension and see if the problem occurs.

stephen147 commented 2 years ago

I've disabled all extensions except AutoLispExt and updated to pre release version v1.5.1.

Still the same issue.

Anything else I could try as well as disabling the extensions.

vanowm commented 4 months ago

I can confirm this, after formatting the text, each command/function that is split into multiple lines is geting a trailing space:

Before format: image

After formatting: image

vanowm commented 2 weeks ago

The trailing spaces are added during formatting (SHIFT + ALT + F)