Installing Fusion via Wally is confusing luau-lsp

So I’ve migrated my project to Rojo and added Fusion as a dependency with Wally. Wally has created these files:

image

Presumably, I am meant to import fusion.lua, which just contains this:

However, now luau-lsp is confused.

How do I fix this? (TypeScript is not an option. I hate TypeScript.)

1 Like

The solution was this:

1 Like

I do have to note that I also had issues with type checking because wally does not natively export types. Using wally-package-types did help, but occasionally my LSP would mark some types as invalid for some reason, specifically Fusion types, and would have to regenerate a sourcemap and run wally-package-types all over again.

I’m not sure if it was my LSP, so because of this (along with the fact that the linting behavior is slightly different than Roblox’s script analysis), I moved back to studio in the meanwhile. If you run into this issue and have a permanent solution, do kindly let me know :slight_smile:

1 Like

I use luau-lsp in Zed. I run a program to automatically update my sourcemaps:

#!/usr/bin/fish

while true
    inotifywait -e close_write ./**/*  # Wait for script changes
    rojo sourcemap --output sourcemap.json --include-non-scripts  # Make Rojo create a sourcemap
    wally-package-types --sourcemap sourcemap.json Packages/  # Update package types -- this usually fails because it already has done so
    sleep 1
end

You’ll probably have to change this script to work with whatever shell and operating system you use.

This seems to have worked fine. However, I do get lots of erroneous type errors from Fusion—but I was getting those too in Studio, so, w/e

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.