Does cabal build works??. Also notice that cabal install pandoc does not make it available in the context of a project. I think cabal install pandoc will install the pandoc tool in your system.
Judging from the shown view, it seems like you might not have opened to root of your project in VSCode. Please make sure you have openend the directory that contains the .cabal file in VSCode, via “Open Folder… [Ctrl + k Ctrk + o]”.
I know the problem has been solved but just to clarify. In general cabal install <package> is a bad idea if you just want a dependency. Maybe you are thinking about python’s pip install which makes dependencies available for your python interpreter.
cabal install is used to install software in your system. That is building a binary executable an put it in your PATH. Think about it as apt-get install in debian/ubuntu or executing a program.exe file in windows.
In order to make dependencies available, you have to create a .cabal and add dependencies to it. These dependencies will be visible only within the project!. That means if you try to use the dependencies out of the project you’ll get an error like "Could not load … ".
Because you are out of the project folder, dependencies can’t be used. HLS makes its best effort to find a .cabal file or a package.yaml, ut of course, you have to cd into the right folder
Hope it makes clearer how cabal works. (BTW most of it applies to stack)