Skip to content

Commit 94bd3dd

Browse files
authored
Update IEx.Helpers docs for open/1 (#11787)
1 parent 68fa921 commit 94bd3dd

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

lib/iex/lib/iex/helpers.ex

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,24 +255,32 @@ defmodule IEx.Helpers do
255255
and falls back to `EDITOR` if the former is not available.
256256
257257
By default, it attempts to open the file and line using the
258-
`file:line` notation. For example, if your editor is called
259-
`subl`, it will open the file as:
258+
`file:line` notation. For example, for Sublime Text you can
259+
set it as:
260260
261+
ELIXIR_EDITOR="subl"
262+
263+
Which will then try to open it as:
264+
261265
subl path/to/file:line
262266
267+
For Visual Studio Code, once enabled on the command line,
268+
you can set it to:
269+
270+
ELIXIR_EDITOR="code --goto"
271+
263272
It is important that you choose an editor command that does
264273
not block nor that attempts to run an editor directly in the
265274
terminal. Command-line based editors likely need extra
266275
configuration so they open up the given file and line in a
267276
separate window.
268277
269-
Custom editors are supported by using the `__FILE__` and
270-
`__LINE__` notations, for example:
278+
For more complex use cases, you can use the `__FILE__` and
279+
`__LINE__` notations to explicitly interpolate the file and
280+
line into the command:
271281
272282
ELIXIR_EDITOR="my_editor +__LINE__ __FILE__"
273283
274-
and Elixir will properly interpolate values.
275-
276284
Since this function prints the result returned by the editor,
277285
`ELIXIR_EDITOR` can be set "echo" if you prefer to display the
278286
location rather than opening it.

0 commit comments

Comments
 (0)