My Vscode autocomplete isn’t shown new methods like str.at()
(ES2022) or str.replaceAll()
(ES2021). And this does not happen only with strings, but with any other new feature like ar.findLast()
(ES2023), etc… And this is happening with both .js and .ts files.
All is up to date: my node, my vscode and I have extensions like: IntelliCode, JavaScript and TypeScript Nightly and ES7+ React/Redux/React-Native snippets installed… (among others)
This is my settings.json
...
"emmet.syntaxProfiles": { "javascript": "jsx" },
"emmet.includeLanguages": {
"javascript": "javascriptreact",
"typescript": "typescriptreact",
"ejs": "html",
"django-html": "html"
},
"emmet.triggerExpansionOnTab": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"javascript.suggest.completeFunctionCalls": true,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"javascript.suggestionActions.enabled": true,
"javascript.referencesCodeLens.enabled": true,
"typescript.suggest.completeFunctionCalls": true,
"typescript.suggestionActions.enabled": true,
"typescript.updateImportsOnFileMove.enabled": "always",
"typescript.suggest.autoImports": true,
"typescript.referencesCodeLens.enabled": true,
"code-runner.saveAllFilesBeforeRun": true,
"code-runner.ignoreSelection": true,
//"code-runner.runInTerminal": true, //only 2 Python
"code-runner.clearPreviousOutput": true,
"code-runner.executorMap": {
"javascript": "node",
"typescript": "npx ts-node --files", //2 local install
//"typescript": "ts-node --files", //2 global install
"python": "set PYTHONIOENCODING=utf8 && venv\Scripts\python.exe -u", //code-runner exec python of venv
"bat": "cmd /c"
},
...
I already try chatGPT but it can not help me.
Someone know why they aren’t shown? And how I fix it?
Thanks
Well, I had the same problem while making one of my projects – I solved that I created the jsconfig.json
directly to workspace.
Code looks like this:
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Bundler",
"target": "ES2023", //this value is required to show this
"jsx": "react",
"allowImportingTsExtensions": true,
"strictNullChecks": true,
"strictFunctionTypes": true
},
"exclude": ["node_modules", "**/node_modules/*"]
}
If you don’t understand where create the file, you can see the file tree below, as an example
Workspace
├── README.md
├── jsconfig.js <<<
└── .gitignore
Okay, I dug it deeper, and if you want to change the target to all workspaces, just go to the settings and search for “target”.
Setting id: js/ts.implicitProjectConfig.target
Code to insert this to settings.json
:
...
"js/ts.implicitProjectConfig.target": "ES2022"
...
3