eclipse-theia/theia

Tasks: Diagnostics from problemMatchers not retrieved via vscode api

Open

#11.638 aberto em 6 de set. de 2022

Ver no GitHub
 (0 comments) (0 reactions) (0 assignees)TypeScript (2.478 forks)batch import
help wantedlanguagestasksvscode

Métricas do repositório

Stars
 (18.676 stars)
Métricas de merge de PR
 (Mesclagem média 12d 10h) (73 fundiu PRs em 30d)

Description

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

Guia do colaborador