FreeCAD / DevelopersHandbook

A handbook about FreeCAD development
41 stars 28 forks source link

vscode documentation #52

Open Pesc0 opened 1 year ago

Pesc0 commented 1 year ago

This should be a guide on getting started with vscode, for complete beginners.

Note that the file is in the root folder, where should I put it?

Pesc0 commented 9 months ago

Starts to take shape, the vscode PR has been merged, a review and change requests are welcome!

@oursland we should add a section explaining the conda setup.

Pesc0 commented 9 months ago

forgot to instruct user to copy contrib/.vscode to root folder

Pesc0 commented 9 months ago

@sliptonic @chennes @oursland may I get some feedback?

bgbsww commented 8 months ago

Same disclaimer you made: one blunt reviewer, opinions, please don't be insulted.

I tried out these instructions on an Ubuntu 22.04.3 LTS box.

I already had vscode installed via Snap. Everthing looks great until you try to run the program and then it can't find libpthread ( and probably many others ) because it's looking in the snap for them. So I'd suggest you insist that people download the vscode linked in your instructions. A warning about other packaging is appropriate.

Once I switched, all went well until I tried the tests tab. It can't find any tests . Installed C++ Testmate extension it found the test executables for each module, but not all the tests. Those worked.

On a later restart, I tried the default tests and this time selecting a test preset resulted in all the tests listed after a short build delay. So there may be something time related in here, or maybe my system was in a strange state.

Does the freecad python testing work in freecad? Is it possible to get the freecad python tests integrated?

If the videos are ever redone, I'd love an extra large cursor, or cursor highlight in them.

Thanks for this!

Pesc0 commented 8 months ago

and then it can't find libpthread

so you download vscode from snap and it doesn't even work? I don't like snaps but i did not think they were this broken.

I tried the tests tab. It can't find any tests

I blame this on inconsistent state of the cmake extension for vscode. often i have to close and reopen vscode to have the extension detect changes... perhaps if you had done the same it would have found them, who knows. I'm afraid nothing can be done for this one.

anyway running the tests from there is not even recommended. Sure it's nicely presented, but it's just slower and pretty much useless. have you tried using the two test tasks?

Is it possible to get the freecad python tests integrated?

I dont have enough knowledge for this. Best i could do is provide a task that runs 'freecad -t 0'

If the videos are ever redone

If there are significant enough changes I may take the time to re-do them

thanks for the feedback! is debugging working alright?

bgbsww commented 8 months ago

Correct, snaps are that broken. Or a more fair way to put it: if the snap, or anything running underneath the snap requires access to resources on the system that are outside of the snap, bad things will happen.

I actually didn't realize that vscode install was a snap; I use it rarely and experimentally, which is why it was good for testing this.

The two test tasks work great; I was just reacting to what happened. For the documentation, maybe a note about the cmake instability and the importance of trying a few times with a vscode restart would help.

And yes, the debugging works fine, although it's pretty sluggish to process the updates from the underlying gdb into the front end.

Overall, I'm likely to continue to use VScode as essentially an editor, with git operations, cmake builds, and gdb sessions out in a separate terminal command line, but that's because I'm really comfortable in that environment and it runs much faster for things like tests and gdb sessions.

Pesc0 commented 8 months ago

Great, I'll make sure to add these notes