Is there any way to access file path to the current file in JetBrains Rider? I am looking for an environment variable or something similar that I can use to frame a URL, something that looks like www.abc.com/$FILE_PATH$
Asked
Active
Viewed 1,071 times
0

user1982519
- 515
- 5
- 24
-
Based on your [another question](https://stackoverflow.com/q/59887583/783119) .. I assume you are trying to use External Tools functionality. In such case -- yes, Macro for such purpose is available. https://www.jetbrains.com/help/rider/Settings_Tools_Create_Edit_Copy_Tool_Dialog.html -- use "Insert Macro" to see available and insert particular macro. – LazyOne Jan 25 '20 at 17:14
-
In my case, I want to open a url on browser and append the file path to it. Its not really an external tool – user1982519 Jan 27 '20 at 21:56
-
I want a functionality similar to "open in github", but I want to customize the url and not use github – user1982519 Jan 27 '20 at 22:04
-
I installed a plugin in Rider called 'CodeSearch'. It lets me open a url on the browser(hard coded like www.abc.com/). But I want to be able to let the tool know the file path to the current file to open the file I intend to. – user1982519 Jan 27 '20 at 22:28
-
You can use External Tools to execute external command (e.g. "open browser for this URL") and pass desired URL as a parameter. – LazyOne Jan 27 '20 at 22:55
-
I see..but the URL I have is not hard coded. It should append the path to the current file at the end of the url. How do I do that? Thank you for helping me :) – user1982519 Jan 28 '20 at 15:56
-
So .. assemble that URL as a parameter. Those available macro allow to get current file name, line and other stuff. Just check them. – LazyOne Jan 28 '20 at 16:15
-
Got it..thank you so much for all the help. I am all set – user1982519 Jan 28 '20 at 17:32
-
Please publish your solution as an answer then -- it will be useful for others in similar situation. – LazyOne Jan 28 '20 at 17:44
1 Answers
2
If anyone is curious, I did this.
Preferences -> Tools -> External Tools.
When I right click, I see "External tools" option. "I also mapped it to a keyboard shortcut.

user1982519
- 515
- 5
- 24