Open lucas-labs opened 11 months ago
That's not intellisense not working, that's it not finding the Astro installation. I don't think this is yarn berry specific, it tries to find it from the root of your workspace (through a simple require.resolve)
I think this is similar with https://github.com/withastro/language-tools/issues/655, I also experience Intellisense not working. But only when I'm using nodeLinker: pnp
though. When I have nodeLinker: pnpm
, it's working normally. Might be something-something with the existence of node_modules
folder.
Hmm, I get a different error when running steps 1-3:
[Error - 3:32:51 PM] Server initialization failed.
Message: Request initialize failed with message: ENOTDIR: not a directory, stat '/Users/homedir/.yarn/berry/cache/@volar-language-server-npm-1.10.10-3fb40bf23d-10c0.zip/node_modules/@volar/language-server/out/common/features/customFeatures.js'
Code: -32603
[Error - 3:32:51 PM] Astro Language Server client: couldn't create connection to server.
Message: Request initialize failed with message: ENOTDIR: not a directory, stat '/Users/homedir/.yarn/berry/cache/@volar-language-server-npm-1.10.10-3fb40bf23d-10c0.zip/node_modules/@volar/language-server/out/common/features/customFeatures.js'
Code: -32603
Looks like it does find it, but not sure why it complains about a volar language server. Installing @volar/language-server
and rerunning yarn dlx @yarnpkg/sdks vscode
doesn't fix it either
Describe the Bug
Intellisense doesn't seem to get along with
yarn berry
.I've installed the sdk, and configured the
ls-path
option accordinglyThis is how it looks:
As you can see in the image above, the
Astro
variable is being recognized as a global variable, but it is coming as if it were of typeany
, and since its type isany
, intellisense dies right there:There's not errors or warnings in the output logs.
I'm testing this on win11, I'll try it on macos and ubuntu next week when I get back from vacation
Steps to Reproduce
yarn create astro
yarn add @astrojs/language-server
- this is to let yarn know it has to install the astro sdkyarn dlx @yarnpkg/sdks vscode
- yarn will detect astro and install the sdkastro.language-server.ls-path
topath/to/repo/astro/.yarn/sdks/@astrojs/language-server/bin/nodeServer.js