2015-11-04 2 views
2

Я пытаюсь отлаживать следующий код машинопись с помощью визуального кода Студия:Debugging Машинопись на VSCode

class Student { 
    fullname : string; 
    constructor(public firstname, public middleinitial, public lastname) { 
     this.fullname = firstname + " " + middleinitial + " " + lastname; 
    } 
} 

interface Person { 
    firstname: string; 
    lastname: string; 
} 

function greeter(person : Person) { 
    return "Hello, " + person.firstname + " " + person.lastname; 
} 

var user = new Student("Jane", "M.", "User"); 

console.log(greeter(user)); 

Это мой файл конфигурации launch.json:

{ 
    "version": "0.1.0", 
    // List of configurations. Add new configurations or edit existing ones. 
    "configurations": [ 
     { 
      // Name of configuration; appears in the launch configuration drop down menu. 
      "name": "TypeScriptDebugTest", 
      // Type of configuration. 
      "type": "node", 
      // Workspace relative or absolute path to the program. 
      "program": "./HelloWorld.ts", 
      // Automatically stop program after launch. 
      "stopOnEntry": false, 
      // Command line arguments passed to the program. 
      "args": [], 
      // Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace. 
      "cwd": ".", 
      // Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH. 
      "runtimeExecutable": null, 
      // Optional arguments passed to the runtime executable. 
      "runtimeArgs": ["--nolazy"], 
      // Environment variables passed to the program. 
      "env": { 
       "NODE_ENV": "development" 
      }, 
      // Use JavaScript source maps (if they exist). 
      "sourceMaps": true, 
      // If JavaScript source maps are enabled, the generated code is expected in this directory. 
      "outDir": "./built" 
     } 
    ] 
} 

Javascript скомпилированные файлы в созданная папка в корневом каталоге. Когда я пытаюсь отладить ту же ошибку продолжает ocurring: «Не удается подключиться к времени выполнения процесса (тайм-аут после 5000 мс)»

Примечание: Я хочу, чтобы отладить файл .ts, а не скомпилированный JavaScript.

Кто-нибудь знает, как это исправить?

Спасибо!

+0

Это с узлом 4.x? –

+0

Да @BenjaminPasero Я использую узел 4.x –

ответ

0

Поддержка отладочного узла 4.x входит в нашу следующую версию. Будьте на связи!

+0

Означает ли это 0.10.0 beta? У меня такая же проблема, пытаясь отладить расширение VSCod с помощью Node v4.2.1 в vscode 0.10.0 – JimTheDev

Смежные вопросы