HLS in VS Code stopped working today

I loaded up a stack project in VS Code and HSP encountered an error, something about the semantic tokens plugin not being enabled. Note that I made no change to anything that I’m aware of. In the settings, I enabled the plugin, restarted VS Code, then ran again. Still didn’t work and I couldn’t find an error in the output window. Then I upgraded HLS to 2.10.0.0. This time, it says ghcup is unable to create a symbolic link because a file already exists. The error is

stderr: ghcup: createFileLink:createSymbolicLink ‘…/…/bin/cabal-3.14.1.1-p1’ to ‘/Users/mike/.ghcup/tmp/ghcup-cabal-3.14.1.1-p1_hls-2.10.0.0_stack-3.5.1/cabal’: already exists (File exists)

Please help.

EDIT: I forgot that I always need to check if my project is building first with stack build, and discovered it’s not. Let me try to get that running first.

EDIT2: got my project to build, but now HSP is giving me: 91muser error (Failed to get the immediate reverse dependencies of NormalizedFilePath
“/Users/mike/Library/CloudStorage/Dropbox/stack/newcac/.stack-work/dist/aarch64-osx/ghc-9.6.6/build/newcac-exe/autogen/Paths_newcac.hs”)

That’s interesting. I can’t reproduce that. This is on mac?

Yes, on Mac. I took a lot of steps to get there and may have messed up the configuration at some point. What’s the minimum I would do to reset HLS- or stack- related configuration and start from a blank slate?

If you want to start with a blank slate with Stack, see the advice when you command stack uninstall.

If you have global configurations in config.yaml in the Stack root, you may want to preserve a copy of that file before you delete anything.

Deleting the Stack root (likely ~/.stack on Unix-like operating systems) will cause Stack (when reinstalled) to (a) fetch again the GHC(s) it needs, when needed; and (b) start rebuilding the local ‘snapshot’ database of cached built immutable packages. However, that is likely a minor one-off ‘cost’.

It’s working now, although all I did was uninstall some old versions of ghc hat I wasn’t using anyway.