noseglid / atom-build

:hammer: Build your project directly from the Atom editor
https://atom.io/packages/build
MIT License
248 stars 97 forks source link

Error matching not working? #592

Open KaneIrving opened 2 years ago

KaneIrving commented 2 years ago

Hi, I'm not sure how to get the error matching working my .atom-build.json file looks like:

{
  "cmd": "{PROJECT_PATH}/build.bat",
  "args": [],
  "sh": false,
  "cwd": "{PROJECT_PATH}/code",
  "env": {},
  "errorMatch": (?<file>[a-z]+\.[ch])
}

example error outputs look like:

C:\Users\Kane\Desktop\Game\code\game.c(24): error C2039: 'AspectRatoWidth': is not a member of 'state' C:\Users\Kane\Desktop\Game\code\game.h(28): note: see declaration of 'state' C:\Users\Kane\Desktop\Game\code\game.c(25): error C2146: syntax error: missing ';' before identifier 'State' C:\Users\Kane\Desktop\Game\code\game.c(27): error C2146: syntax error: missing ';' before identifier 'State'

I have tested it on https://regexr.com/ and it correctly gets 4 matches for the file names but in atom it doesn't say any errors and I can't cycle through with the keybinds, it doesn't seem to do anything. I may be missing something obvious as I'm not sure how this works.

KaneIrving commented 2 years ago

Not really sure what I was doing wrong but I made an .atom-build.yml instead and it works. would still like to know what was wrong with the .json version

bobemoe commented 1 year ago

Possibly an escaping issue? I just used the example from the docs (?<file>[\\/0-9a-zA-Z\\._]+):(?<line>\\d+):(?<col>\\d+):\\s+(?<message>.+) in a yml file and it didnt work. Turns out it doesn't require the double escape and this is the working one: (?<file>[\/0-9a-zA-Z\._]+):(?<line>\d+):(?<col>\d+):\s+(?<message>.+) in yml at least.

Maybe you needed the double escape in json? Just a guess and havent tested.