morassman/process-palette

Goto Line not working

shoedler opened this issue · 4 comments

This is a reference of https://discuss.atom.io/t/process-palette-path-line-detection/53768/20

The Issue

I have an ongoing Issue with the go-to-line functionality when my compile-command returns {stderr}.
If I try to click on the "link" to open the affected file, it will open it up but won't go to the correct line.

Here's an example console output of my {stderr} return:

2018-06-22 14_43_05-fc60181 lad c__projects_studer releasef atom

Please note how the file fc60181.lad and the parentheses with the line number (58) are underlined.

Next, here's how I setup my process-palette.json.
The following values are obviously from the command which generated the console output seen above.

Working Directory:

  • {projectPath}/Folder/Folder/src

And, probably more interesting is the pattern I used.
Pattern:

  • Expression: (path)\((line)
  • Path RegEx: (fc)(\d*?)(\.lad)

My attempts

I've tried printing the value of options.initialLine using an addInfo notification just after the atom.workspace.open (process-palette/lib/view/path-view.coffee line:29) command which returned NaN after clicking.

atom_path-view-coffee

This leads me to belive that the expression of the (line) group doesn't suit my needs.

However as I looked around in the source code, I couldn't find such a thing.

Is there a way of changing the - possibly inexistent - Regex for the (line) group? To get the line number - in my case - this Regex would require to look something like (\\d*?) or just (\\d)

Thanks in advance!

Hi @WashirePie

I admin that it's not obvious, but the groups defined in your custom Path RegEx interferes with the pattern matching. There's a section in Process Palette's documentation on it under "Important note about groups". I tested to make sure that it's the case and used fc\d*?\.lad as the regex and that did work.

When I tested I put a file called fc60181.lad in the root of my project and another one in a folder called temp just to make sure that sub folders work. I then added a commands that simply prints the path : echo "fc60181.lad" and another one with echo "temp/fc60181.lad".

The expression that I used was the same as yours : (path)\((line). I left the Path RegEx empty so that the default can be used. This worked. The file was opened and it navigated to line 58.

Try it without the Path RegEx.

hg42 commented

my pull request #36 also addresses these kinds of problems (better path/line regexp handling and more possibilities etc.).

Unfortunately it wasn't accepted (what's missing?) and passed out of mind.
I have to admit that I use Atom not that often nowadays, so I didn't update it to the current sources.

I see that the page of one of the necessary npm modules (regexp-tree) isn't available in npm currently and I don't see what's going on there. Though the latest version seems to be available via npm.

May be I should revisit my PR and make it work again. I should probably contact the developer of regexp-tree.
But time is limited...

Tried it - and it worked!
It feels like it's been ages and we've tried everything to get it to work. Super glad that it works now!
Thanks again for your inexhaustible support!

Awesome!