Skip to content

Extra reportsUnnecessary suggestions for syntactically invalid file #25591

Closed
@mjbvz

Description

@mjbvz

From microsoft/vscode#52346

TypeScript Version: 3.0.0-dev.20180706

Search Terms:

  • reportsUnnecessary
  • diagnostics
  • suggestions

Code
For the invalid code (with extra d after the 1):

export const _ = 1;

const a = 1 d;

Bug
See a suggestion diagnostic:

  {
            "start": {
                "line": 3,
                "offset": 1
            },
            "end": {
                "line": 3,
                "offset": 15
            },
            "text": "All variables are unused.",
            "code": 6199,
            "category": "suggestion",
            "reportsUnnecessary": true
        }

This causes the entire line to become faded out. I do not believe we should report these errors when there are syntax errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions