SpacemanDMM icon indicating copy to clipboard operation
SpacemanDMM copied to clipboard

dm-langserver gives an error on valid DM

Open MaltVinegar opened this issue 1 year ago • 1 comments

Example of code giving error:

image

Output:

image

MaltVinegar avatar Oct 02 '22 16:10 MaltVinegar

Your line 4 should be /proc/foo(). Proc return types are not part of the DM language (yet), but you can indicate them to SpacemanDMM like this:

/proc/foo()
    set SpacemanDMM_return_type = /datum
    return new /datum()

Of course the official compiler will not recognize this, so you can use #ifdef like /tg/station does: https://github.com/tgstation/tgstation/blob/12217b7f5473a0aece5b8408bf12c85a21bd474d/code/__DEFINES/spaceman_dmm.dm

SpaceManiac avatar Oct 02 '22 16:10 SpaceManiac