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
Update nREPL server doc with supported and unsupported editors (#940)
Hi,
I have updated the nREPL server documentation in the `cli` section to
provide new instructions on how users can start the server for their
editor.
Additionally, I've a reference to it in the `REPL` page, so users whoa
re likely to be looking for the nREPL server, can locate it more easily.
I consider promoting the nREPL section to a new page next to `REPL`, but
decided to be discreet for now.
Any feedback would be greatly appreciated.
Thanks
---------
Co-authored-by: ikappaki <[email protected]>
The extension's ``Jack-in`` command is used to start an nREPL session and connect your editor to it.
50
+
51
+
With Emacs `CIDER v1.14 <https://docs.cider.mx/cider/platforms/basilisp.html>`_ and Visual Studio Code `Calva v2.0.453 <https://calva.io/basilisp/>`_ or later, you can ``Jack-in`` to a Basilisp project directly.
52
+
The extensions also recognize Basilisp ``.lpy`` files as Clojure files.
53
+
54
+
To ``Jack-in`` to a Basilisp project
55
+
56
+
1. Ensure that a ``basilisp.edn`` file is present at the root of your project, even if it is empty.
57
+
2. Run the ``Jack-in`` command in your editor and select ``Basilisp`` if prompted.
58
+
The Editor should then start the server and connect to it.
59
+
60
+
Start from an editor with a Clojure extension not yet supporting Basilisp
The extension's ``connect`` command is used to connect your editor to a running nREPL server.
65
+
It requires the port number where the server is running at.
66
+
67
+
.. note::
68
+
69
+
Basilisp code files use the ``.lpy`` filename suffix.
70
+
You might need to adjust your editor's extension settings to recognize this suffix as a Clojure file.
71
+
Alternatively, you can evaluate code inside ``.clj`` files, though importing these files from other Basilisp files might not be possible due to the different file extension.
72
+
73
+
If your editor extension does not yet support Basilisp, or if you prefer more control over the nREPL server, you can start the server from the command line and connect to using your extension's ``connect`` command.
74
+
75
+
The nREPL server when started will provide the host and port number it is listening on.
76
+
77
+
To view available command line options, use
78
+
79
+
.. code-block:: bash
80
+
81
+
basilisp nrepl-server -h
82
+
83
+
84
+
To start the server on a random port, use
43
85
44
86
.. code-block:: bash
45
87
46
88
basilisp nrepl-server
47
89
# => nREPL server started on port 50407 on host 127.0.0.1 - nrepl://127.0.0.1:50407
48
90
49
-
You can then establish a connection from your IDE to the server address.
50
91
51
-
- from `Emacs`, using `CIDER <https://github.com/clojure-emacs/cider>`_
92
+
To start the server on a specific port, use
93
+
94
+
.. code-block:: bash
95
+
96
+
basilisp nrepl-server --port 8889
97
+
#=> nREPL server started on port 8889 on host 127.0.0.1 - nrepl://127.0.0.1:8889
52
98
53
-
.. code-block::
99
+
Some extensions can connect to a running server automatically by looking for a ``.nrepl-port`` file at the root of the project. This file contains the port the server is listening on.
54
100
55
-
M-x cider-connect-clj
101
+
The ``nrepl-server`` command will generate this file in the current working directory where the server is started.
102
+
If your extension's ``connect`` command looks for this file, run the server command from the root of the project, so that is generated in there
56
103
57
-
- from `Visual Studio Code`, using `Calva <https://calva.io/>`_
104
+
.. code-block:: bash
58
105
59
-
.. code-block::
106
+
cd<project-root-directory>
107
+
basilisp nrepl-server
108
+
#=> nREPL server started on port 632128 on host 127.0.0.1 - nrepl://127.0.0.1:63128
109
+
110
+
Alternatively, specify the full path where this file should be generated using the ``--port-filepath`` CLI option
111
+
112
+
.. code-block:: bash
60
113
61
-
REPL -> Connect to a running REPL in your project -> Generic
0 commit comments