denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
94.59k stars 5.25k forks source link

Deno LSP taking time to load TypeScript in VSCode #23445

Open luanargolodev opened 5 months ago

luanargolodev commented 5 months ago

Version: Deno 1.42.1 My laptop specs: MacBook Pro M1, 8gb ram, 512gb ssd - OS: Sonoma 14.4.1

deno 1.42.1 (release, aarch64-apple-darwin)
v8 12.3.219.9
typescript 5.4.3

I'm using the deco.cx stack to build a website. However, I notice that it is taking a long time to load the autocomplete into the file. For example, in the image below, when you hover over the constant, you get a loading message instead of showing the details. TypeScript's performance in type identification and auto-completion when writing is quite slow.

image

A simple console.log, as you can see in the image below, is also not completing automatically.

image

I tried to upgrade deno to the most current version, but I still have the same problem. In my VSCode, I already have the most current deno extension installed.

After some time, the lsp deno "appears" to be a sign of life, but appears buggy. As you can see, the comment made in the code is showing an error in a variable.

image

nathanwhit commented 5 months ago

Can you share the output of the deno language server status command?

To do that, you'll want to open the command palette in VSCode (Command + Shift + P), then search for "Deno: Language Server Status" and select it. That should open up a document, which you can copy and paste here.

Secondly, is the repo that you're having issues in public? No worries if not, it would just make this a bit easier to debug

dsherret commented 5 months ago

Deno 1.42.1

I'd recommend upgrading. There's been some significant performance improvements in the past few releases.

luanargolodev commented 5 months ago

Can you share the output of the deno language server status command?

To do that, you'll want to open the command palette in VSCode (Command + Shift + P), then search for "Deno: Language Server Status" and select it. That should open up a document, which you can copy and paste here.

Secondly, is the repo that you're having issues in public? No worries if not, it would just make this a bit easier to debug

Hello! I had to upload it to the gist, as GitHub was blocking it due to the character limit. https://gist.github.com/luanargolodev/2f8b708558ae6019590745aa3249648d

The repository is private.

luanargolodev commented 5 months ago

Deno 1.42.1

I'd recommend upgrading. There's been some significant performance improvements in the past few releases.

Already did that. Even updating to the latest version (1.42.4) still has the same problem.

sigmaSd commented 5 months ago

Maybe you need to exclude node-modules directory from being checked by the lsp (disablePaths setting)

luanargolodev commented 5 months ago

Maybe you need to exclude node-modules directory from being checked by the lsp (disablePaths setting)

How do I do that? Do I put it in the deno.json file?

viktormarinho commented 5 months ago

Maybe you need to exclude node-modules directory from being checked by the lsp (disablePaths setting)

How do I do that? Do I put it in the deno.json file?

You can configure it using the deno.disablePaths setting in the vscode settings.json file. Example:

Captura de Tela 2024-04-19 às 12 51 33
luanargolodev commented 5 months ago

Maybe you need to exclude node-modules directory from being checked by the lsp (disablePaths setting)

How do I do that? Do I put it in the deno.json file?

You can configure it using the deno.disablePaths setting in the vscode settings.json file. Example:

Captura de Tela 2024-04-19 às 12 51 33

I tried this command, Viktor! But it's still the same thing. I left the LSP charging for a few minutes but it seemed to have the same problem as before.

nayeemrmn commented 5 months ago

@luanargolodev To check against the reported regression in #23424, can you try with deno upgrade --version 1.41.3?

luanargolodev commented 5 months ago

@luanargolodev To check against the reported regression in #23424, can you try with deno upgrade --version 1.41.3?

I've already tried doing this downgrade. I actually saw this same post trying to identify and fix the problem before opening an issue. But nothing resolved yet, even with the downgrade.