Compiler/problems output
MichaelBelgium opened this issue · 5 comments
Alright first things first, I'm sure I could see the compiler output in the "OUTPUT" tab. Since some time i've noticed it doesn't do that anymore - it does show it in the "PROBLEMS" tab and i'm fine with it but I think i've had both before ... not only just one.
EDIT: ok, it's showing in my terminal tab instead
Second; when there's a line on the "PROBLEMS" tab, clicking on one of those lines gives an error saying my file doesn't exists. I assume this has to do something with "relative" stuff. When i click on "create file", that shows next to the error, it creates a directory gamemodes
and mygamemode.pwn
within my - already existing - gamemodes
folder
My tasks.json
:
tasks.zip
To answer the first question, the output tab was never used - this is only for extension output, not task output. This may be the case in future when sampctl is integrated into the extension but for now, tasks.json is the only way and thus problems/terminal are the only outputs.
The next problem is tricky because vscode doesn't support absolute and relative paths in the same output. There's an open issue on the compiler: pawn-lang/compiler#247 to resolve this. sampctl already resolves this by outputting warnings and errors with full paths.
Now the actual issue you're encountering may be slightly different, it seems like the relative jump is going from the wrong path. The default pattern already includes a gamemodes
folder, I may remove this as it's based on an assumption.
Now, to resolve your issue you could simply replace the "problemMatcher": "$pawncc"
line with:
"problemMatcher": {
"name": "pawncc",
"owner": "pawn",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp":
"^(.*?)\\(([0-9]*)[- 0-9]*\\) \\: (fatal error|error|warning) [0-9]*\\: (.*)$",
"file": 1,
"location": 2,
"severity": 3,
"message": 4
}
}
And then you have the freedom to mess with the fileLocation
yourself and find what works based on your setup.
To answer the first question, the output tab was never used - this is only for extension output, not task output. This may be the case in future when sampctl is integrated into the extension but for now, tasks.json is the only way and thus problems/terminal are the only outputs.
Alright, nvm then. I guess I've been mistaken (or just saw it somewhere else)
About the relative issue, the piece of code actually made it work (thx for that). Although it does say Property name is not allowed
which refers to "name": "pawncc",
Oh yeah I think the name
property is only valid in the package.json
declaration, feel free to omit it in your tasks.json file, it'll make no difference.
Alright, great 😃
Going to re-open this as it's still an issue I need to solve on my end. Either by modifying package.json
to not include an explicit gamemodes/
subdirectory or by updating the documentation to be more specific about how vscode and pawncc use paths.