eclipse-theia/theia

Tasks: Diagnostics from problemMatchers not retrieved via vscode api

Open

#11.638 aperta il 6 set 2022

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)TypeScript (2478 fork)batch import
help wantedlanguagestasksvscode

Metriche repository

Star
 (18.676 star)
Metriche merge PR
 (Merge medio 12g 10h) (73 PR mergiate in 30 g)

Descrizione

Bug Description:

Diagnostics generated by custom problemMatchers are displayed correctly in the problem view but cannot be retrieved programmatically with vscode api: vscode.languages.getDiagnostics()

Steps to Reproduce:

  1. Open a workspace
  2. Create tasks.json in '.theia' folder at root level with task and command that should generate a diagnostic entry something like:
{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "echo error",
           "command": "echo",
            "args": ["src/main.c:6:11: error: expected ';' before '}' token"],
            "problemMatcher": {
                "label": "matcher test",
                "name": "matcher-test",
                "source": "matcher-test",
                "pattern": {
                    "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error|note):\\s+(.*)$",
                    "file": 1,
                    "line": 2,
                    "column": 3,
                    "severity": 4,
                    "message": 5
                }
            }
        },
    ]
}

If contributing with a command as of a vscode extension, the following: vscode.languages.getDiagnostics(); will not return the diagnostic for the corresponding file entry.

This is probably the root cause of the error lens extension not reflecting diagnostics from a problemMatcher contribution (confirmed this is working as expected in vscode)

Additional Information

  • Operating System: Windows 10
  • Theia Version: 1.27

Guida contributor