vscode_deno
vscode_deno copied to clipboard
LSP loses deno namespace info when switching from node subdirectory to deno subdirectory
Describe the bug
Deno LSP occasionally loses tsconfig lib info when working in mixed nodejs and deno environment.
To Reproduce
It's not guaranteed to be reproducible, but i got into this bug via
- create a new vite react+typescript project
- add deno.json and settings.json to only enable deno in
scripts/
subdirectory - work on vite(node) project
- return to
scripts/
, suddenlylib
info is gone such as"lib": ["deno.window"],
.vscode/settings.json
{
"deno.config": "./deno.jsonc",
"deno.enablePaths": ["scripts"],
"[typescript][typescriptreact][json][jsonc]": {
"editor.defaultFormatter": "denoland.vscode-deno"
}
}
deno.jsonc
{
"exclude": ["dist"],
"fmt": {
"semiColons": false,
"useTabs": true,
"proseWrap": "never"
}
}
tsconfig.json
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"exclude": ["scripts"],
"references": [{ "path": "./tsconfig.node.json" }]
}
Expected behavior
Deno LSP should not use the information from package.json
if there's already an deno.jsonc
.
Could not set npm package requirements. Error getting response at https://registry.npmjs.org/@mantine/core for package "@mantine/core": An npm specifier not found in cache: "@mantine/core", --cached-only is specified.
for example, despite having enablePaths
defined, vscode deno extension tries to analyze node path (src/App.tsx
) which is not in enablePaths
, ending up in error.
Screenshots
https://github.com/denoland/vscode_deno/assets/54838975/375f5152-9add-4f5c-ae32-9bf86f107750
Versions
vscode: 1.87.0 deno: 1.41.3+2ce6451 extension: v3.35.1