denoland / vscode_deno

Visual Studio Code plugin for Deno
https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno
MIT License
1.46k stars 139 forks source link

intellisense extremely slow due to Deno extension #895

Open guy-borderless opened 10 months ago

guy-borderless commented 10 months ago

Describe the bug Snippets (and other) intellisense extremely slow to show completions (8-10 seconds) on vs code. Deno output shows: client asked to cancel request 130, but no such pending request exists, ignoring successfully canceled request with ID: 132 Unable to send result to client.

Only after the last message appears in output autocompletion is shown. When disabling the Deno lsp vscode extension completion is shown immediately.

To Reproduce autocomplete a snippet

Expected behavior completion is shown immediately

Versions

vscode: 1.81.1 deno: 1.36.1 extension: Deno 3.20.0

guy-borderless commented 10 months ago

restarting the lsp and autocompleting gives: Starting Deno language server... version: 1.36.1 (release, x86_64-unknown-linux-gnu) executable: /usr/bin/deno Connected to "Visual Studio Code" 1.81.1 Auto-resolved configuration file: "file:///home/.../deno.jsonc" Warning: "options" configuration is deprecated. Please use "flat" options instead. Setting import map from configuration file: "import_map.json" Resolved import map: "file:///home/.../import_map.json" Enabling import suggestions for: https://deno.land Server ready. autocomplete here client asked to cancel request 1, but no such pending request exists, ignoring successfully cancelled request with ID: 14 client asked to cancel request 10, but no such pending request exists, ignoring client asked to cancel request 11, but no such pending request exists, ignoring client asked to cancel request 2, but no such pending request exists, ignoring client asked to cancel request 3, but no such pending request exists, ignoring Unable to send result to client. client asked to cancel request 15, but no such pending request exists, ignoring client asked to cancel request 8, but no such pending request exists, ignoring client asked to cancel request 18, but no such pending request exists, ignoring successfully cancelled request with ID: 24 Unable to send result to client. client asked to cancel request 20, but no such pending request exists, ignoring client asked to cancel request 23, but no such pending request exists, ignoring client asked to cancel request 26, but no such pending request exists, ignoring successfully cancelled request with ID: 31 successfully cancelled request with ID: 32 Unable to send result to client. Unable to send result to client. successfully cancelled request with ID: 34 Unable to send result to client.

andrinheusser commented 10 months ago

I ran into this a few times aswell. Here's my data:

DenoLspOutput htopDenoLsp

Deno Language Server Status

Workspace Settings

{
  "enable": true,
  "enablePaths": [],
  "cache": null,
  "certificateStores": null,
  "config": null,
  "importMap": null,
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": false
  },
  "inlayHints": {
    "parameterNames": {
      "enabled": "none",
      "suppressWhenArgumentMatchesName": true
    },
    "parameterTypes": {
      "enabled": false
    },
    "variableTypes": {
      "enabled": false,
      "suppressWhenTypeMatchesName": true
    },
    "propertyDeclarationTypes": {
      "enabled": false
    },
    "functionLikeReturnTypes": {
      "enabled": false
    },
    "enumMemberValues": {
      "enabled": false
    }
  },
  "internalDebug": false,
  "lint": true,
  "documentPreloadLimit": 1000,
  "suggest": {
    "completeFunctionCalls": true,
    "names": true,
    "paths": true,
    "autoImports": true,
    "imports": {
      "autoDiscover": true,
      "hosts": {
        "https://deno.land": true
      }
    }
  },
  "testing": {
    "args": [
      "--allow-all",
      "--no-check"
    ],
    "enable": true
  },
  "tlsCertificate": null,
  "unsafelyIgnoreCertificateErrors": null,
  "unstable": true
}
mcandeia commented 8 months ago

Up, I'm still having issues with this.

mephju commented 8 months ago

I'm having the same issue.

nayeemrmn commented 8 months ago

@mephju Please run Deno: Language server status through the command palette and share the workspace settings section

mephju commented 8 months ago

@nayeemrmn

Deno Language Server Status

Workspace Settings

{
  "enable": true,
  "disablePaths": [],
  "enablePaths": [
    "../common/app",
    "./app",
    "./app.tests"
  ],
  "cache": null,
  "cacheOnSave": false,
  "certificateStores": null,
  "config": "./deno.jsonc",
  "importMap": null,
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": false
  },
  "internalDebug": false,
  "lint": true,
  "documentPreloadLimit": 1000,
  "suggest": {
    "imports": {
      "autoDiscover": true,
      "hosts": {
        "https://deno.land": true
      }
    }
  },
  "testing": {
    "args": [
      "--allow-all",
      "--no-check"
    ]
  },
  "tlsCertificate": null,
  "unsafelyIgnoreCertificateErrors": null,
  "unstable": false,
  "javascript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": false,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "always"
    }
  },
  "typescript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": false,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "always"
    }
  }
}

Workspace Details

Performance

Name Duration Count
code_action 767ms 4
did_open 1ms 1
hover 44ms 1
op_load 0ms 2684
op_resolve 0ms 298
references 1078ms 1
request 398ms 7
testing_update 6ms 1
update_diagnostics_deps 7ms 1
update_diagnostics_lint 16ms 1
update_diagnostics_ts 1451ms 1
murunwas commented 7 months ago

I'm also experiencing this issue :( , I've decided to disable this extension.

wave-light commented 7 months ago

I was experiencing a similar issue. I managed to fix it by removing date-fns from my import_map.json. I was importing date-fns from https://esm.sh/date-fns@2.30.0. After removing the line from my import_map.json, Deno intellisense was working normally.

guy-borderless commented 7 months ago

I still get the issue, now with Unable to send result to client. printed multiple times before completion is shown.

mephju commented 7 months ago

I think everybody complaining here is running Linux btw. Also, from research on the Internet regarding this topic it seems that Linux users have the most issues with this extension. Currently it's very slow again. This is my Deno LSP status:

Deno Language Server Status

Workspace Settings

{
  "enable": true,
  "disablePaths": [],
  "enablePaths": null,
  "cache": null,
  "cacheOnSave": false,
  "certificateStores": null,
  "config": "./deno.jsonc",
  "importMap": null,
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": false
  },
  "internalDebug": false,
  "lint": true,
  "documentPreloadLimit": 1000,
  "suggest": {
    "imports": {
      "autoDiscover": false,
      "hosts": {
        "https://deno.land": true
      }
    }
  },
  "testing": {
    "args": [
      "--allow-all",
      "--no-check"
    ]
  },
  "tlsCertificate": null,
  "unsafelyIgnoreCertificateErrors": null,
  "unstable": false,
  "javascript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "always"
    }
  },
  "typescript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "always"
    }
  }
}

Workspace Details

Performance

Name Duration Count
code_action 3178ms 3
did_close 0ms 1
document_highlight 341ms 1
folding_range 383ms 1
op_load 0ms 2947
op_resolve 0ms 36
request 882ms 10
update_diagnostics_ts 6279ms 1
renbou commented 7 months ago

I'm running it on Mac, so I don't think that this is a Linux-specific issue. Deno's language server simply isn't able to handle anything other than tiny (and I really mean tiny) pet projects right now. Tried writing a simple Fresh app, and the performance of the language server made me pretty much decide that I will avoid using Deno for the forseeable future, as importing just a few node libraries causes the language server to slow down to an unusable state.

mephju commented 7 months ago

@renbou Thanks for you input. I'm also considering to migrate my project to Node. The selling point of Deno was really that it kinda just works in terms of dev experience. But with issues like this it's actually the opposite, unfortunately.

nayeemrmn commented 7 months ago

I think we just have to give higher priority to completion requests, so it doesn't wait for pending diagnostics requests but cancels them and runs first.

shepherdjerred commented 7 months ago

I don't have a more polite way to say this: VSCode + Deno is unusable.

Intellisense works if you wait an unreasonable amount of time. Hovering over variables/types rarely works. Navigating to a definition -- a local file -- also has an extremely long delay.

It's difficult to have much confidence in Deno with such a poor experience in the most popular IDE for TypeScript.

https://github.com/denoland/vscode_deno/assets/3904778/dd3f0d80-0544-4eea-9fb6-f592a27fdb10

Deno Language Server Status
Workspace Settings
{
  "enable": true,
  "disablePaths": [],
  "enablePaths": null,
  "cache": null,
  "cacheOnSave": false,
  "certificateStores": null,
  "config": null,
  "importMap": null,
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": false
  },
  "internalDebug": false,
  "lint": true,
  "documentPreloadLimit": 1000,
  "suggest": {
    "imports": {
      "autoDiscover": true,
      "hosts": {
        "https://deno.land": true
      }
    }
  },
  "testing": {
    "args": [
      "--allow-all",
      "--no-check"
    ]
  },
  "tlsCertificate": null,
  "unsafelyIgnoreCertificateErrors": null,
  "unstable": true,
  "javascript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "always"
    }
  },
  "typescript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "always"
    }
  }
}

Workspace Details
Documents in memory: 1575
Performance measures: 3000
Performance
Name    Duration    Count
document_symbol 721ms   1
folding_range   721ms   1
get_navigation_tree 720ms   1
op_load 0ms 2994
request 22ms    3
bartlomieju commented 7 months ago

We are aware of the problem and will dedicate more resources to fixing it. For the folks experiencing these problems: could you please share the projects where you encounter the slowness? It will greatly help us in debugging the problem on our side. We have a few mitigations we want to put in place in the near future, but ideally we'd fix the underlying issue you're facing.

shepherdjerred commented 7 months ago

Thanks for the quick response. I'd love to give Deno a real try once this is sorted out. Here is my project: https://github.com/shepherdjerred/glitter-boys/tree/sj/deno

nhrones commented 7 months ago

I'm careful now watch for culprits like very large json files,
When I apply @nayeemrmn recommended disablePaths fix:

{
   "deno.disablePaths": ["./offendingFolder/"],
}

The problem goes away. When these large files are not disabled, any move or rename of any file causes a slowdown or LSP OOM crash. Again, this is on a low powered Windows 11 laptop with only 8gb memory. I can always tell when it is about to happen as the laptop fan starts howling.

Hope this helps.

shepherdjerred commented 7 months ago

I do import some large JSON files in tests -- maybe that's what's causing the issue for me. I'll see what happens when I remove those imports.

bartlomieju commented 7 months ago

Please do! We might want to fix it on our side to ignore files that are eg. >1Mb in size. We'll check to see how TSServer is handling it itself.

nhrones commented 7 months ago

An offending file -- JSON with 100k unique user objects.: 8.4 MB https://raw.githubusercontent.com/nhrones/BuenoCache/main/workers/hundredK.json

The fix in settings.json

"deno.disablePaths": ["./dist", "./workers/", "./.vscode"]
bartlomieju commented 7 months ago

One of potential improvements would be https://github.com/denoland/deno/issues/11032 as in https://github.com/denoland/vscode_deno/issues/895#issuecomment-1831053167 it can be seen that constructing a navigation tree takes almost a second.

bartlomieju commented 7 months ago

We have developed a potential fix for this problem and are currently investigating it. If we feel confident enough that it alleviates the problem we will cut a hot-fix Deno v1.38.4 release dedicated to this problem.

This fix could also help with https://github.com/denoland/vscode_deno/issues/943.

ynwd commented 7 months ago

same here 1.38.3

ynwd commented 7 months ago

I don't have a more polite way to say this: VSCode + Deno is unusable.

Intellisense works if you wait an unreasonable amount of time. Hovering over variables/types rarely works. Navigating to a definition -- a local file -- also has an extremely long delay.

It's difficult to have much confidence in Deno with such a poor experience in the most popular IDE for TypeScript.

CleanShot.2023-11-28.at.17.32.40.mp4

Deno Language Server Status
Workspace Settings
{
  "enable": true,
  "disablePaths": [],
  "enablePaths": null,
  "cache": null,
  "cacheOnSave": false,
  "certificateStores": null,
  "config": null,
  "importMap": null,
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": false
  },
  "internalDebug": false,
  "lint": true,
  "documentPreloadLimit": 1000,
  "suggest": {
    "imports": {
      "autoDiscover": true,
      "hosts": {
        "https://deno.land": true
      }
    }
  },
  "testing": {
    "args": [
      "--allow-all",
      "--no-check"
    ]
  },
  "tlsCertificate": null,
  "unsafelyIgnoreCertificateErrors": null,
  "unstable": true,
  "javascript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "always"
    }
  },
  "typescript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "always"
    }
  }
}

Workspace Details
Documents in memory: 1575
Performance measures: 3000
Performance
Name  Duration    Count
document_symbol   721ms   1
folding_range 721ms   1
get_navigation_tree   720ms   1
op_load   0ms 2994
request   22ms    3

[1] I have similar problem when start deno run -A --watch --unstable main.ts and at the same time open the VScode. [2] But when I stop the application, and restart the LSP, and open it with VScode -- intellisense back to normal [3] intellisense slow again if I start no.1

cc: @bartlomieju @nayeemrmn

bartlomieju commented 7 months ago

Deno v1.38.4 containing a few LSP performance fixes is now released. Please update and let us know if the problems persist.

ynwd commented 7 months ago

Still persist if i run deno run -A --watch --unstable main.ts and at the same time open the VScode.

bartlomieju commented 7 months ago

Thanks for checking. Could you provide the output from the "Deno Language Server" tab in VSCode?

ynwd commented 7 months ago

Deno Language Server Status

Workspace Settings

{
  "enable": true,
  "disablePaths": [
    "npm"
  ],
  "enablePaths": null,
  "cache": null,
  "cacheOnSave": false,
  "certificateStores": null,
  "config": null,
  "importMap": "import_map.json",
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": false
  },
  "internalDebug": false,
  "lint": true,
  "documentPreloadLimit": 1000,
  "suggest": {
    "imports": {
      "autoDiscover": true,
      "hosts": {
        "https://deno.land": true
      }
    }
  },
  "testing": {
    "args": [
      "--allow-all",
      "--no-check"
    ]
  },
  "tlsCertificate": null,
  "unsafelyIgnoreCertificateErrors": null,
  "unstable": false,
  "javascript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "prompt"
    }
  },
  "typescript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "prompt"
    }
  }
}

Workspace Details

Performance

Name Duration Count
code_action 2348ms 1
document_highlight 1282ms 1
goto_definition 3506ms 1
op_load 0ms 2946
op_resolve 0ms 45
request 1322ms 3
tsc getApplicableRefactors 2348ms 1
tsc getDefinitionAndBoundSpan 3506ms 1
tsc getDocumentHighlights 1282ms 1
bartlomieju commented 7 months ago

Wow! Over 3s to get a response from TSC. That is definitely off. Could you share the project you are seeing this on? That would help us with debugging a lot.

ynwd commented 7 months ago

Wow! Over 3s to get a response from TSC. That is definitely off. Could you share the project you are seeing this on? That would help us with debugging a lot.

@bartlomieju, rpx

bartlomieju commented 7 months ago

Keep an eye out on https://github.com/denoland/deno/pull/21435, if you are on Linux/Windows or non-ARM macOS you can update to canary version once that PR lands to see if it helps with your situation.

ynwd commented 7 months ago

Better than version 1.38.4. But it's still far behind version 1.36.4

Deno Language Server Status

Workspace Settings

{
  "enable": true,
  "disablePaths": [
    "npm"
  ],
  "enablePaths": null,
  "cache": null,
  "cacheOnSave": false,
  "certificateStores": null,
  "config": null,
  "importMap": "import_map.json",
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": false
  },
  "internalDebug": false,
  "lint": true,
  "documentPreloadLimit": 1000,
  "suggest": {
    "imports": {
      "autoDiscover": true,
      "hosts": {
        "https://deno.land": true
      }
    }
  },
  "testing": {
    "args": [
      "--allow-all",
      "--no-check"
    ]
  },
  "tlsCertificate": null,
  "unsafelyIgnoreCertificateErrors": null,
  "unstable": false,
  "javascript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "prompt"
    }
  },
  "typescript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "prompt"
    }
  }
}

Workspace Details

Performance

Name Duration Count
lsp.code_action 171ms 5
lsp.did_change_watched_files 19ms 1
lsp.document_highlight 4921ms 2
lsp.folding_range 540ms 3
lsp.goto_definition 6309ms 3
lsp.semantic_tokens_full 1016ms 3
lsp.semantic_tokens_range 212ms 1
lsp.testing_update 12ms 1
lsp.update_diagnostics_deps 0ms 1
lsp.update_diagnostics_lint 6ms 1
lsp.update_diagnostics_ts 249ms 2
lsp.update_import_map 0ms 1
lsp.virtual_text_document 0ms 1
tsc.host.$getDiagnostics 248ms 2
tsc.host.$restart 0ms 1
tsc.host.getApplicableRefactors 325ms 7
tsc.host.getDefinitionAndBoundSpan 1379ms 7
tsc.host.getDocumentHighlights 682ms 2
tsc.host.getEncodedSemanticClassifications 462ms 4
tsc.host.getOutliningSpans 38ms 3
tsc.host.getQuickInfoAtPosition 1473ms 1
tsc.op.op_load 0ms 44
tsc.op.op_resolve 0ms 2886
tsc.request.$restart 1ms 1
tsc.request.getApplicableRefactors 171ms 5
tsc.request.getDefinitionAndBoundSpan 6309ms 3
tsc.request.getDocumentHighlights 4920ms 2
tsc.request.getEncodedSemanticClassifications 815ms 4
tsc.request.getOutliningSpans 540ms 3
ynwd commented 7 months ago

v.1.38.5

Still persist if i run deno run -A --watch --unstable main.ts and at the same time open the VScode.

@bartlomieju

Deno Language Server Status

Workspace Settings

{
  "enable": true,
  "disablePaths": [
    "npm"
  ],
  "enablePaths": null,
  "cache": null,
  "cacheOnSave": false,
  "certificateStores": null,
  "config": null,
  "importMap": "import_map.json",
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": false
  },
  "internalDebug": false,
  "lint": true,
  "documentPreloadLimit": 1000,
  "suggest": {
    "imports": {
      "autoDiscover": true,
      "hosts": {
        "https://deno.land": true
      }
    }
  },
  "testing": {
    "args": [
      "--allow-all",
      "--no-check"
    ]
  },
  "tlsCertificate": null,
  "unsafelyIgnoreCertificateErrors": null,
  "unstable": false,
  "javascript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "prompt"
    }
  },
  "typescript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "prompt"
    }
  }
}

Workspace Details

Performance

Name Duration Count
lsp.code_action 1553ms 5
lsp.did_change_watched_files 7ms 2
lsp.document_highlight 2343ms 1
lsp.document_symbol 224ms 1
lsp.folding_range 1266ms 2
lsp.get_navigation_tree 223ms 1
lsp.goto_definition 2523ms 11
lsp.hover 2171ms 5
lsp.semantic_tokens_full 4798ms 4
lsp.testing_update 67ms 1
lsp.update_diagnostics_deps 0ms 1
lsp.update_diagnostics_lint 3ms 1
lsp.update_diagnostics_ts 736ms 2
lsp.update_import_map 0ms 1
lsp.virtual_text_document 0ms 4
tsc.host.$getDiagnostics 213ms 2
tsc.host.$restart 0ms 1
tsc.host.getApplicableRefactors 1188ms 6
tsc.host.getDefinitionAndBoundSpan 1368ms 12
tsc.host.getDocumentHighlights 1381ms 1
tsc.host.getEncodedSemanticClassifications 976ms 4
tsc.host.getNavigationTree 44ms 1
tsc.host.getOutliningSpans 4ms 2
tsc.host.getQuickInfoAtPosition 1164ms 6
tsc.op.op_load 0ms 117
tsc.op.op_resolve 0ms 2776
tsc.request.$restart 1ms 1
tsc.request.getApplicableRefactors 1552ms 5
tsc.request.getDefinitionAndBoundSpan 2522ms 11
tsc.request.getDocumentHighlights 2343ms 1
tsc.request.getEncodedSemanticClassifications 4798ms 4
tsc.request.getNavigationTree 223ms 1
tsc.request.getOutliningSpans 1266ms 2
tsc.request.getQuickInfoAtPosition 2171ms 5
ynwd commented 6 months ago

at v1.37.0 & v1.37.1 -- the performance is normal but start from v1.37.2 -- it is very slow.

semantic_tokens_range semantic_tokens_full
v1.37.0 1722ms 1035ms
v1.37.1 948ms 1012ms
v1.37.2 5754ms 4404ms
v1.38.5 5950ms 4297ms

cc: @nayeemrmn @bartlomieju

nayeemrmn commented 6 months ago

@ynwd That's very helpful, can you also try the following canary versions and identify the first one that's slow?

ynwd commented 6 months ago

cc: @nayeemrmn

version semantic_tokens_full semantic_tokens_range get_navigation_tree
eaeb10cee123b8184148c957151be226fb865bd2 8943ms 10488ms 6980ms
64f9155126b1cd14a46de58ae1654045cfacd150 7750ms 8975ms 6429ms
6fd2d0841871018bd394ebbdccd4c1f39e5cf773 1194ms 1647ms 1599ms
2d1af0cf51bac446f1c92e8a12db9b5052e37e12 1242ms 1653ms 1662ms
ynwd commented 6 months ago

https://github.com/denoland/deno/pull/21541 -- after upgrading deno with canary version, the problem disappeared.

cc: @nayeemrmn

ynwd commented 6 months ago

just upgraded to v1.39.0. but still very slow.

occurs if the applications and LSP are running simultaneously.

cc: @nayeemrmn @bartlomieju

Deno Language Server Status

Workspace Settings

{
  "enable": true,
  "disablePaths": [],
  "enablePaths": null,
  "cache": null,
  "cacheOnSave": false,
  "certificateStores": null,
  "config": null,
  "importMap": "import_map.json",
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": false
  },
  "internalDebug": false,
  "logFile": false,
  "lint": true,
  "documentPreloadLimit": 1000,
  "suggest": {
    "imports": {
      "autoDiscover": true,
      "hosts": {
        "https://deno.land": true
      }
    }
  },
  "testing": {
    "args": [
      "--allow-all",
      "--no-check"
    ]
  },
  "tlsCertificate": null,
  "unsafelyIgnoreCertificateErrors": null,
  "unstable": false,
  "javascript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "prompt"
    }
  },
  "typescript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "prompt"
    }
  }
}

Workspace Details

Performance (last 3 000 entries)

Name Count Duration
lsp.folding_range 1 202.063ms
lsp.semantic_tokens_full 1 2761.306ms
lsp.semantic_tokens_range 1 2712.669ms
lsp.update_diagnostics_ts 1 2699.933ms
tsc.host.$getDiagnostics 1 86.825ms
tsc.host.getEncodedSemanticClassifications 2 57.082ms
tsc.host.getOutliningSpans 1 0.479ms
tsc.op.op_script_names 2 21.72ms
tsc.op.op_script_version 2987 0.015ms
tsc.request.getEncodedSemanticClassifications 2 2736.934ms
tsc.request.getOutliningSpans 1 202.016ms

Performance (total)

Name Count Duration
lsp.code_action 107 36778.156ms
lsp.completion 14 11560.373ms
lsp.completion_resolve 5 992.563ms
lsp.did_change 36 580.383ms
lsp.did_change_watched_files 3 14.104ms
lsp.did_close 24 157.205ms
lsp.did_open 23 7.933ms
lsp.document_highlight 21 18132.976ms
lsp.document_symbol 20 26576.033ms
lsp.folding_range 47 8545.023ms
lsp.formatting 1 3.221ms
lsp.get_navigation_tree 20 26575.322ms
lsp.goto_definition 63 29777.253ms
lsp.hover 51 4488.309ms
lsp.initialize 1 104.849ms
lsp.semantic_tokens_full 48 53624.789ms
lsp.semantic_tokens_range 8 5711.874ms
lsp.testing_update 80 1305.632ms
lsp.update_cache 1 0.003ms
lsp.update_diagnostics_deps 81 145.583ms
lsp.update_diagnostics_lint 81 242.592ms
lsp.update_diagnostics_ts 47 55199.974ms
lsp.update_import_map 2 0.646ms
lsp.update_registries 1 4.305ms
lsp.update_tsconfig 2 93.787ms
lsp.virtual_text_document 4 5.503ms
tsc.host.$configure 2 1.272ms
tsc.host.$getAssets 1 0.998ms
tsc.host.$getDiagnostics 43 25876.796ms
tsc.host.$getSupportedCodeFixes 1 0.539ms
tsc.host.$restart 1 0.281ms
tsc.host.getApplicableRefactors 87 34198.041ms
tsc.host.getCodeFixesAtPosition 6 1454.255ms
tsc.host.getCompletionEntryDetails 5 330.607ms
tsc.host.getCompletionsAtPosition 12 2564.743ms
tsc.host.getDefinitionAndBoundSpan 53 10150.816ms
tsc.host.getDocumentHighlights 15 10086.895ms
tsc.host.getEncodedSemanticClassifications 56 14768.770ms
tsc.host.getNavigationTree 20 41.971ms
tsc.host.getOutliningSpans 34 28.272ms
tsc.host.getQuickInfoAtPosition 34 5367.967ms
tsc.op.op_is_node_file 152 0.421ms
tsc.op.op_load 1341 65.633ms
tsc.op.op_resolve 42079 2610.354ms
tsc.op.op_script_names 311 7521.705ms
tsc.op.op_script_version 402559 7784.070ms
tsc.request.$configure 2 93.644ms
tsc.request.$getAssets 1 1.152ms
tsc.request.$getSupportedCodeFixes 1 0.691ms
tsc.request.$restart 1 1.646ms
tsc.request.getApplicableRefactors 107 36478.788ms
tsc.request.getCodeFixesAtPosition 6 1458.154ms
tsc.request.getCompletionEntryDetails 5 991.771ms
tsc.request.getCompletionsAtPosition 14 11532.608ms
tsc.request.getDefinitionAndBoundSpan 63 29772.779ms
tsc.request.getDocumentHighlights 21 18131.856ms
tsc.request.getEncodedSemanticClassifications 56 59332.070ms
tsc.request.getNavigationTree 20 26574.496ms
tsc.request.getOutliningSpans 47 8543.401ms
tsc.request.getQuickInfoAtPosition 50 4484.538ms
guy-borderless commented 6 months ago

Autocomplete still unbearably slow

Deno Language Server Status

Workspace Settings

{
  "enable": true,
  "disablePaths": [],
  "enablePaths": null,
  "cache": null,
  "cacheOnSave": true,
  "certificateStores": null,
  "config": null,
  "importMap": null,
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": false
  },
  "internalDebug": false,
  "logFile": false,
  "lint": true,
  "documentPreloadLimit": 4000,
  "suggest": {
    "imports": {
      "autoDiscover": true,
      "hosts": {
        "https://deno.land": true
      }
    }
  },
  "testing": {
    "args": [
      "--allow-all",
      "--no-check"
    ]
  },
  "tlsCertificate": null,
  "unsafelyIgnoreCertificateErrors": null,
  "unstable": false,
  "javascript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": true,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "prompt"
    }
  },
  "typescript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": true,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "prompt"
    }
  }
}

Workspace Details

Performance (last 3 000 entries)

Name Count Duration
lsp.code_action 1 507.621ms
tsc.host.getApplicableRefactors 1 94.611ms
tsc.op.op_script_names 1 58.371ms
tsc.op.op_script_version 2996 0.019ms
tsc.request.getApplicableRefactors 1 222.265ms

Performance (total)

Name Count Duration
lsp.code_action 6 3191.081ms
lsp.code_lens 9 0.054ms
lsp.completion 2 2399.703ms
lsp.completion_resolve 1 228.556ms
lsp.did_change 1 33.406ms
lsp.did_open 2 6.670ms
lsp.folding_range 10 37637.625ms
lsp.initialize 1 1425.236ms
lsp.semantic_tokens_full 3 35017.323ms
lsp.semantic_tokens_range 4 10322.942ms
lsp.testing_update 3 154.474ms
lsp.update_cache 1 0.000ms
lsp.update_diagnostics_deps 4 63.598ms
lsp.update_diagnostics_lint 4 292.535ms
lsp.update_diagnostics_ts 4 18629.478ms
lsp.update_import_map 1 0.100ms
lsp.update_registries 1 13.021ms
lsp.update_tsconfig 2 12.286ms
lsp.virtual_text_document 1 0.000ms
tsc.host.$configure 2 3.665ms
tsc.host.$getAssets 1 1.626ms
tsc.host.$getDiagnostics 4 3956.328ms
tsc.host.$getSupportedCodeFixes 1 1.058ms
tsc.host.getApplicableRefactors 4 523.097ms
tsc.host.getCodeFixesAtPosition 2 190.867ms
tsc.host.getCompletionEntryDetails 1 121.459ms
tsc.host.getCompletionsAtPosition 2 775.987ms
tsc.host.getEncodedSemanticClassifications 7 18292.523ms
tsc.host.getOutliningSpans 10 58.778ms
tsc.op.op_is_node_file 89 0.387ms
tsc.op.op_load 3244 194.023ms
tsc.op.op_resolve 6770 2164.298ms
tsc.op.op_script_names 20 814.697ms
tsc.op.op_script_version 53257 2801.572ms
tsc.request.$configure 2 11.243ms
tsc.request.$getAssets 1 2.491ms
tsc.request.$getSupportedCodeFixes 1 1.238ms
tsc.request.getApplicableRefactors 4 2901.444ms
tsc.request.getCodeFixesAtPosition 3 280.510ms
tsc.request.getCompletionEntryDetails 1 225.675ms
tsc.request.getCompletionsAtPosition 2 1167.781ms
tsc.request.getEncodedSemanticClassifications 7 45324.864ms
tsc.request.getOutliningSpans 10 37602.221ms
bartlomieju commented 6 months ago

Please provide the repository that causes these issues.

guy-borderless commented 6 months ago

Please provide the repository that causes these issues.

Sent you a message on discord

ynwd commented 6 months ago

I have tried several projects.

from the small one, medium, to large.

cc: @nayeemrmn @bartlomieju

ynwd commented 6 months ago

i've tried this repo: https://github.com/denoland/saaskit

run the app and vs-code simultaneously. it's also very slow.

Deno Language Server Status

Workspace Settings

{
  "enable": true,
  "disablePaths": [],
  "enablePaths": null,
  "cache": null,
  "cacheOnSave": false,
  "certificateStores": null,
  "config": null,
  "importMap": null,
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": false
  },
  "internalDebug": false,
  "logFile": false,
  "lint": true,
  "documentPreloadLimit": 1000,
  "suggest": {
    "imports": {
      "autoDiscover": true,
      "hosts": {
        "https://deno.land": true
      }
    }
  },
  "testing": {
    "args": [
      "--allow-all",
      "--no-check"
    ]
  },
  "tlsCertificate": null,
  "unsafelyIgnoreCertificateErrors": null,
  "unstable": false,
  "javascript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "prompt"
    }
  },
  "typescript": {
    "inlayHints": {
      "parameterNames": {
        "enabled": "none",
        "suppressWhenArgumentMatchesName": true
      },
      "parameterTypes": {
        "enabled": false
      },
      "variableTypes": {
        "enabled": false,
        "suppressWhenTypeMatchesName": true
      },
      "propertyDeclarationTypes": {
        "enabled": false
      },
      "functionLikeReturnTypes": {
        "enabled": false
      },
      "enumMemberValues": {
        "enabled": false
      }
    },
    "preferences": {
      "importModuleSpecifier": "shortest",
      "jsxAttributeCompletionStyle": "auto",
      "autoImportFileExcludePatterns": [],
      "useAliasesForRenames": true,
      "quoteStyle": "auto"
    },
    "suggest": {
      "completeFunctionCalls": false,
      "includeAutomaticOptionalChainCompletions": true,
      "includeCompletionsForImportStatements": true,
      "names": true,
      "paths": true,
      "autoImports": true,
      "enabled": true,
      "classMemberSnippets": {
        "enabled": true
      },
      "objectLiteralMethodSnippets": {
        "enabled": true
      }
    },
    "updateImportsOnFileMove": {
      "enabled": "prompt"
    }
  }
}

Workspace Details

Performance (last 3 000 entries)

Name Count Duration
lsp.code_action 2 52.274ms
lsp.code_lens 1 0.005ms
lsp.document_symbol 1 3985.436ms
lsp.folding_range 1 4100.826ms
lsp.get_navigation_tree 1 3985.395ms
lsp.semantic_tokens_full 1 4142.469ms
tsc.host.getApplicableRefactors 2 50.013ms
tsc.host.getEncodedSemanticClassifications 1 2136.054ms
tsc.host.getNavigationTree 1 0.523ms
tsc.host.getOutliningSpans 1 0.591ms
tsc.op.op_load 1 0.026ms
tsc.op.op_resolve 222 0.068ms
tsc.op.op_script_names 2 22.808ms
tsc.op.op_script_version 2758 0.016ms
tsc.request.getApplicableRefactors 2 50.884ms
tsc.request.getEncodedSemanticClassifications 1 4141.809ms
tsc.request.getNavigationTree 1 3984.717ms
tsc.request.getOutliningSpans 1 4100.239ms

Performance (total)

Name Count Duration
lsp.code_action 199 128913.360ms
lsp.code_lens 143 1.264ms
lsp.completion 8 4160.295ms
lsp.completion_resolve 3 457.407ms
lsp.did_change 59 1237.351ms
lsp.did_change_watched_files 18 1.554ms
lsp.did_close 46 379.877ms
lsp.did_open 48 88.479ms
lsp.document_highlight 32 19824.990ms
lsp.document_symbol 70 108009.352ms
lsp.folding_range 82 24769.696ms
lsp.formatting 4 7.528ms
lsp.get_navigation_tree 70 108005.106ms
lsp.goto_definition 66 42485.534ms
lsp.hover 183 10877.823ms
lsp.initialize 1 596.351ms
lsp.references 2 81.573ms
lsp.semantic_tokens_full 76 106302.817ms
lsp.semantic_tokens_range 73 78203.362ms
lsp.testing_update 142 3528.657ms
lsp.update_cache 1 0.019ms
lsp.update_diagnostics_deps 143 631.102ms
lsp.update_diagnostics_lint 143 1666.410ms
lsp.update_diagnostics_ts 87 135556.440ms
lsp.update_import_map 1 2.124ms
lsp.update_registries 1 360.719ms
lsp.update_tsconfig 2 203.303ms
lsp.virtual_text_document 6 12.301ms
tsc.host.$configure 2 7.288ms
tsc.host.$getAssets 1 2.704ms
tsc.host.$getDiagnostics 85 65171.065ms
tsc.host.$getSupportedCodeFixes 1 1.083ms
tsc.host.findReferences 2 79.185ms
tsc.host.getApplicableRefactors 174 85598.167ms
tsc.host.getCodeFixesAtPosition 4 141.261ms
tsc.host.getCompletionEntryDetails 3 180.425ms
tsc.host.getCompletionsAtPosition 8 417.040ms
tsc.host.getDefinitionAndBoundSpan 58 13908.695ms
tsc.host.getDocumentHighlights 29 13246.967ms
tsc.host.getEncodedSemanticClassifications 146 33751.970ms
tsc.host.getNavigationTree 69 143.239ms
tsc.host.getOutliningSpans 76 127.540ms
tsc.host.getQuickInfoAtPosition 124 9806.365ms
tsc.op.op_is_node_file 269 1.121ms
tsc.op.op_load 1337 90.600ms
tsc.op.op_resolve 58208 5682.102ms
tsc.op.op_script_names 633 16719.714ms
tsc.op.op_script_version 670489 10425.029ms
tsc.request.$configure 2 202.415ms
tsc.request.$getAssets 1 3.262ms
tsc.request.$getSupportedCodeFixes 1 1.261ms
tsc.request.findReferences 2 80.436ms
tsc.request.getApplicableRefactors 196 128608.093ms
tsc.request.getCodeFixesAtPosition 6 2302.964ms
tsc.request.getCompletionEntryDetails 3 454.162ms
tsc.request.getCompletionsAtPosition 8 4151.284ms
tsc.request.getDefinitionAndBoundSpan 66 42404.189ms
tsc.request.getDocumentHighlights 32 19801.694ms
tsc.request.getEncodedSemanticClassifications 149 184384.224ms
tsc.request.getNavigationTree 70 107931.783ms
tsc.request.getOutliningSpans 82 24721.201ms
tsc.request.getQuickInfoAtPosition 173 10715.890ms
ilbertt commented 6 months ago

I was experiencing a similar issue. I managed to fix it by removing date-fns from my import_map.json. I was importing date-fns from https://esm.sh/date-fns@2.30.0. After removing the line from my import_map.json, Deno intellisense was working normally.

Same for me! Switching to npm: imports solved the issue.

joshpachner commented 5 months ago

I was experiencing a similar issue. I managed to fix it by removing date-fns from my import_map.json. I was importing date-fns from https://esm.sh/date-fns@2.30.0. After removing the line from my import_map.json, Deno intellisense was working normally.

Same for me! Switching to npm: imports solved the issue.

Looks like this worked for me too!

However, i dont think its actually importing date-fns anymore (no matter how many times i try to cache it, it still errors) image

guy-borderless commented 5 months ago

The main problem for me is the large delay when completing at a fresh line. Delay when in some statement is better now. Fresh line completion is important to me because when debugging I use a snippet for console log, and I sprinkle many of those. Say my snippet keyword is "lll", spreading console logs around is painful. Can we have some optimization for fresh line completion in a scope or snippet completion? Or some cache for when new statements don't change any symbols?