denis-shienkov / vscode-qbs

Qbs Tools extension for VSCode
MIT License
23 stars 11 forks source link

Tree view of build issues in Problems pane #78

Open isgursoy opened 11 months ago

isgursoy commented 11 months ago

In VS Code, the "Problems" pane does not provide a tree/chain view for the build issues with QBS, and I need to read the entire QBS build output to find where the specific error comes from. "Problems" view only marks the lowest level location as the source of the error, standard library header. Screenshot from 2023-10-15 17-03-45

For example, Qt Creator can do that by quoting relevant build output under the entry listed in the "Issues" pane, so at least I can see the levels in textual form. Screenshot from 2023-10-15 17-16-49

Is there anything I can do on my side to fix that?

denis-shienkov commented 11 months ago

Hi, to be honest, I don't know. ))

Maybe it is impossible, you may look how it looks e.g. in CMake extension as an example. If there are a more usefull "issues" details, then we can copy/paste the implementation from there. ))

isgursoy commented 11 months ago

Maybe something like "Defining a multiline problem matcher" over the compiler's complete terminal log?

denis-shienkov commented 10 months ago

Maybe, but I have not ideas.

isgursoy commented 10 months ago

It is: https://code.visualstudio.com/docs/editor/tasks#_defining-a-multiline-problem-matcher:~:text=The%20pattern%27s%20first,regular%20expression%20matches.

denis-shienkov commented 10 months ago

AFAIK, it is impossible to do something like yo want, because the format of vscode.Diagnostic is different...

E.g. this code:

        collection.set(vscode.Uri.file("/opt/cloud/projects/xyz.cpp"), [{
            code: 'code-123',
            message: 'Hello, Im error message',
            range: new vscode.Range(new vscode.Position(11, 22), new vscode.Position(33, 44)),
            severity: vscode.DiagnosticSeverity.Error,
            source: '',
            relatedInformation: [
                new vscode.DiagnosticRelatedInformation(new vscode.Location(vscode.Uri.file("/opt/cloud/projects/foo.cpp"), new vscode.Position(1, 0)), 'Related message 1 blablabla'),
                new vscode.DiagnosticRelatedInformation(new vscode.Location(vscode.Uri.file("/opt/cloud/projects/bar.cpp"), new vscode.Position(10, 10)), 'Related message 2 blablabla'),
            ]
        }]);

produces the following issues on a pane:

изображение

So, what do you want to see at all in the issues pane?

isgursoy commented 10 months ago

Can we simply parse the error stack from compiler output for relatedInformation field as each layer for each "Related message"?

denis-shienkov commented 10 months ago

Maybe yes, maybe no, it depends on the used compiler.

You can provide some simple compiled error output (just for an example), and also provide a current QtC and VScode issues output for same errors... And then we can see how it can be improved for VSCode... Because that your screenshoots are soo complex. Need to start from something simple to understand a main idea how to do it..