-
Notifications
You must be signed in to change notification settings - Fork 436
Open
Description
I couldn't get files to open in rubymine, debugged the issue and this is how I got it to work
- create a bash script to parse the url
/bin/handle_rubymine_url.sh
#!/bin/bash
url=$1
# Extract file path and line number from the URL (adjust regex if needed)
# The URL format is typically rubymine://open?url=file://FULL_LOCAL_PATH&line=LINE_NUMBER
file_path=$(echo "$url" | sed -e 's/rubymine:\/\/open?url=file:\/\///' -e 's/&line=[0-9]\+//g')
file_path=$(echo "$file_path" | sed "s/%2F/\//g")
line_number=$(echo "$url" | sed -e 's/rubymine:\/\/open?url=file:\/\/[^&]\+&line=//')
# Use the command-line launcher (e.g., 'mine') to open the file at the specified line
rubymine --line $line_number "$file_path"
(don't forget to chmod +x /bin/handle_rubymine_url.sh)
- create a desktop file that points to your bash script
~/.local/share/applications/rubymine_url.desktop
[Desktop Entry]
Name=RubyMine URL Handler
Exec=/bin/handle_rubymine_url.sh %u
Icon=rubymine
Terminal=false
Type=Application
MimeType=x-scheme-handler/rubymine;
- add the mime type to xdg
xdg-mime default rubymine_url.desktop x-scheme-handler/rubymine
- add this to your project
/config/environments/development.rb inside Rails.application.configure
BetterErrors.editor = "rubymine://open?url=file://%{file}&line=%{line}" if defined?(BetterErrors)
Metadata
Metadata
Assignees
Labels
No labels