Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

VS Code debugger finds an error that isn't on line 1

hencoop
Advisor

VS Code debugger finds an error that isn't on line 1

hencoop
Advisor
Advisor
My line 1 is this comment:
;;;Global Pipeline DesiGN (GPDGN).
VS Code debugger flags it: "extra right paren on input [Ln 1, Col 19]" (the space between "Pipeline DesiGN").
This is my first foray into VS Code.  So far I'm not impressed with the debugger.
AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes
Reply
744 Views
20 Replies
Replies (20)

paullimapa
Mentor
Mentor

don't use open or close parenthesis in comment lines


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes

hencoop
Advisor
Advisor

Thank you for taking the time to look at this.

IMHO, not using parentheses in comments isn't a solution but a workaround.  VLIDE has no problem with comments containing parentheses.  VLIDE correctly ignores comment lines as they could not possibly be the source of a code error as they are never part of the code.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes

paullimapa
Mentor
Mentor

you may want to upgrade your 2024 to the latest updates:

paullimapa_0-1736275172030.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes

paullimapa
Mentor
Mentor

since autodesk has selected VS Code we have no option but to workaround its kinks...


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes

hencoop
Advisor
Advisor

Ah, but we do have a choice.  LISPSYS allows us to choose VLIDE or VS Code.

 

Perhaps VS Code cannot handle debugging 151,085 lines of code.  I don't have any particular reason to run the debugger.  

ChatGPT wrote some python for analysis of symbol name usage.  We had progressed through several nice tools and for the next one it stumbled over my code.  ChatGPT concluded it was the result of non-standard formatting.  I had merged my three 40k+ lines files (about the limit that VLIDE can handle w/o crashing) into one file to have VLIDE format.  I figured that if I just opened it and formatted it VLIDE might not crash.  I was wrong, so I had VS Code reformat it all at once.  It didn't complain at all.  ChatGPT had suggested I use VS Code as it could easily handle very large files.

 

After that I decided to run the debugger just to see what it would do.  It couldn't understand the first line was a comment and not part of the code so I guess it's back to VLIDE for me.  Besides, I am very familiar with all of its features and I know nothing about VS Code's tools.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes

paullimapa
Mentor
Mentor
0 Likes

hencoop
Advisor
Advisor

Thanks, but I'm well aware of that recommendation.  I've been an Autodesk Authorized Developer for many years and I'm not changing horses until the one I'm on can't herd my cattle any more.  I started with Basis Software (Vital Lisp I think, I can't remember).  It could compile an ARX file from my lisp.  After Autodesk bought it, it became Visual Lisp and they stripped out the ARX creation ability.  I've also used Visual Studio for some C# coding but I never seriously tried to transition my Autolisp/Visual Lisp coding to VS Code.  I sure I will when I must.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes

paullimapa
Mentor
Mentor

I like VS Code mainly because it allows me to open not only multiple documents at once but also the same document in multiple windows. Now I can work on one section of the same file in one window and then also onto another section of the same file on different windows. Here's a screenshot of the same file opened up in 3 different windows:

paullimapa_1-1736280002084.png

These are the extensions I load with VS Code to help with Lisp coding, bracket matching and selections:

paullimapa_0-1736279884123.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos

hencoop
Advisor
Advisor

You live dangerously!

I always run AutoCAD Civil 3D in SDI=1 (Single Document Interface Mode) to eliminate the potential of my Pipeline Design program overwriting data from multiple instances of it in SDI=0 (Multi-document mode).  It's easy to get confused as to which session I made edits in and obliterating edits made in one session with edits made in another.

It seems that editing the same lisp file in multiple windows has the same risk.

The additional advantage of SDI=1 is that with LISPINIT=0 all of the stored data is carried into the next drawing w/o skipping a beat.  The status of the data is always the latest and greatest.  In VLIDE I have multiple files open but none of them are the same file.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes

paullimapa
Mentor
Mentor

That’s one of the features of VS Code being able to successfully track if the same file is being edited when opened in more than a single window. This was of course missing from when I used Vlide as my main lisp editor. Also I didn’t like having Vlide take over an AutoCAD session just for lisp coding. 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes

hencoop
Advisor
Advisor

What does VS Code do when you've edited the same lines in multiple windows?  I'd likely make some edits in one and then think I was continuing those edits but be working in another widow of the same file.

I like the search tools in VLIDE and especially the APROPOS WINDOW's ability to show all matching a string fragment and its ability to directly open the help page for an item in the list. 

Apropos Window.jpg

I've used VLIDE's search tool with multiple files to find something specific in a large point file (ASCII text)... and also find which of several files is the one I am looking for.

I do my debugging while working in AutoCAD.  I set "Break on error" and in nearly every case I am taken directly to the offending code when there is an error.

Maybe I'll find some things that I need or want in VS Code and develop a hybrid approach to my lisp editing.  There are things in VLIDE that I'll be about as sorry to lose as when I lost the ability to make ARX files.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes

paullimapa
Mentor
Mentor

So as you enter edits in one window the exact same info shows up on the other window when looking at the same file

The apropos window is much longer in VLIDE but similar options show up in VS Code as you type again that's because I have the AutoLISP extensions loaded:paullimapa_0-1736284420655.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes

CodeDing
Advisor
Advisor

You guys are using IDEs?

I write all my code in Notepad.

...no, I don't mean Notepad++...

0 Likes

paullimapa
Mentor
Mentor

Impressive 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos

ec-cad
Advocate
Advocate

Been using Notepad for 35-40 years now. I don't (do) VLIDE or VS, just ignore them.

🙂

ECCAD

Sea-Haven
Mentor
Mentor

Notepad ++ has bracket checking and an ActiveX add on so can run lisp code from Notepad++.

 

This is my bracket check written maybe 30 + years ago.

 

Just a question why is your code so massive ? Have you just put every lisp program you have into one lisp ?

 

0 Likes

hencoop
Advisor
Advisor

I am confused.  If the multiple windows of the same file always show the same content, what is the purpose of having multiple windows open?

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes

paullimapa
Mentor
Mentor

It’s perfect for me as I edit functions which is positioned in one location of the file whereas the call to that function occurs in another location of the file. This usually occurs with dialog boxes which uses action callback statements. Or I’m adding the variables used to that function which occurs at the defun line as I scroll down the rest of the function looking for those variables / functions to make sure I’ve declared them all. These are only a couple of examples but once you see the need to edit and see how the code interacts in multiple sections of the same file then being able to open it in multiple windows becomes invaluable. 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes

hencoop
Advisor
Advisor

If I understand you

  1. When you edit in one window, the other will go to the same location (or not, but point #3 makes it irrelevant).
  2. You can scroll a window to look at variables/functions w/o both showing the same location, seeing the content you edited in the window not scrolled for reference.
  3. Any edits in either file are made/shown in all open windows so confusing edits is not possible.

If all this is true, especially the point #3, I see the advantage.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes