Open mike-lischke opened 3 hours ago
Looks like somehow the Deno extension isn't enabled in this project properly, despite the config being set. Errors from the Deno extension end with deno-ts(<number>)
instead of ts(<number>)
.
Please make sure Deno extension is not disabled in user settings (ie. not workspace settings).
To me it looks as if the extension is active. I also have this:
But adding "DOM" to compilerSettings/lib made the deno-ts error disappear.
And removing the tsconfig.json file I had copied from another project to get the other problem solved also fixed the ts error for the console
calls. So, it's important not to have both tsconfig.json and the compiler options in deno.json.
This output is really strange - you indeed have Deno extension enabled, but in that case you should not have ts(...)
because Deno extension should disable the built-in TS server.
Does the situation change is you reload the VSCode window?
No, I reloaded VS Code already multiple times. Is it correct that VS Code shows TypeScript 5.6.3 in the status bar for main.ts?
Looks like the real issue is that the built-in TS language server is not disabled for some reasons. I also get errors for imported (npm) packages.
@mike-lischke could you please go to the Output
panel and select Deno Language Server
? Please paste the output of it.
What might be happening - the "user settings" have Deno disabled globally, you can check that by opening Command Pallete in VSCode and going to Preferences: Open User Settings (JSON)
and looking for any keys starting with deno.
. If you have any there, I suggest to remove them altogether.
This is the Deno LSP output:
Starting Deno language server... version: 2.0.2 (release, aarch64-apple-darwin) executable: /Users/mike/.deno/bin/deno Connected to "Visual Studio Code" 1.94.2 Enabling import suggestions for: https://deno.land Refreshing configuration tree... Resolved Deno configuration file: "file:///Volumes/Extern/Work/projects/ANTLRng2/deno.json" Resolved .npmrc: "/Users/mike/.npmrc" Resolved lockfile: "file:///Volumes/Extern/Work/projects/ANTLRng2/deno.lock" Server ready. Refreshing configuration tree... Resolved Deno configuration file: "file:///Volumes/Extern/Work/projects/ANTLRng2/deno.json" Resolved .npmrc: "/Users/mike/.npmrc" Resolved lockfile: "file:///Volumes/Extern/Work/projects/ANTLRng2/deno.lock" Refreshing configuration tree... Resolved Deno configuration file: "file:///Volumes/Extern/Work/projects/ANTLRng2/deno.json" Resolved .npmrc: "/Users/mike/.npmrc" Resolved lockfile: "file:///Volumes/Extern/Work/projects/ANTLRng2/deno.lock"
and the LSP status might be useful:
{
"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,
"internalInspect": 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": [],
"javascript": {
"inlayHints": {
"parameterNames": {
"enabled": "none",
"suppressWhenArgumentMatchesName": true
},
"parameterTypes": {
"enabled": true
},
"variableTypes": {
"enabled": false,
"suppressWhenTypeMatchesName": true
},
"propertyDeclarationTypes": {
"enabled": false
},
"functionLikeReturnTypes": {
"enabled": true
},
"enumMemberValues": {
"enabled": true
}
},
"preferences": {
"importModuleSpecifier": "shortest",
"jsxAttributeCompletionStyle": "auto",
"autoImportFileExcludePatterns": [],
"useAliasesForRenames": true,
"quoteStyle": "double"
},
"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": "double"
},
"suggest": {
"completeFunctionCalls": false,
"includeAutomaticOptionalChainCompletions": true,
"includeCompletionsForImportStatements": true,
"names": true,
"paths": true,
"autoImports": true,
"enabled": true,
"classMemberSnippets": {
"enabled": true
},
"objectLiteralMethodSnippets": {
"enabled": true
}
},
"updateImportsOnFileMove": {
"enabled": "always"
}
}
}
deno 2.0.2 (stable, release, aarch64-apple-darwin) v8 12.9.202.13-rusty typescript 5.6.2
The generated code is as expected:
however, this gives me the error:
All I did was to create a new folder, opened that in VS Code and ran
deno init
. Then I opened main.ts and got this. Not a good first impression, even thoughdeno main.ts
(ordeno run main.ts
for that matter) run fine.Further info: I have tsc 5.2.2 installed globally on my box and .vscode/settings.json just contains: