New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error TS5042: Option 'project' cannot be mixed with source files on a command line. #32400

Closed
MerickOWA opened this Issue Aug 13, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@MerickOWA

MerickOWA commented Aug 13, 2017

  • VSCode Version: 1.14.2
  • OS Version: Windows 7

Steps to Reproduce:

  1. Create a project folder which contains a space separator character somewhere in the name
  2. Create a .vscode/tasks.json as the following
{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
    {
      "type": "typescript",
      "tsconfig": "tsconfig.json",
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ]
}
  1. Create a blank file .vscode/tsconfig.json

Launch build task results in

> Executing task: tsc -p "c:\Temp\Project Space\.vscode\tsconfig.json" <

error TS5042: Option 'project' cannot be mixed with source files on a command line.

Terminal will be reused by tasks, press any key to close it.

Task manager shows the launched process as

C:\Windows\system32\cmd.exe /c ""C:\Users\lsmith1\AppData\Roaming\npm\tsc.cmd" -p c:\Temp\Project Space\.vscode\tsconfig.json"

which is missing the quotes around the tsconfig.json file path.

@vscodebot vscodebot bot added the tasks label Aug 13, 2017

@dbaeumer dbaeumer added this to the August 2017 milestone Aug 14, 2017

@dbaeumer dbaeumer added the bug label Aug 14, 2017

@dbaeumer

This comment has been minimized.

Member

dbaeumer commented Aug 28, 2017

This needs some major work. The original idea was that providers of the command do the quoting since it can be rather complicated (under Linux single, double quote and escaping). But this doesn't cover variables. So I need to think about where to best do the escaping.

@dbaeumer dbaeumer modified the milestones: September 2017, August 2017 Aug 28, 2017

@dbaeumer dbaeumer added debt and removed bug labels Sep 25, 2017

@dbaeumer dbaeumer modified the milestones: September 2017, October 2017 Sep 25, 2017

@dbaeumer

This comment has been minimized.

Member

dbaeumer commented Sep 25, 2017

Need to shift. I spent September to work on multi root for tasks.

@dbaeumer dbaeumer modified the milestones: October 2017, November 2017 Oct 30, 2017

@dbaeumer

This comment has been minimized.

Member

dbaeumer commented Oct 30, 2017

We discussed several solutions and agreed that the extensions contributing the tasks need some OS / Shell independent API to do command line quoting. This is major API work and needs some time. Will start to work on it in November.

@HelloEdit

This comment has been minimized.

HelloEdit commented Feb 15, 2018

Any news ?

@dbaeumer

This comment has been minimized.

Member

dbaeumer commented Feb 19, 2018

This is still something that has priority to get addressed but due to the openness of the shell execution environment not so easy to address. It is assigned to a milestone for that reason and not on the backlog. But I have to admit it might not happen in February either since I went on a well deserved vacation :-)

@dbaeumer

This comment has been minimized.

Member

dbaeumer commented Mar 12, 2018

FIxed via #45576 which contains the necessary commit. Will work for tsc tasks out of the box.

Closing as dup of #45576

@dbaeumer dbaeumer closed this Mar 12, 2018

@dbaeumer dbaeumer added the *duplicate label Mar 12, 2018

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 26, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.