Skip to content
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

TypeScript build task output not populating error list with --pretty on #48711

Closed
mhegazy opened this issue Apr 25, 2018 · 4 comments
Closed
Assignees
Labels
typescript Typescript support issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@mhegazy
Copy link

mhegazy commented Apr 25, 2018

Issue Type: Bug

As of TypeScript 2.9, --pretty is enabled by default on a new ts project, however the error list does not seem to pick these up from build.

Is there anything specific on the TS side to add to the errors to make the errors grokable by the error list?

here are steps to reproduce

  • mkdir test
  • npm install typescript@next
  • tsc --init
  • add a .ts file with errors
  • code .
  • build

VS Code version: Code 1.22.2 (3aeede7, 2018-04-12T16:38:45.278Z)
OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (8 x 2112)
Memory (System) 15.93GB (6.67GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe stc
Screen Reader no
VM 0%
Extensions (1)
Extension Author (truncated) Version
xml Dot 1.9.2
ed by issue reporter -->
@vscodebot vscodebot bot added the typescript Typescript support issues label Apr 25, 2018
@weswigham
Copy link
Member

You can add a new problem matcher that matches pretty output:

{
                    "regexp": "^([^\\s].*):(\\d+:\\d+) - (error|warning|info)\\s+(TS\\d+)\\s*:\\s*(.*)$",
                    "file": 1,
                    "location": 2,
                    "severity": 3,
                    "code": 4,
                    "message": 5
}

@mhegazy
Copy link
Author

mhegazy commented Apr 25, 2018

Looks like the tsc problem matcher does not handle --pretty output for locations..

So we can either change it on our side and have --pretty emit the same file name/line number similar to the non-pretty mode, or we can add a new problem matcher regex or modify the tsc problem matcher.

@dbaeumer what would be your preference?

@dbaeumer dbaeumer added this to the April 2018 milestone Apr 26, 2018
dbaeumer added a commit that referenced this issue Apr 26, 2018
@dbaeumer
Copy link
Member

dbaeumer commented Apr 26, 2018

I fixed it on our end. Having two problem matchers is not nice for the users.

@mhegazy one thing: the fix now assumes that a message only contains line,column information and never line,column,endline,endcolumn which was possible with the old matcher. But to my knowledge TS always emitted line,column only. Right?

@dbaeumer
Copy link
Member

@mjbvz please review #48744 and merge if you think the fix is fine.

@mjbvz mjbvz closed this as completed in e329bb6 Apr 26, 2018
@mjbvz mjbvz added the verification-needed Verification of issue is requested label Apr 26, 2018
@chrmarti chrmarti added the verified Verification succeeded label Apr 27, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
typescript Typescript support issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants