typescript - Unable to compile swift file in Visual Studio code and Windows 10 -
what trying use visual studio code compile swift language code trying run unfortunately getting error tasks.json file
error ts6054: file 'section-1.swift' must have extension '.ts' or '.d.ts'.
i have followed steps mentioned david owens ii http://owensd.io/2015/05/21/swift-vscode.html , referenced older stuff stack overflow , installed typescript npm command prompt , modified tasks.json file shown below
{ "version": "0.1.0", // command tsc. "command": "swiftc", // show output window if unrecognized errors occur. "showoutput": "silent", // under windows use tsc.exe. ensures don't need shell. "windows": { "command": "tsc.cmd" }, // args helloworld program compile. "args": ["section-1.swift"], // use standard tsc problem matcher find compile problems // in output. "problemmatcher": { "pattern": { "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", "file": 1, "line": 2, "column": 3, "severity": 4, "message": 5 } } }
my question in here file swift file how convert .ts file causing error?any appreciated.thanks
looks vscode trying execute file if ts file, , not swift file. perhaps it's following lines?
// under windows use tsc.exe. ensures don't need shell. "windows": { "command": "tsc.cmd" },
i know you're not on windows, vscode confused line, vs other line. perhaps try changing swift.cmd, or removing section entirely.
Comments
Post a Comment