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

Problems without column information are always shown as column 1,1 #110561

Closed
GitMensch opened this issue Nov 13, 2020 · 6 comments
Closed

Problems without column information are always shown as column 1,1 #110561

GitMensch opened this issue Nov 13, 2020 · 6 comments
Assignees
Labels
tasks Task system issues

Comments

@GitMensch
Copy link
Contributor

VSCode Version: 1.15.0

Steps to Reproduce:

  1. Run with any problemmatcher that does not provide a specific column 8but file and line)
  2. ProblemPane shows the File, and underneath all Problems for that, all with the position [line, 1]
    3, the editor renders the error as underlined of col 0.

Does this issue occur when all extensions are disabled?: Yes

Expected behavior:

  1. ProblemPane shows only "Problem [line]", instead of "Problem [line, 1]"
  2. Editor underlines the complete line (ideally from first to last non-space)
@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug tasks Task system issues labels Nov 13, 2020
@alexr00 alexr00 added this to the On Deck milestone Nov 13, 2020
@alexr00 alexr00 removed this from the On Deck milestone Nov 12, 2021
@alexr00 alexr00 removed the bug Issue identified by VS Code Team member as probable bug label Nov 12, 2021
@alexr00
Copy link
Member

alexr00 commented Nov 12, 2021

  1. ProblemPane shows only "Problem [line]", instead of "Problem [line, 1]"

A column is always shown in the problems panel, so have the column shown there is by design.

  1. Editor underlines the complete line (ideally from first to last non-space)

This is currently possible! Simple set the location of your problem matcher to be the same value as the line:

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

@alexr00 alexr00 closed this as completed Nov 12, 2021
@GitMensch
Copy link
Contributor Author

Good to see that location works and from git blame the part was also in the docs when I've created that issue back in 2020. Thanks for pointing that out - I'm adjusting a bunch of definitions now :-)

To be specific: in this case line should be replaced by location if there is no separate column or it matches the common location:

  • If the problem location is line or line,column or startLine,startColumn,endLine,endColumn, then our generic location match group can be used.

Still - the "column 1" (what the issue is about) is confusing

A column is always shown in the problems panel, so have the column shown there is by design.

Hm, then I suggest to not default the column to 1 but to zero - and in the UI consider a design change "if column is zero don't show it". Even without the design change a column zero is much more clear "is related to the whole line", then the 1.

@alexr00 Would you consider reopening this issue for that part?

@alexr00
Copy link
Member

alexr00 commented Nov 15, 2021

@sandy081 for the problems view: would you consider not rendering a start column in the view if the start column of the marker is 0?

@sandy081
Copy link
Member

Not inclined to do as it causes inconsistency in UI and I think its good to show what the model has instead of hiding it. If data is invalid, probably it shall not be allowed in to the model.

@GitMensch
Copy link
Contributor Author

GitMensch commented Nov 16, 2021

if data is invalid, probably it shall not be allowed in to the model.

The point here is that currently a not-correct column 1 is inserted into the model and of course the UI shows what the model has. The idea is to change the model to get a not-wrong column zero inserted - and the question is: What could the UI show in this case?
To me it would be ideal if in this case no column would be rendered at all leaving only the correct line in the model to be rendered. But even a rendered column zero (showing the model actually does not provide a column) would be better than "wrong" data in the model - column 1 where no column is.

@sandy081
Copy link
Member

The idea is to change the model to get a not-wrong column zero inserted - and the question is: What could the UI show in this case?

IMO UI shall show what the model has especially we have multiple UIs rendering diagnostics.

CCing @jrieken for model change

@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tasks Task system issues
Projects
None yet
Development

No branches or pull requests

3 participants