3

I am trying to get VSCode up and running with TypeScript and am having little success.

I am looking at the following:

https://code.visualstudio.com/docs/languages/typescript

It looks like once you have installed the compiler VSCode should just work but given the following:

tsconfig.json

{
  { 
  "compilerOptions": {
    "target": "es5",                          
    "module": "commonjs",                     
    "esModuleInterop": true                  
  }
}

package.json

{
  "name": "blahh",
  "version": "1.0.0",
  "description": "tryme",
  "main": "index.js",
  "author": "ghost",
  "license": "MIT",
  "devDependencies": {
    "typescript": "^3.4.5"
  }
}

tasks.json

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "tsc-watch",
      "command": "tsc",
      "args": ["-w", "-p", "."],
      "type":"shell",
      "isBackground": true,
      "group":"build",
      "problemMatcher": "$tslint5",
      "presentation":{
        "reveal": "always",
      }
    }
  ]
}

Project

enter image description here

HelloWorld.ts

function sayHello(name: string): void {
    console.log(`Hello ${name}!`);
}

sayHello(1);

Running the build task or tsc from the terminal correctly indicates an error until I change the 1 to a string then generates HelloWorld.js. The editor, however, is not working in that there is no intelliSense, code completion or error highlighting.

I have tried the following but this also has not worked:

VSCode TypeScript Intellisense not working

Other observations:

  1. No TypeScript version number shown in the border of the editor (as I see on the example screenshots I see)

enter image description here

  1. When adding the build task following: https://code.visualstudio.com/docs/editor/tasks#vscode there were no tsc:* templates shown.

VSCode Info

Version: 1.33.1 (user setup)
Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8
Date: 2019-04-11T08:27:14.102Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17134

Installed Extensions

Built In

TypeScript Language Basics: Enabled
... many others 

External

code --install-extension alanz.vscode-hie-server
code --install-extension alefragnani.Bookmarks
code --install-extension andyyaldoo.vscode-json
code --install-extension christian-kohler.path-intellisense
code --install-extension daiyy.quick-html-previewer
code --install-extension eamodio.gitlens
code --install-extension Edka.haskutil
code --install-extension esbenp.prettier-vscode
code --install-extension fabiospampinato.vscode-todo-plus
code --install-extension flowtype.flow-for-vscode
code --install-extension gcazaciuc.vscode-flow-ide
code --install-extension hoovercj.haskell-linter
code --install-extension jcanero.hoogle-vscode
code --install-extension justusadam.language-haskell
code --install-extension karigari.chat
code --install-extension mrmlnc.vscode-duplicate
code --install-extension ms-vscode.vscode-typescript-tslint-plugin
code --install-extension ms-vsliveshare.vsliveshare
code --install-extension ms-vsliveshare.vsliveshare-audio
code --install-extension ms-vsliveshare.vsliveshare-pack
code --install-extension phoityne.phoityne-vscode
code --install-extension SirTobi.code-clip-ring
code --install-extension WakaTime.vscode-wakatime

So what I am I missing / should I check for in my setup to enable the interactive VSCode features for TypeScript?

6
  • What does your typescript output look like in the Output tab of the built in terminal? Commented May 15, 2019 at 3:12
  • @DonovanHiland empty when starting project and viewing HelloWorld.ts. When running build task: ``` > Executing task: tsc -w -p . < [2:13:24 PM] Starting compilation in watch mode... [2:13:26 PM] Found 0 errors. Watching for file changes. ``` Commented May 15, 2019 at 4:14
  • Did you disable the builtin TypeScript and JavaScript Language Features extension? Search @builtin typescript the extension view for this. Also, what other extensions do you have installed? Commented May 15, 2019 at 18:49
  • @MattBierner TypeScript Language Basics is enabled will edit question to add extension Commented May 15, 2019 at 21:08
  • Is TypeScript and JavaScript Language Features enabled too? Commented May 15, 2019 at 22:09

1 Answer 1

9

Check that the builtin TypeScript and JavaScript Language Features extension is enabled. To do this, search @builtin typescript the extensions view.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.