MacOS development / Visual Studio-Help (Auto-Complete)

Hey,

First of all, sorry for asking n00b questions. I'd like to develop for playdate and I'm having troubles getting auto-complete working in visual studio c on Mac. I downloaded the "Playdate VS Code Template Mac" (GitHub - cadin/playdate-vscode-template: VS Code template with tasks for building and running in Playdate simulator.) and followed the instructions, but I cannot get the auto-complete working. I have never used Visual Studio, any help would be appreachiated.

Thanks, Carsten

Hi! There is no official template or nor official autocomplete support. But I created an official set of annotations which work with the Lua VSCode Extension:

It does autocomplete and will show you sdk documentation inline.

1 Like

Hey Peter,

thanks a lot for your answer and the template. :slight_smile: Thanks for creating LuaCATS, this is awesome. :smiley:

Regards, Carsten

Hello Peter,

First of all, I’m really sorry to have to ask for your help again. I usually program games in Game Maker or Unity and Visual Studio is fairly new to me.

Your autocomplete extension was working fine until yesterday, although I haven’t changed anything. I’ve been trying to get it to work again for the last two hours by updating the Playdate SDK to the latest version and following the instructions again (cloned the latest version of luacats, reinstalled the sumneko VSCode extension and edited the settings.json file appropriately. The path to luacats is correct and I really don’t know why it is no longer working.

My settings.json file currently looks like this:

{
"workbench.colorTheme": "Default Dark Modern",
"security.workspace.trust.untrustedFiles": "open"
}

{
"Lua.runtime.nonstandardSymbol": [
"+=", "-=", "*=", "/=", "//=", "%=", "<<=", ">>=", "&=", "|=", "^="
],
"Lua.diagnostics.globals": [
"import",
],
"Lua.diagnostics.severity": {
"duplicate-set-field": "Hint"
},
"Lua.format.defaultConfig": {
"indent_style": "space",
"indent_size": "4"
},
"Lua.workspace.library": [
"/Users/carsten/Developer/PlaydateSDK/Code/playdate-luacats"
]
}

{
"playdate.source": "Source",
"playdate.output": "Output.pdx",
// Optionally set sdkPath if not PLAYDATE_SDK_PATH is configured.
"playdate.sdkPath": "/Users/carsten/Developer/PlaydateSDK"
}

I never set the environment variable, is this a requirement?

Thanks for your help and sorry to be a pain in the butt.

Regards, Carsten

Sorry it's not working for you @Intoxicant.
You might check whether you have any settings conflicts between:

global VSCode User Settings JSON:
~/Library/Application Support/Code/User/settings.json

and your project/workspace settings JSON:
.vscode/settings.json

In the past I've accidentally had conflicting settings between the two.
Otherwise I don't have any great suggestions, sorry. :person_shrugging: