rhaiscript / lsp

Language server for Rhai.
Apache License 2.0
43 stars 4 forks source link

Multiple exports #29

Closed tamasfe closed 2 years ago

tamasfe commented 2 years ago

We currently support one export item per export statement, but the Rhai book has examples for comma separated exports.

tamasfe commented 2 years ago

I remember reading about a syntax that allowed export foo as bar, uwu as owo;. I can't seem to find it in the book now though, @schungx can you help me out with this?

schungx commented 2 years ago

Yes, it has been removed in favor of only one export per statement to make it parallel the import statement.

It used to be allowed, but no more -- I think for some other reasons as well.

For most use cases it is ok, as not many people would actually rename a variable upon export. Therefore it is just as simple to use

export let foo = 42;

if there is no renaming.

tamasfe commented 2 years ago

Alright, thanks!