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

Anyone able to get this work in VS Code or another IDE? #50

Open
SeymourNickelson opened this issue Jul 25, 2024 · 4 comments
Open

Anyone able to get this work in VS Code or another IDE? #50

SeymourNickelson opened this issue Jul 25, 2024 · 4 comments

Comments

@SeymourNickelson
Copy link

This project is awesome! This isn't really an issue but a question (I apologize if this isn't the place to ask) but...

I was wondering if anyone has gotten this to work in Visual Studio Code? I tried installing some extensions that support Objective-C but could not figure out how to get VSCode to find the GNUStep Foundation headers.

It'd be awesome to quickly execute Objective-C from VSCode on Windows. Also wondering if anyone knows of an IDE on Windows with better ObjC support than Visual Studio (code completion, etc.).

Thanks!

@triplef
Copy link
Member

triplef commented Jul 26, 2024

Have you tried following the steps from the readme here?

@SeymourNickelson
Copy link
Author

Thanks for responding! Indeed I did and running works from Visual Studio which is awesome. But there is no Objective-C code completion so editing Objective-C from Visual Studio is quite tedious (no different than coding in TextEdit or Notepad). I wasn't able to find a Visual Studio extension for Objective-C.

Visual Studio Code has pretty decent Objective-C completion on Mac with an extension, so I was wondering if anyone successfully integrated the GNUStep toolchain in VSCode rather than Visual Studio. I experimented editing the Objective-C entry in the code-runner.executorMap in VSCode's settings.json but have so far been unsuccessful at getting Objective-C to run with GNUStep.

@triplef
Copy link
Member

triplef commented Jul 26, 2024

Ah I see, thanks for clarifying. I’m not aware of a way to have code completion for ObjC code in VS.

We’re using the project with Qt Creator, which somewhat works with code completion but obviously only makes sense if you’re using Qt. Using VS Code sounds like the right approach though. If you can convert your project to CMake you should be able to open it in VS Code. Maybe it’s also possible to open VS projects in VS Code.

@arctic-marmoset
Copy link

My usual go-to combo for C/C++/ObjC on VSCode is CMake and clangd. CMake can generate a compile_commands.json for clangd to read to understand include paths, etc.

But if you're just looking to get something up and running quickly, without having to write a CMakeLists.txt, then you can just use clangd and manually write a compile_flags.txt and place it in your project root.

Example compile_flags.txt:

-xobjective-c
-DGNUSTEP
-DGNUSTEP_WITH_DLL
-DGNUSTEP_RUNTIME=1
-D_NONFRAGILE_ABI=1
-D_NATIVE_OBJC_EXCEPTIONS
-fblocks
-fexceptions
-fmodules
-fobjc-arc
-fobjc-exceptions
-fobjc-runtime=gnustep-2.0
-isystem
/path/to/GNUstep/include

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants