From b1c9ca7298d6210a7dce7fdf792332ffb6bbe4d1 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Wed, 14 Sep 2022 23:57:16 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editors/helix/manual.md | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 editors/helix/manual.md diff --git a/editors/helix/manual.md b/editors/helix/manual.md new file mode 100644 index 00000000000..0f249a70b07 --- /dev/null +++ b/editors/helix/manual.md @@ -0,0 +1,45 @@ +# Configuration +Currently, rome support `js`, `jsx`, `ts`, `tsx` four languages. Rome use a file socket to connect the editor client, +it should be a little different from other language server using a binary like `rust-analyzer`, +you could use `nc -U ${LANGUAGE_SERVER_SOCKET_PATH}` to connect your rome language server, `LANGUAGE_SERVER_SOCKET_PATH` could be got by +`rome __print_socket`, by default it is `/tmp/rome-socket`. More details why we need nc you could reference https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers + +**languages.toml** +```toml +[[language]] +name = "javascript" +scope = "source.js" +file-types = ["js"] +language-server = { command = "nc", args = ["-U", "/tmp/rome-socket"] } +formatter = { command = "rome", args = ["format", "--stdin-file-path", "test.js"]} +auto-format = true + +[[language]] +name = "jsx" +scope = "source.jsx" +file-types = ["jsx"] +language-server = { command = "nc", args = ["-U", "/tmp/rome-socket"] } +formatter = { command = "rome", args = ["format", "--stdin-file-path", "test.jsx"]} +auto-format = true +[[language]] +name = "typescript" +scope = "source.ts" +file-types = ["ts"] +language-server = { command = "nc", args = ["-U", "/tmp/rome-socket"] } +formatter = { command = "rome", args = ["format", "--stdin-file-path", "test.ts"]} +auto-format = true + +[[language]] +name = "tsx" +scope = "source.tsx" +file-types = ["tsx"] +language-server = { command = "nc", args = ["-U", "/tmp/rome-socket"] } +formatter = { command = "rome", args = ["format", "--stdin-file-path", "test.tsx"]} +auto-format = true + +``` + +# Limitation +1. The `rome-socket` will not automatically create when you reboot until you using command `rome __print_socket`. As a workaround, +you could write a init startup bash script. + From 075fe62316145efd242a0af233b3e376fbe1971d Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Thu, 15 Sep 2022 00:04:06 +0800 Subject: [PATCH 2/6] =?UTF-8?q?chore:=20=F0=9F=A4=96=20update=20video?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editors/helix/manual.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/editors/helix/manual.md b/editors/helix/manual.md index 0f249a70b07..4c4916a3442 100644 --- a/editors/helix/manual.md +++ b/editors/helix/manual.md @@ -43,3 +43,9 @@ auto-format = true 1. The `rome-socket` will not automatically create when you reboot until you using command `rome __print_socket`. As a workaround, you could write a init startup bash script. +# Video record +## Code Action +https://user-images.githubusercontent.com/17974631/190205045-aeb86f87-1915-4d8b-8aad-2c046443ba83.mp4 + +## Formatting +https://user-images.githubusercontent.com/17974631/190205065-ddfde866-5f7c-4f53-8a62-b6cbb577982f.mp4 \ No newline at end of file From 1992526291d45991f8975cd0804509526773f5c5 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Thu, 15 Sep 2022 00:09:18 +0800 Subject: [PATCH 3/6] =?UTF-8?q?chore:=20=F0=9F=A4=96=20tweak=20grammar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editors/helix/manual.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editors/helix/manual.md b/editors/helix/manual.md index 4c4916a3442..bf7d393e6e5 100644 --- a/editors/helix/manual.md +++ b/editors/helix/manual.md @@ -1,6 +1,6 @@ # Configuration -Currently, rome support `js`, `jsx`, `ts`, `tsx` four languages. Rome use a file socket to connect the editor client, -it should be a little different from other language server using a binary like `rust-analyzer`, +Currently, rome support `js`, `jsx`, `ts`, `tsx` four languages. Rome uses a file socket to connect the editor client, +which may be different from other language servers using a binary e.g. `rust-analyzer`. you could use `nc -U ${LANGUAGE_SERVER_SOCKET_PATH}` to connect your rome language server, `LANGUAGE_SERVER_SOCKET_PATH` could be got by `rome __print_socket`, by default it is `/tmp/rome-socket`. More details why we need nc you could reference https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers @@ -40,7 +40,7 @@ auto-format = true ``` # Limitation -1. The `rome-socket` will not automatically create when you reboot until you using command `rome __print_socket`. As a workaround, +1. The `rome-socket` will not automatically create when you reboot until you use the command `rome __print_socket`. As a workaround, you could write a init startup bash script. # Video record From 21c90adb67cc6b8997eaad162bc6f0a2714408ca Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Thu, 15 Sep 2022 21:38:58 +0800 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20=F0=9F=90=9B=20cr=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editors/helix/manual.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/editors/helix/manual.md b/editors/helix/manual.md index bf7d393e6e5..c995d83bf1f 100644 --- a/editors/helix/manual.md +++ b/editors/helix/manual.md @@ -1,8 +1,15 @@ # Configuration -Currently, rome support `js`, `jsx`, `ts`, `tsx` four languages. Rome uses a file socket to connect the editor client, -which may be different from other language servers using a binary e.g. `rust-analyzer`. -you could use `nc -U ${LANGUAGE_SERVER_SOCKET_PATH}` to connect your rome language server, `LANGUAGE_SERVER_SOCKET_PATH` could be got by -`rome __print_socket`, by default it is `/tmp/rome-socket`. More details why we need nc you could reference https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers +Currently, rome supports the following file extensions: `js`, `jsx`, `ts`, `tsx` and `d.ts`. + +Rome uses a file socket to connect the editor client, which may be different from other language servers using a binary e.g. `rust-analyzer`. + +You can use `nc -U ${LANGUAGE_SERVER_SOCKET_PATH}` to connect to the Rome language server. `LANGUAGE_SERVER_SOCKET_PATH` is path to where the Rome's socket is created. Rome creates that socket inside the temporary folder of the operative system, inside a folder called `rome-socket`. + +To know the path of your OS, run the command: +```shell +rome __print_socket +``` +More details why we need `nc`, please read the [wiki page of helix](https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers) **languages.toml** ```toml @@ -38,6 +45,8 @@ formatter = { command = "rome", args = ["format", "--stdin-file-path", "test.tsx auto-format = true ``` +`/tmp/rome-socket` is the default socket file path in Linux, I tested on Linux. If anything goes wrong, please double check if the +path equals to `rome __print_socket` # Limitation 1. The `rome-socket` will not automatically create when you reboot until you use the command `rome __print_socket`. As a workaround, From 67165d818c48846fca1eb6f9ea0ff305c7887b6f Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY <974153916@qq.com> Date: Thu, 15 Sep 2022 22:39:30 +0800 Subject: [PATCH 5/6] Update editors/helix/manual.md Co-authored-by: Emanuele Stoppa --- editors/helix/manual.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/editors/helix/manual.md b/editors/helix/manual.md index c995d83bf1f..ff7d90c838d 100644 --- a/editors/helix/manual.md +++ b/editors/helix/manual.md @@ -45,8 +45,7 @@ formatter = { command = "rome", args = ["format", "--stdin-file-path", "test.tsx auto-format = true ``` -`/tmp/rome-socket` is the default socket file path in Linux, I tested on Linux. If anything goes wrong, please double check if the -path equals to `rome __print_socket` +`/tmp/rome-socket` is the default socket file path in Linux. Use the command `rome __print_socket` and use the correct value. # Limitation 1. The `rome-socket` will not automatically create when you reboot until you use the command `rome __print_socket`. As a workaround, From 112a6ce4eaec45aedc1653d9259e8391b05db6b9 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY <974153916@qq.com> Date: Thu, 15 Sep 2022 22:39:42 +0800 Subject: [PATCH 6/6] Update editors/helix/manual.md Co-authored-by: Emanuele Stoppa --- editors/helix/manual.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/editors/helix/manual.md b/editors/helix/manual.md index ff7d90c838d..da4ab2320f6 100644 --- a/editors/helix/manual.md +++ b/editors/helix/manual.md @@ -48,8 +48,7 @@ auto-format = true `/tmp/rome-socket` is the default socket file path in Linux. Use the command `rome __print_socket` and use the correct value. # Limitation -1. The `rome-socket` will not automatically create when you reboot until you use the command `rome __print_socket`. As a workaround, -you could write a init startup bash script. +1. The socket is not automatically created, and you need to call the command [`rome start`](https://rome.tools/#rome-start) in order to create one. Use the command [`rome stop`](https://rome.tools/#rome-stop) to free the socket. # Video record ## Code Action