JohnnyMorganz / luau-lsp

Language Server Implementation for Luau
MIT License
235 stars 59 forks source link

Thread Safety on Instance functions #670

Closed SecondNewtonLaw closed 2 months ago

SecondNewtonLaw commented 3 months ago

This is mostly a feature request.

When using functions and properties relating to Roblox in instances, you may use functions that are "Thread unsafe". The Thread Safety should be marked in Instance functions and properties as documentation to aid in writing code without having to go to each documentation page and searching the safety of the function.

This is mostly a niche, but it would be helpful

JohnnyMorganz commented 3 months ago

We use the documentation that Roblox creates upstream: https://github.com/MaximumADHD/Roblox-Client-Tracker/blob/roblox/api-docs/en-us.json

This would need to be something that Roblox provides in their api-docs.json above.

SecondNewtonLaw commented 3 months ago

We use the documentation that Roblox creates upstream: https://github.com/MaximumADHD/Roblox-Client-Tracker/blob/roblox/api-docs/en-us.json

This would need to be something that Roblox provides in their api-docs.json above.

ah dang it, it would be unwise to do a hacky fix like using the API dump for it, I saw that it does indeed contain the thread safety, but then it would mix stuff or Luau-Lsp would have to host its own docs I assume, so doing so is not that viable

JohnnyMorganz commented 2 months ago

Indeed, unfortunately right now I am not interested in hosting a custom docs, but maybe we can in the future.

I don't know who is responsible for this, but it might be worth opening a DevForum feature request to add thread safety to the documentation in Studio. This is the same documentation source (the file above) that we are using for Luau Language server.

SecondNewtonLaw commented 2 months ago

Indeed, unfortunately right now I am not interested in hosting a custom docs, but maybe we can in the future.

I don't know who is responsible for this, but it might be worth opening a DevForum feature request to add thread safety to the documentation in Studio. This is the same documentation source (the file above) that we are using for Luau Language server.

Great idea, I'll try to do that