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

dm-langserver gives an error on valid DM #340

Open
MaltVinegar opened this issue Oct 2, 2022 · 1 comment
Open

dm-langserver gives an error on valid DM #340

MaltVinegar opened this issue Oct 2, 2022 · 1 comment
Labels

Comments

@MaltVinegar
Copy link

Example of code giving error:

image

Output:

image

@MaltVinegar MaltVinegar changed the title dm-langserver gives an error when specifying return type of function dm-langserver gives an error on valid DM (I assume it's return type though it's not enforced so I'm not sure) Oct 2, 2022
@SpaceManiac
Copy link
Owner

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

@MaltVinegar MaltVinegar changed the title dm-langserver gives an error on valid DM (I assume it's return type though it's not enforced so I'm not sure) dm-langserver gives an error on valid DM Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants