You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This worked but now the plugin is trying to open files using Ubuntu paths like /home/ubuntu/path/to/my/repo/App.vue
So I've ended up doing some sorcery
#!/bin/bash# echo "Original args: $@" 1>&2# Function to decode URL-encoded stringsurldecode() {
local url_encoded="${1//+/ }"printf'%b'"${url_encoded//%/\\x}"
}
# Function to convert WSL path to Windows pathwsl_to_windows_path() {
wsl_path="$1"
windows_path=$(wslpath -w "$wsl_path")echo"$windows_path"
}
# Define the IntelliJ IDEA script path directly as a Windows path
idea_cmd="C:\\Users\\$(cmd.exe /C echo %USERNAME% | tr -d '\r')\\AppData\\Local\\JetBrains\\Toolbox\\scripts\\idea.cmd"# Iterate over all arguments and decode and convert paths if they exist
args=()
forargin"$@";do# echo "Original arg: $arg" 1>&2
decoded_arg=$(urldecode "$arg")# echo "Decoded arg: $decoded_arg" 1>&2if [[ "$decoded_arg"== /* ]];then# Extract the path after 'file=' and convert it
wsl_path="${decoded_arg#file=}"
wsl_path="${wsl_path%%:*}"# Strip line:column info (e.g., :0:0)
windows_arg=$(wsl_to_windows_path "$wsl_path")# echo "Converted path: $windows_arg" 1>&2
args+=("\"$windows_arg\"")
else
args+=("$decoded_arg")
fidone# Combine arguments into a single string for correct grouping
combined_args=$(printf "%s ""${args[@]}")# Print final arguments for debuggingecho"opening: ${combined_args}"1>&2# Call the IntelliJ IDEA script with the translated paths using Windows pathseval"cmd.exe /C '$idea_cmd${combined_args}' 1>&2"
It is ugly and dirty, but it works and now I can open files from your marvelous plugin.
Someone could make this kind of conversion as part of the plugin. If nobody picks this glove, I'll try to make a PR but it can take some time for that.
The text was updated successfully, but these errors were encountered:
I know this is something extremely low-priority guys, but some of us, clone repos inside of wsl2 env, and use idea from windows.
So if I configure idea as editor doing this:
In first instance, the plugin fails as it can't find idea in the path, so I made a
/usr/local/bin
bash script to pass the commands to Windows ideaThis worked but now the plugin is trying to open files using Ubuntu paths like
/home/ubuntu/path/to/my/repo/App.vue
So I've ended up doing some sorcery
It is ugly and dirty, but it works and now I can open files from your marvelous plugin.
Someone could make this kind of conversion as part of the plugin. If nobody picks this glove, I'll try to make a PR but it can take some time for that.
The text was updated successfully, but these errors were encountered: