anthraxx / intellij-awesome-console

IntelliJ IDEA plugin: awesome console finally makes links in your console at least 200% more awesome!
MIT License
159 stars 40 forks source link

pathes not recognized that contain `-` #15

Closed jameslnewell closed 7 years ago

jameslnewell commented 8 years ago

I installed the plugin but don't see any file paths highlighted. Looking at the source, the FILE_PATTERN regex isn't matching *nix paths like /Users/james/example/src/test-file.js

In an online regex tester, changing ([a-zA-Z0-9][a-zA-Z0-9/\\-_\\.]*\\.[a-zA-Z0-9\\-_\\.]+)((:|(, line ))(\\d+))? to ([a-zA-Z0-9][a-zA-Z0-9\/\\\-_\\.]*(?:\\|\/).[a-zA-Z0-9\\\-_\\.]+)((:|(, line ))(\\d+))? matches *nix paths.

anthraxx commented 8 years ago

this introduces a regression as java's regex definition does not need to escape '/'. However, we will of cause fix the problematic '-'

anthraxx commented 8 years ago

actually the code may be miss leading but absolute file names are matched via the URL matcher. also you can't just copy-paste that regex, you have to take java string escaping into account when copying. Are you sure that the printed file actually exists? We only create a link if that file really exists.

I have tested with /tmp/test-file.js and its properly linked via the (miss leading named) URL matcher

jameslnewell commented 8 years ago

Ah right. Yeah the file definitely exists, the path is printed as result of running eslint on the file.

/Users/james/example/src/test-file.js
  1:1   error  Unexpected alert                               no-alert
  ...

I thought maybe the colour or formatting codes might be interfering so I manually console.log()ed the path by itself with no change.

My software versions are:

OS X 10.11.3
PHPStorm 10
Build #PS-143.1770
JRE: 1.8.0_40-release-b119 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

I'm not familiar with debugging IntelliJ so let me know if I can provide more information.

Thanks!

anthraxx commented 8 years ago

can't reproduce. I created exactly your directory: /Users/james/example/src/test-file.js highlighted properly (as I created that file).

Do you see any links at all, so are you sure the plugin actually works for you at all? Can you print a link like https://github.com

jameslnewell commented 8 years ago

Nah they don't display either. Preferences > Plugins shows Awesome Console is installed and only gives the option of uninstalling. Is there an error log somewhere that would reveal what's going on?

anthraxx commented 8 years ago

Try to start IntelliJ (PHPStorm) in a way that it prints the logging to stdout started on a terminal. If it prints logging information during startup then it should print an error if something goes wrong.

jameslnewell commented 8 years ago

Here are the logs. There's a NullPointerException and some jediterm.terminal.TerminalMode errors logged but I don't know that they're related to this plugin.

anthraxx commented 8 years ago

Its not related to this plugin, but I may assume that it could be responsible for your plugin support breakage. Try to resolve that issue and see if this plugin starts working then. Also try to properly setup a log4j.xml somehow to get rid of "log4j:WARN Please initialize the log4j system properly." and see more then just warnings and errors

Currently I would say its not the fault of our plugin at all, we will see

anthraxx commented 7 years ago

we believe this issue is fixed in the 0.1337.6 release, which should appear soon in the plugin repositories (plugin already uploaded). If you still encounter issues, please notify us about it.