turbo-editors/turbo-golopublic Fork 0
b2b07ec
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-golo.git
git clone ssh://git@rickub.com/turbo-editors/turbo-golo.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

📦 Turbo Golo

k33g committed 2026-09-20T09:17:49+02:00 Browse files
b2b07ec parent: dbc7ac5
added .memory/handoffs/2026-09-20-load-config.md +17 -0
new file mode 100644
@@ -0,0 +1,17 @@
1+# Handoff — 2026-09-20 — `-load-config` (needs turbo-core v1.0.3)
2+
3+## State
4+
5+- `-load-config <url>` wired in `main.go`, three tests in `main_test.go`, docs EN+FR updated. Green under the umbrella `go.work` (`turbo-editors/`), which resolves turbo-core to the local checkout.
6+- **`go.mod` still says turbo-core v1.0.2** — `GOWORK=off make check` fails until turbo-core v1.0.3 is tagged and this is re-pinned. Even under the workspace, the two release-script tests (`TestTheTagScript…`) fail for the same reason: they build a copy of the module outside it. Everything else is green.
7+
8+## Next steps
9+
10+1. When turbo-core v1.0.3 is tagged: `go get rickub.com/turbo-editors/turbo-core@v1.0.3 && go mod tidy && GOWORK=off make check`.
11+2. Try it for real: in an empty directory, `turbo-golo -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init` (the sample repository holds `.turbo-go` only — for this editor a directory with a `.turbo-golo` is needed), then start `turbo-golo` and check the settings took.
12+3. Then `./01-release.tag.sh` as usual.
13+
14+## Traps
15+
16+- The sample configs repository is `rickub.com/turbo-editors/configs`; its git address is `git.rickub.com`, which `configrepo` tries second. A wrong first candidate costs one `ls-remote`, not the load.
17+- The editor refuses when `.turbo-golo` already exists (`configrepo.ErrExists`); there is deliberately no `--force`.
new file mode 100644
@@ -0,0 +1,17 @@
1+# Handoff — 2026-09-20 — `-load-config` (needs turbo-core v1.0.3)
2+
3+## State
4+
5+- `-load-config <url>` wired in `main.go`, three tests in `main_test.go`, docs EN+FR updated. Green under the umbrella `go.work` (`turbo-editors/`), which resolves turbo-core to the local checkout.
6+- **`go.mod` still says turbo-core v1.0.2** — `GOWORK=off make check` fails until turbo-core v1.0.3 is tagged and this is re-pinned. Even under the workspace, the two release-script tests (`TestTheTagScript…`) fail for the same reason: they build a copy of the module outside it. Everything else is green.
7+
8+## Next steps
9+
10+1. When turbo-core v1.0.3 is tagged: `go get rickub.com/turbo-editors/turbo-core@v1.0.3 && go mod tidy && GOWORK=off make check`.
11+2. Try it for real: in an empty directory, `turbo-golo -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init` (the sample repository holds `.turbo-go` only — for this editor a directory with a `.turbo-golo` is needed), then start `turbo-golo` and check the settings took.
12+3. Then `./01-release.tag.sh` as usual.
13+
14+## Traps
15+
16+- The sample configs repository is `rickub.com/turbo-editors/configs`; its git address is `git.rickub.com`, which `configrepo` tries second. A wrong first candidate costs one `ls-remote`, not the load.
17+- The editor refuses when `.turbo-golo` already exists (`configrepo.ErrExists`); there is deliberately no `--force`.
modified .memory/history.md +9 -0
@@ -81,3 +81,12 @@ One dated entry per session, appended at the end. Never rewritten.
8181 - **Changes, tests**: the four-question test replaced by `TestFindReferencesWithRealGoloLSP` (3 locations: lines 3, 8, 12), `TestFindImplementationsWithRealGoloLSP` (the declaration), `TestSymbolsAcrossTheProjectWithRealGoloLSP` (`helper`, and `elsewhere` in a file written after start and never opened) and `TestGoloLSPDoesNotAnswerTypeDefinitionWithRealGoloLSP`; new constant `secondCallLine = 12`. Ten real-server tests, all green here against v0.2.0.
8282 - **Changes, docs** (EN + FR): `how-to/enable-completion.md` (table, the “without a key” sentence, the boundary paragraph), `reference/keyboard.md`, `reference/menus.md` (intro and three rows), `how-to/ask-about-code.md` (table, paragraph, the `No … found` row, the `Ctrl-T` bullet), `how-to/navigate-code.md`, `explanation/colouring-and-completion.md`, `explanation/design-decisions.md`, `explanation/architecture.md` (ten tests, two new bullets, the closing paragraph), `how-to/run-the-tests.md`; `README.md` feature bullet; `.memory/summary.md` two bullets. Each page now says the boundary is `typeDefinition` alone and that the test is how the other three were noticed.
8383 - **Not done**: not committed — `01-release.tag.sh` is to be run again by the user. `diagnosticProvider` (pull diagnostics) is newly advertised too; turbo-core reads `publishDiagnostics` only, and the diagnostics tests still pass, so the server also pushes. Not investigated further.
84+
85+## 2026-09-20 — `-load-config <url>`: a shared `.turbo-golo` fetched from a repository
86+
87+- **Asked** (umbrella session, ticket #25 of `turbo-editors/.tickets`): `turbo-golo --load-config <forge URL>` fetches the `.turbo-golo` found at that directory of the repository and copies it into the working directory; the same for every Turbo editor with its own directory name.
88+- **Changes**: `main.go` — `loadConfig` option and flag, `case opts.loadConfig != ""` in `run`, `loadConfig` and `describeLoad`; the work itself is turbo-core's new `configrepo` package (git ls-remote + shallow clone; rickub, GitHub, GitLab, Codeberg URLs). `main_test.go` — three tests (`describeLoad` ×2, `loadConfig` refuses when `.turbo-golo` exists, no network needed). Docs: `docs/{en,fr}/reference/cli.md` (flag, example, files, errors), `docs/{en,fr}/how-to/configure-a-project.md` (new section).
89+- **Depends on turbo-core v1.0.3**, not yet tagged: `go.mod` still pins v1.0.2, so this builds only under the umbrella `go.work` (`turbo-editors/README.md` explains) until `go get rickub.com/turbo-editors/turbo-core@v1.0.3 && go mod tidy`. Verified with `make check` under that workspace.
90+- **Not done**: not committed; go.mod not re-pinned; not run against a real terminal.
91+- **Correction, same session**: under the workspace everything passes **except `TestTheTagScriptTagsAndPushesForReal` and `TestTheTagScriptRefusesATagItAlreadyPublished`** — they copy the module elsewhere and run `make check` there, outside the workspace, where turbo-core v1.0.2 from the proxy has no `configrepo`. They go green the moment `go.mod` is re-pinned to v1.0.3. The package diagram (`docs/diagrams/packages.drawio`, where the module has one) gained a `configrepo` box and a `main → configrepo` arrow, which its own test demanded.
92+
@@ -81,3 +81,12 @@ One dated entry per session, appended at the end. Never rewritten.
81 - **Changes, tests**: the four-question test replaced by `TestFindReferencesWithRealGoloLSP` (3 locations: lines 3, 8, 12), `TestFindImplementationsWithRealGoloLSP` (the declaration), `TestSymbolsAcrossTheProjectWithRealGoloLSP` (`helper`, and `elsewhere` in a file written after start and never opened) and `TestGoloLSPDoesNotAnswerTypeDefinitionWithRealGoloLSP`; new constant `secondCallLine = 12`. Ten real-server tests, all green here against v0.2.0.81 - **Changes, tests**: the four-question test replaced by `TestFindReferencesWithRealGoloLSP` (3 locations: lines 3, 8, 12), `TestFindImplementationsWithRealGoloLSP` (the declaration), `TestSymbolsAcrossTheProjectWithRealGoloLSP` (`helper`, and `elsewhere` in a file written after start and never opened) and `TestGoloLSPDoesNotAnswerTypeDefinitionWithRealGoloLSP`; new constant `secondCallLine = 12`. Ten real-server tests, all green here against v0.2.0.
82 - **Changes, docs** (EN + FR): `how-to/enable-completion.md` (table, the “without a key” sentence, the boundary paragraph), `reference/keyboard.md`, `reference/menus.md` (intro and three rows), `how-to/ask-about-code.md` (table, paragraph, the `No … found` row, the `Ctrl-T` bullet), `how-to/navigate-code.md`, `explanation/colouring-and-completion.md`, `explanation/design-decisions.md`, `explanation/architecture.md` (ten tests, two new bullets, the closing paragraph), `how-to/run-the-tests.md`; `README.md` feature bullet; `.memory/summary.md` two bullets. Each page now says the boundary is `typeDefinition` alone and that the test is how the other three were noticed.82 - **Changes, docs** (EN + FR): `how-to/enable-completion.md` (table, the “without a key” sentence, the boundary paragraph), `reference/keyboard.md`, `reference/menus.md` (intro and three rows), `how-to/ask-about-code.md` (table, paragraph, the `No … found` row, the `Ctrl-T` bullet), `how-to/navigate-code.md`, `explanation/colouring-and-completion.md`, `explanation/design-decisions.md`, `explanation/architecture.md` (ten tests, two new bullets, the closing paragraph), `how-to/run-the-tests.md`; `README.md` feature bullet; `.memory/summary.md` two bullets. Each page now says the boundary is `typeDefinition` alone and that the test is how the other three were noticed.
83 - **Not done**: not committed — `01-release.tag.sh` is to be run again by the user. `diagnosticProvider` (pull diagnostics) is newly advertised too; turbo-core reads `publishDiagnostics` only, and the diagnostics tests still pass, so the server also pushes. Not investigated further.83 - **Not done**: not committed — `01-release.tag.sh` is to be run again by the user. `diagnosticProvider` (pull diagnostics) is newly advertised too; turbo-core reads `publishDiagnostics` only, and the diagnostics tests still pass, so the server also pushes. Not investigated further.
84+
85+## 2026-09-20 — `-load-config <url>`: a shared `.turbo-golo` fetched from a repository
86+
87+- **Asked** (umbrella session, ticket #25 of `turbo-editors/.tickets`): `turbo-golo --load-config <forge URL>` fetches the `.turbo-golo` found at that directory of the repository and copies it into the working directory; the same for every Turbo editor with its own directory name.
88+- **Changes**: `main.go` — `loadConfig` option and flag, `case opts.loadConfig != ""` in `run`, `loadConfig` and `describeLoad`; the work itself is turbo-core's new `configrepo` package (git ls-remote + shallow clone; rickub, GitHub, GitLab, Codeberg URLs). `main_test.go` — three tests (`describeLoad` ×2, `loadConfig` refuses when `.turbo-golo` exists, no network needed). Docs: `docs/{en,fr}/reference/cli.md` (flag, example, files, errors), `docs/{en,fr}/how-to/configure-a-project.md` (new section).
89+- **Depends on turbo-core v1.0.3**, not yet tagged: `go.mod` still pins v1.0.2, so this builds only under the umbrella `go.work` (`turbo-editors/README.md` explains) until `go get rickub.com/turbo-editors/turbo-core@v1.0.3 && go mod tidy`. Verified with `make check` under that workspace.
90+- **Not done**: not committed; go.mod not re-pinned; not run against a real terminal.
91+- **Correction, same session**: under the workspace everything passes **except `TestTheTagScriptTagsAndPushesForReal` and `TestTheTagScriptRefusesATagItAlreadyPublished`** — they copy the module elsewhere and run `make check` there, outside the workspace, where turbo-core v1.0.2 from the proxy has no `configrepo`. They go green the moment `go.mod` is re-pinned to v1.0.3. The package diagram (`docs/diagrams/packages.drawio`, where the module has one) gained a `configrepo` box and a `main → configrepo` arrow, which its own test demanded.
92+
modified .memory/summary.md +5 -0
@@ -104,3 +104,8 @@ go list -f '{{.Dir}}' rickub.com/turbo-editors/turbo-core/app # must NOT be un
104104 - **Module path `rickub.com/turbo-editors/turbo-golo`**, depending on `rickub.com/turbo-editors/turbo-core v1.0.0` — the first turbo-core version published under that path (`v0.9.0` on the proxy still declares the Codeberg path and cannot be required as `rickub.com/…`). Every import, the Makefile's `VERSION_PKG`, `scripts/install.sh`, the README and the docs say `rickub.com`. `GOWORK=off make check` green. The repository on this side is a fresh `git init` with `origin` at `ssh://git@rickub.com/turbo-editors/turbo-golo.git` and **no commit yet**; `01-release.tag.sh` makes the first one.
105105 - **Releases are one script and one workflow**, modelled on turbo-core's and identical to turbo-go's. `01-release.tag.sh` runs `make check` under `TURBO_GOLO_RELEASING=1`, refuses a tag taken locally or on origin (bump, never move), refuses a `replace` in `go.mod`, commits, pushes the current branch, then tags and pushes the tag. That push starts `.github/workflows/release.yml`: `go test` with `TURBO_GOLO_RELEASING=1`, `./02-build-releases.sh "${GITHUB_REF_NAME}"`, release notes from the tag message, a run artifact, then `softprops/action-gh-release@v2` attaching `turbo-golo-*`, `SHA256SUMS` and `README.md` with the job's own `GITHUB_TOKEN` — the only credential Rickub's release API accepts. **`02-release.publish.sh` and `04-release.upload-binaries.sh` are gone**; the build script is now `02-build-releases.sh`, takes the tag as `$1` (CI has no `release.env`), validates it, refuses a `replace`, and starts from an empty `release/${TAG}/`. `release.env` holds only `TAG` and `ABOUT`; `turbo-golo.token.env` is read by nothing.
106106 - **`release_test.go`** runs `01` for real against a throwaway bare remote (publishes, then refuses the same tag), runs `02` alone to see it refuse `v0.o.0`, and asserts the workflow's trigger, `contents: write`, `./02-build-releases.sh`, `fail_on_unmatched_files`, docs linked at the tag, no `secrets.`, and `TURBO_GOLO_RELEASING`. The copy of the module for the clone leaves out `.git`, `bin`, `release`, `kits`, `demo`, `demos`, `*.env` and `go.work*`; children run with `GOWORK=off`.
107+
108+## State as of 2026-09-20
109+
110+- **`-load-config <url>` is wired** (`main.go`: `loadConfig`, `describeLoad`), on top of turbo-core's `configrepo`. It needs **turbo-core v1.0.3**, which is not tagged yet; `go.mod` pins v1.0.2, so the editor builds only under the umbrella `go.work` until re-pinned. A project with a `.turbo-golo` already is refused, not overwritten.
111+
@@ -104,3 +104,8 @@ go list -f '{{.Dir}}' rickub.com/turbo-editors/turbo-core/app # must NOT be un
104 - **Module path `rickub.com/turbo-editors/turbo-golo`**, depending on `rickub.com/turbo-editors/turbo-core v1.0.0` — the first turbo-core version published under that path (`v0.9.0` on the proxy still declares the Codeberg path and cannot be required as `rickub.com/…`). Every import, the Makefile's `VERSION_PKG`, `scripts/install.sh`, the README and the docs say `rickub.com`. `GOWORK=off make check` green. The repository on this side is a fresh `git init` with `origin` at `ssh://git@rickub.com/turbo-editors/turbo-golo.git` and **no commit yet**; `01-release.tag.sh` makes the first one.104 - **Module path `rickub.com/turbo-editors/turbo-golo`**, depending on `rickub.com/turbo-editors/turbo-core v1.0.0` — the first turbo-core version published under that path (`v0.9.0` on the proxy still declares the Codeberg path and cannot be required as `rickub.com/…`). Every import, the Makefile's `VERSION_PKG`, `scripts/install.sh`, the README and the docs say `rickub.com`. `GOWORK=off make check` green. The repository on this side is a fresh `git init` with `origin` at `ssh://git@rickub.com/turbo-editors/turbo-golo.git` and **no commit yet**; `01-release.tag.sh` makes the first one.
105 - **Releases are one script and one workflow**, modelled on turbo-core's and identical to turbo-go's. `01-release.tag.sh` runs `make check` under `TURBO_GOLO_RELEASING=1`, refuses a tag taken locally or on origin (bump, never move), refuses a `replace` in `go.mod`, commits, pushes the current branch, then tags and pushes the tag. That push starts `.github/workflows/release.yml`: `go test` with `TURBO_GOLO_RELEASING=1`, `./02-build-releases.sh "${GITHUB_REF_NAME}"`, release notes from the tag message, a run artifact, then `softprops/action-gh-release@v2` attaching `turbo-golo-*`, `SHA256SUMS` and `README.md` with the job's own `GITHUB_TOKEN` — the only credential Rickub's release API accepts. **`02-release.publish.sh` and `04-release.upload-binaries.sh` are gone**; the build script is now `02-build-releases.sh`, takes the tag as `$1` (CI has no `release.env`), validates it, refuses a `replace`, and starts from an empty `release/${TAG}/`. `release.env` holds only `TAG` and `ABOUT`; `turbo-golo.token.env` is read by nothing.105 - **Releases are one script and one workflow**, modelled on turbo-core's and identical to turbo-go's. `01-release.tag.sh` runs `make check` under `TURBO_GOLO_RELEASING=1`, refuses a tag taken locally or on origin (bump, never move), refuses a `replace` in `go.mod`, commits, pushes the current branch, then tags and pushes the tag. That push starts `.github/workflows/release.yml`: `go test` with `TURBO_GOLO_RELEASING=1`, `./02-build-releases.sh "${GITHUB_REF_NAME}"`, release notes from the tag message, a run artifact, then `softprops/action-gh-release@v2` attaching `turbo-golo-*`, `SHA256SUMS` and `README.md` with the job's own `GITHUB_TOKEN` — the only credential Rickub's release API accepts. **`02-release.publish.sh` and `04-release.upload-binaries.sh` are gone**; the build script is now `02-build-releases.sh`, takes the tag as `$1` (CI has no `release.env`), validates it, refuses a `replace`, and starts from an empty `release/${TAG}/`. `release.env` holds only `TAG` and `ABOUT`; `turbo-golo.token.env` is read by nothing.
106 - **`release_test.go`** runs `01` for real against a throwaway bare remote (publishes, then refuses the same tag), runs `02` alone to see it refuse `v0.o.0`, and asserts the workflow's trigger, `contents: write`, `./02-build-releases.sh`, `fail_on_unmatched_files`, docs linked at the tag, no `secrets.`, and `TURBO_GOLO_RELEASING`. The copy of the module for the clone leaves out `.git`, `bin`, `release`, `kits`, `demo`, `demos`, `*.env` and `go.work*`; children run with `GOWORK=off`.106 - **`release_test.go`** runs `01` for real against a throwaway bare remote (publishes, then refuses the same tag), runs `02` alone to see it refuse `v0.o.0`, and asserts the workflow's trigger, `contents: write`, `./02-build-releases.sh`, `fail_on_unmatched_files`, docs linked at the tag, no `secrets.`, and `TURBO_GOLO_RELEASING`. The copy of the module for the clone leaves out `.git`, `bin`, `release`, `kits`, `demo`, `demos`, `*.env` and `go.work*`; children run with `GOWORK=off`.
107+
108+## State as of 2026-09-20
109+
110+- **`-load-config <url>` is wired** (`main.go`: `loadConfig`, `describeLoad`), on top of turbo-core's `configrepo`. It needs **turbo-core v1.0.3**, which is not tagged yet; `go.mod` pins v1.0.2, so the editor builds only under the umbrella `go.work` until re-pinned. A project with a `.turbo-golo` already is refused, not overwritten.
111+
added INSTALL.MACOS.md +11 -0
new file mode 100644
@@ -0,0 +1,11 @@
1+# Install `turbo-golo` on macOS
2+
3+```bash
4+# download the binary release in https://rickub.com/turbo-editors/turbo-golo/releases
5+VERSION=1.0.3
6+curl -fsSLO https://rickub.com/turbo-editors/turbo-golo/releases/download/v${VERSION}/turbo-golo-${VERSION}-darwin-arm64
7+chmod +x ./turbo-golo-${VERSION}-darwin-arm64
8+xattr -cr ./turbo-golo-${VERSION}-darwin-arm64
9+sudo rm /usr/local/bin/turbo-golo
10+sudo cp ./turbo-golo-${VERSION}-darwin-arm64 /usr/local/bin/turbo-golo
11+```
\ No newline at end of file
new file mode 100644
@@ -0,0 +1,11 @@
1+# Install `turbo-golo` on macOS
2+
3+```bash
4+# download the binary release in https://rickub.com/turbo-editors/turbo-golo/releases
5+VERSION=1.0.3
6+curl -fsSLO https://rickub.com/turbo-editors/turbo-golo/releases/download/v${VERSION}/turbo-golo-${VERSION}-darwin-arm64
7+chmod +x ./turbo-golo-${VERSION}-darwin-arm64
8+xattr -cr ./turbo-golo-${VERSION}-darwin-arm64
9+sudo rm /usr/local/bin/turbo-golo
10+sudo cp ./turbo-golo-${VERSION}-darwin-arm64 /usr/local/bin/turbo-golo
11+```
\ No newline at end of file\ No newline at end of file
modified docs/diagrams/packages.drawio +2 -0
@@ -13,6 +13,7 @@
1313 <mxCell id="8" value="&lt;b&gt;theme&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="329" y="260" width="190" height="54" as="geometry"/></mxCell>
1414 <mxCell id="9" value="&lt;b&gt;version&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="-95" y="390" width="190" height="54" as="geometry"/></mxCell>
1515 <mxCell id="10" value="tcell/v2" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#999999;dashed=1;fontSize=11;" vertex="1" parent="1"><mxGeometry x="-95" y="520" width="190" height="54" as="geometry"/></mxCell>
16+ <mxCell id="20" value="&lt;b&gt;configrepo&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="117" y="390" width="190" height="54" as="geometry"/></mxCell>
1617 <mxCell id="e11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="3" target="5"><mxGeometry relative="1" as="geometry"/></mxCell>
1718 <mxCell id="e12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="3" target="7"><mxGeometry relative="1" as="geometry"/></mxCell>
1819 <mxCell id="e13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="3"><mxGeometry relative="1" as="geometry"/></mxCell>
@@ -22,6 +23,7 @@
2223 <mxCell id="e17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="6"><mxGeometry relative="1" as="geometry"/></mxCell>
2324 <mxCell id="e18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="8"><mxGeometry relative="1" as="geometry"/></mxCell>
2425 <mxCell id="e19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="9"><mxGeometry relative="1" as="geometry"/></mxCell>
26+ <mxCell id="e20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="20"><mxGeometry relative="1" as="geometry"/></mxCell>
2527 </root>
2628 </mxGraphModel>
2729 </diagram>
@@ -13,6 +13,7 @@
13 <mxCell id="8" value="&lt;b&gt;theme&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="329" y="260" width="190" height="54" as="geometry"/></mxCell>13 <mxCell id="8" value="&lt;b&gt;theme&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="329" y="260" width="190" height="54" as="geometry"/></mxCell>
14 <mxCell id="9" value="&lt;b&gt;version&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="-95" y="390" width="190" height="54" as="geometry"/></mxCell>14 <mxCell id="9" value="&lt;b&gt;version&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="-95" y="390" width="190" height="54" as="geometry"/></mxCell>
15 <mxCell id="10" value="tcell/v2" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#999999;dashed=1;fontSize=11;" vertex="1" parent="1"><mxGeometry x="-95" y="520" width="190" height="54" as="geometry"/></mxCell>15 <mxCell id="10" value="tcell/v2" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#999999;dashed=1;fontSize=11;" vertex="1" parent="1"><mxGeometry x="-95" y="520" width="190" height="54" as="geometry"/></mxCell>
16+ <mxCell id="20" value="&lt;b&gt;configrepo&lt;/b&gt;&lt;br/&gt;&lt;font style=&#x27;font-size:9px&#x27;&gt;turbo-core&lt;/font&gt;" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;" vertex="1" parent="1"><mxGeometry x="117" y="390" width="190" height="54" as="geometry"/></mxCell>
16 <mxCell id="e11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="3" target="5"><mxGeometry relative="1" as="geometry"/></mxCell>17 <mxCell id="e11" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="3" target="5"><mxGeometry relative="1" as="geometry"/></mxCell>
17 <mxCell id="e12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="3" target="7"><mxGeometry relative="1" as="geometry"/></mxCell>18 <mxCell id="e12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="3" target="7"><mxGeometry relative="1" as="geometry"/></mxCell>
18 <mxCell id="e13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="3"><mxGeometry relative="1" as="geometry"/></mxCell>19 <mxCell id="e13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="3"><mxGeometry relative="1" as="geometry"/></mxCell>
@@ -22,6 +23,7 @@
22 <mxCell id="e17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="6"><mxGeometry relative="1" as="geometry"/></mxCell>23 <mxCell id="e17" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="6"><mxGeometry relative="1" as="geometry"/></mxCell>
23 <mxCell id="e18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="8"><mxGeometry relative="1" as="geometry"/></mxCell>24 <mxCell id="e18" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="8"><mxGeometry relative="1" as="geometry"/></mxCell>
24 <mxCell id="e19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="9"><mxGeometry relative="1" as="geometry"/></mxCell>25 <mxCell id="e19" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="9"><mxGeometry relative="1" as="geometry"/></mxCell>
26+ <mxCell id="e20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;endArrow=block;endFill=1;strokeColor=#6c8ebf;" edge="1" parent="1" source="2" target="20"><mxGeometry relative="1" as="geometry"/></mxCell>
25 </root>27 </root>
26 </mxGraphModel>28 </mxGraphModel>
27 </diagram>29 </diagram>
modified docs/en/how-to/configure-a-project.md +13 -0
@@ -70,6 +70,19 @@ turbo-golo -theme turbo-dark main.golo
7070
7171 **Options ▸ Project settings…** opens it again. It is greyed out in a project that has none.
7272
73+## Start from a shared configuration
74+
75+A team can keep ready-made configurations in a repository — one directory per kind of project, each with a `.turbo-golo` inside. Point the editor at the directory, with the URL the browser shows, and it copies that `.turbo-golo` into the current directory:
76+
77+```bash
78+cd my-project
79+turbo-golo -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init
80+```
81+
82+It prints what arrived and exits; the next `turbo-golo` opens the project with those settings, snippets and tools in force. The URL may be on rickub, GitHub, GitLab or Codeberg, and may point at the directory, at the `.turbo-golo` inside it, or at the repository itself for its root on the default branch. `git` must be installed: the fetch is a shallow clone.
83+
84+A project that already has a `.turbo-golo` is left alone — the editor refuses rather than overwrite what the project decided. Move the directory away first if you mean to replace it.
85+
7386 ## Variants
7487
7588 - **You start the editor from a subdirectory.** The settings are not found: only `./.turbo-golo` is looked at, with no walk up towards the project root. Start from the project's own directory, or pass `-theme` for that run.
@@ -70,6 +70,19 @@ turbo-golo -theme turbo-dark main.golo
70 70
71 **Options ▸ Project settings…** opens it again. It is greyed out in a project that has none.71 **Options ▸ Project settings…** opens it again. It is greyed out in a project that has none.
72 72
73+## Start from a shared configuration
74+
75+A team can keep ready-made configurations in a repository — one directory per kind of project, each with a `.turbo-golo` inside. Point the editor at the directory, with the URL the browser shows, and it copies that `.turbo-golo` into the current directory:
76+
77+```bash
78+cd my-project
79+turbo-golo -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init
80+```
81+
82+It prints what arrived and exits; the next `turbo-golo` opens the project with those settings, snippets and tools in force. The URL may be on rickub, GitHub, GitLab or Codeberg, and may point at the directory, at the `.turbo-golo` inside it, or at the repository itself for its root on the default branch. `git` must be installed: the fetch is a shallow clone.
83+
84+A project that already has a `.turbo-golo` is left alone — the editor refuses rather than overwrite what the project decided. Move the directory away first if you mean to replace it.
85+
73 ## Variants86 ## Variants
74 87
75 - **You start the editor from a subdirectory.** The settings are not found: only `./.turbo-golo` is looked at, with no walk up towards the project root. Start from the project's own directory, or pass `-theme` for that run.88 - **You start the editor from a subdirectory.** The settings are not found: only `./.turbo-golo` is looked at, with no walk up towards the project root. Start from the project's own directory, or pass `-theme` for that run.
modified docs/en/reference/cli.md +7 -0
@@ -18,6 +18,7 @@ Each `file` is opened in its own window. A file that does not exist yet is opene
1818 | `-list-themes` | bool | `false` | Print every loadable theme with its description, then the user theme directory, and exit. |
1919 | `-no-lsp` | bool | `false` | Do not start a language server. Colouring and editing are unaffected. |
2020 | `-version` | bool | `false` | Print `Turbo Golo <version>` on one line, with the commit and build date when the build recorded them, and exit. See [the version number](versioning.md). |
21+| `-load-config <url>` | string | none | Copy the `.turbo-golo` directory found at a repository URL — rickub, GitHub, GitLab or Codeberg, the URL of the directory as the browser shows it — into the working directory, print what arrived, and exit. Needs `git`. Refuses when `./.turbo-golo` already exists. The editor is not started. |
2122 | `-h`, `-help` | bool | `false` | Print the flag list and exit. |
2223
2324 ## Environment
@@ -36,6 +37,7 @@ Each `file` is opened in its own window. A file that does not exist yet is opene
3637 | --- | --- |
3738 | `$TURBO_GOLO_THEME_DIR/*.toml` | User themes, when the variable is set. |
3839 | `./.turbo-golo/settings.toml` | This project's settings, read at start-up and again when saved from the editor. See [project settings](project-settings.md). |
40+| `./.turbo-golo/` (written) | Created by `-load-config` from a repository's copy, when the project has none yet. |
3941 | `./.turbo-golo/snippets.toml` | This project's snippets, read each time the Snippets menu opens. See [snippets](snippets.md). |
4042 | `./.turbo-golo/tools.toml` | This project's tools, read each time the Golo menu opens. See [Golo tools](golo-tools.md). |
4143 | `~/.config/turbo-golo/themes/*.toml` | User themes on Linux (`os.UserConfigDir`). |
@@ -80,6 +82,7 @@ turbo-golo main.golo main_test.golo # two windows
8082 turbo-golo -theme turbo-dark main.golo # a different theme
8183 turbo-golo -no-lsp main.golo # no language server
8284 turbo-golo -list-themes # what themes exist
85+turbo-golo -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init # start from a shared configuration
8386 ```
8487
8588 ## Installer
@@ -107,3 +110,7 @@ turbo-golo -list-themes # what themes exist
107110 | `turbo-golo: reading …/settings.toml: …` | The project's settings file is not valid; the editor opens with its defaults. |
108111 | `Cannot open` (in a dialog) | The path is a directory, or is not readable. |
109112 | `Cannot save` (in a dialog) | The directory does not exist, or is not writable. |
113+| `turbo-golo: configrepo: the project already has a configuration directory: …` | `-load-config` into a project that already has `.turbo-golo`. Move it away first. |
114+| `turbo-golo: configrepo: git is not installed` | `-load-config` needs the `git` command on `PATH`. |
115+| `turbo-golo: configrepo: no configuration directory at that path: …` | The repository was found but holds no `.turbo-golo` where the URL points. |
116+| `turbo-golo: configrepo: no repository answered: …` | No clone address for that URL answered; the URL, the network, or a private repository. |
@@ -18,6 +18,7 @@ Each `file` is opened in its own window. A file that does not exist yet is opene
18 | `-list-themes` | bool | `false` | Print every loadable theme with its description, then the user theme directory, and exit. |18 | `-list-themes` | bool | `false` | Print every loadable theme with its description, then the user theme directory, and exit. |
19 | `-no-lsp` | bool | `false` | Do not start a language server. Colouring and editing are unaffected. |19 | `-no-lsp` | bool | `false` | Do not start a language server. Colouring and editing are unaffected. |
20 | `-version` | bool | `false` | Print `Turbo Golo <version>` on one line, with the commit and build date when the build recorded them, and exit. See [the version number](versioning.md). |20 | `-version` | bool | `false` | Print `Turbo Golo <version>` on one line, with the commit and build date when the build recorded them, and exit. See [the version number](versioning.md). |
21+| `-load-config <url>` | string | none | Copy the `.turbo-golo` directory found at a repository URL — rickub, GitHub, GitLab or Codeberg, the URL of the directory as the browser shows it — into the working directory, print what arrived, and exit. Needs `git`. Refuses when `./.turbo-golo` already exists. The editor is not started. |
21 | `-h`, `-help` | bool | `false` | Print the flag list and exit. |22 | `-h`, `-help` | bool | `false` | Print the flag list and exit. |
22 23
23 ## Environment24 ## Environment
@@ -36,6 +37,7 @@ Each `file` is opened in its own window. A file that does not exist yet is opene
36 | --- | --- |37 | --- | --- |
37 | `$TURBO_GOLO_THEME_DIR/*.toml` | User themes, when the variable is set. |38 | `$TURBO_GOLO_THEME_DIR/*.toml` | User themes, when the variable is set. |
38 | `./.turbo-golo/settings.toml` | This project's settings, read at start-up and again when saved from the editor. See [project settings](project-settings.md). |39 | `./.turbo-golo/settings.toml` | This project's settings, read at start-up and again when saved from the editor. See [project settings](project-settings.md). |
40+| `./.turbo-golo/` (written) | Created by `-load-config` from a repository's copy, when the project has none yet. |
39 | `./.turbo-golo/snippets.toml` | This project's snippets, read each time the Snippets menu opens. See [snippets](snippets.md). |41 | `./.turbo-golo/snippets.toml` | This project's snippets, read each time the Snippets menu opens. See [snippets](snippets.md). |
40 | `./.turbo-golo/tools.toml` | This project's tools, read each time the Golo menu opens. See [Golo tools](golo-tools.md). |42 | `./.turbo-golo/tools.toml` | This project's tools, read each time the Golo menu opens. See [Golo tools](golo-tools.md). |
41 | `~/.config/turbo-golo/themes/*.toml` | User themes on Linux (`os.UserConfigDir`). |43 | `~/.config/turbo-golo/themes/*.toml` | User themes on Linux (`os.UserConfigDir`). |
@@ -80,6 +82,7 @@ turbo-golo main.golo main_test.golo # two windows
80 turbo-golo -theme turbo-dark main.golo # a different theme82 turbo-golo -theme turbo-dark main.golo # a different theme
81 turbo-golo -no-lsp main.golo # no language server83 turbo-golo -no-lsp main.golo # no language server
82 turbo-golo -list-themes # what themes exist84 turbo-golo -list-themes # what themes exist
85+turbo-golo -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init # start from a shared configuration
83 ```86 ```
84 87
85 ## Installer88 ## Installer
@@ -107,3 +110,7 @@ turbo-golo -list-themes # what themes exist
107 | `turbo-golo: reading …/settings.toml: …` | The project's settings file is not valid; the editor opens with its defaults. |110 | `turbo-golo: reading …/settings.toml: …` | The project's settings file is not valid; the editor opens with its defaults. |
108 | `Cannot open` (in a dialog) | The path is a directory, or is not readable. |111 | `Cannot open` (in a dialog) | The path is a directory, or is not readable. |
109 | `Cannot save` (in a dialog) | The directory does not exist, or is not writable. |112 | `Cannot save` (in a dialog) | The directory does not exist, or is not writable. |
113+| `turbo-golo: configrepo: the project already has a configuration directory: …` | `-load-config` into a project that already has `.turbo-golo`. Move it away first. |
114+| `turbo-golo: configrepo: git is not installed` | `-load-config` needs the `git` command on `PATH`. |
115+| `turbo-golo: configrepo: no configuration directory at that path: …` | The repository was found but holds no `.turbo-golo` where the URL points. |
116+| `turbo-golo: configrepo: no repository answered: …` | No clone address for that URL answered; the URL, the network, or a private repository. |
modified docs/fr/how-to/configure-a-project.md +13 -0
@@ -70,6 +70,19 @@ turbo-golo -theme turbo-dark main.golo
7070
7171 **Options ▸ Project settings…** le rouvre. L'entrée est grisée dans un projet qui n'en a pas.
7272
73+## Partir d'une configuration partagée
74+
75+Une équipe peut garder des configurations toutes prêtes dans un dépôt — un dossier par sorte de projet, chacun avec un `.turbo-golo` dedans. Donnez à l'éditeur l'URL du dossier, telle que le navigateur l'affiche, et il copie ce `.turbo-golo` dans le répertoire courant :
76+
77+```bash
78+cd mon-projet
79+turbo-golo -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init
80+```
81+
82+Il affiche ce qui est arrivé et quitte ; le `turbo-golo` suivant ouvre le projet avec ces réglages, extraits et outils en vigueur. L'URL peut être sur rickub, GitHub, GitLab ou Codeberg, et pointer sur le dossier, sur le `.turbo-golo` qu'il contient, ou sur le dépôt lui-même pour sa racine sur la branche par défaut. `git` doit être installé : la récupération est un clone superficiel.
83+
84+Un projet qui a déjà un `.turbo-golo` est laissé tel quel — l'éditeur refuse plutôt que d'écraser ce que le projet a décidé. Déplacez d'abord le dossier si vous voulez le remplacer.
85+
7386 ## Variantes
7487
7588 - **Vous lancez l'éditeur depuis un sous-dossier.** Les réglages ne sont pas trouvés : seul `./.turbo-golo` est consulté, sans remontée vers la racine du projet. Lancez depuis le dossier du projet, ou passez `-theme` pour cette fois.
@@ -70,6 +70,19 @@ turbo-golo -theme turbo-dark main.golo
70 70
71 **Options ▸ Project settings…** le rouvre. L'entrée est grisée dans un projet qui n'en a pas.71 **Options ▸ Project settings…** le rouvre. L'entrée est grisée dans un projet qui n'en a pas.
72 72
73+## Partir d'une configuration partagée
74+
75+Une équipe peut garder des configurations toutes prêtes dans un dépôt — un dossier par sorte de projet, chacun avec un `.turbo-golo` dedans. Donnez à l'éditeur l'URL du dossier, telle que le navigateur l'affiche, et il copie ce `.turbo-golo` dans le répertoire courant :
76+
77+```bash
78+cd mon-projet
79+turbo-golo -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init
80+```
81+
82+Il affiche ce qui est arrivé et quitte ; le `turbo-golo` suivant ouvre le projet avec ces réglages, extraits et outils en vigueur. L'URL peut être sur rickub, GitHub, GitLab ou Codeberg, et pointer sur le dossier, sur le `.turbo-golo` qu'il contient, ou sur le dépôt lui-même pour sa racine sur la branche par défaut. `git` doit être installé : la récupération est un clone superficiel.
83+
84+Un projet qui a déjà un `.turbo-golo` est laissé tel quel — l'éditeur refuse plutôt que d'écraser ce que le projet a décidé. Déplacez d'abord le dossier si vous voulez le remplacer.
85+
73 ## Variantes86 ## Variantes
74 87
75 - **Vous lancez l'éditeur depuis un sous-dossier.** Les réglages ne sont pas trouvés : seul `./.turbo-golo` est consulté, sans remontée vers la racine du projet. Lancez depuis le dossier du projet, ou passez `-theme` pour cette fois.88 - **Vous lancez l'éditeur depuis un sous-dossier.** Les réglages ne sont pas trouvés : seul `./.turbo-golo` est consulté, sans remontée vers la racine du projet. Lancez depuis le dossier du projet, ou passez `-theme` pour cette fois.
modified docs/fr/reference/cli.md +7 -0
@@ -18,6 +18,7 @@ Chaque `fichier` est ouvert dans sa propre fenêtre. Un fichier qui n'existe pas
1818 | `-list-themes` | booléen | `false` | Affiche chaque thème chargeable avec sa description, puis le répertoire de thèmes utilisateur, et quitte. |
1919 | `-no-lsp` | booléen | `false` | Ne démarre pas de serveur de langage. La coloration et l'édition sont inchangées. |
2020 | `-version` | booléen | `false` | Affiche `Turbo Golo <version>` sur une ligne, avec le commit et la date de build quand le build les a enregistrés, puis quitte. Voir [le numéro de version](versioning.md). |
21+| `-load-config <url>` | chaîne | aucune | Copie le répertoire `.turbo-golo` trouvé à l'URL d'un dépôt — rickub, GitHub, GitLab ou Codeberg, l'URL du dossier telle que le navigateur l'affiche — dans le répertoire courant, affiche ce qui est arrivé, et quitte. Nécessite `git`. Refuse si `./.turbo-golo` existe déjà. L'éditeur n'est pas lancé. |
2122 | `-h`, `-help` | booléen | `false` | Affiche la liste des options et quitte. |
2223
2324 ## Environnement
@@ -36,6 +37,7 @@ Chaque `fichier` est ouvert dans sa propre fenêtre. Un fichier qui n'existe pas
3637 | Chemin | Rôle |
3738 | --- | --- |
3839 | `./.turbo-golo/settings.toml` | Les réglages de ce projet, lus au démarrage puis à chaque enregistrement. Voir [réglages de projet](project-settings.md). |
40+| `./.turbo-golo/` (écrit) | Créé par `-load-config` à partir de la copie d'un dépôt, quand le projet n'en a pas encore. |
3941 | `./.turbo-golo/snippets.toml` | Les snippets de ce projet. Voir [snippets](snippets.md). |
4042 | `./.turbo-golo/tools.toml` | Les outils du menu Golo. Voir [outils Golo](golo-tools.md). |
4143 | `~/.config/turbo-golo/themes/*.toml` | Thèmes utilisateur sous Linux (`os.UserConfigDir`). |
@@ -82,6 +84,7 @@ turbo-golo main.golo README.md # deux fenêtres
8284 turbo-golo -theme turbo-dark main.golo # un autre thème
8385 turbo-golo -no-lsp main.golo # sans serveur de langage
8486 turbo-golo -list-themes # quels thèmes existent
87+turbo-golo -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init # partir d'une configuration partagée
8588 ```
8689
8790 ## Installateur
@@ -108,3 +111,7 @@ turbo-golo -list-themes # quels thèmes existent
108111 | `turbo-golo: initialising the terminal: …` | Le terminal a été ouvert mais n'a pas pu être mis en mode brut. |
109112 | `Cannot open` (dans une boîte) | Le chemin est un répertoire, ou n'est pas lisible. |
110113 | `Cannot save` (dans une boîte) | Le répertoire n'existe pas, ou n'est pas accessible en écriture. |
114+| `turbo-golo: configrepo: the project already has a configuration directory: …` | `-load-config` dans un projet qui a déjà `.turbo-golo`. Déplacez-le d'abord. |
115+| `turbo-golo: configrepo: git is not installed` | `-load-config` a besoin de la commande `git` dans le `PATH`. |
116+| `turbo-golo: configrepo: no configuration directory at that path: …` | Le dépôt existe mais ne contient pas de `.turbo-golo` là où l'URL pointe. |
117+| `turbo-golo: configrepo: no repository answered: …` | Aucune adresse de clone pour cette URL n'a répondu : l'URL, le réseau, ou un dépôt privé. |
@@ -18,6 +18,7 @@ Chaque `fichier` est ouvert dans sa propre fenêtre. Un fichier qui n'existe pas
18 | `-list-themes` | booléen | `false` | Affiche chaque thème chargeable avec sa description, puis le répertoire de thèmes utilisateur, et quitte. |18 | `-list-themes` | booléen | `false` | Affiche chaque thème chargeable avec sa description, puis le répertoire de thèmes utilisateur, et quitte. |
19 | `-no-lsp` | booléen | `false` | Ne démarre pas de serveur de langage. La coloration et l'édition sont inchangées. |19 | `-no-lsp` | booléen | `false` | Ne démarre pas de serveur de langage. La coloration et l'édition sont inchangées. |
20 | `-version` | booléen | `false` | Affiche `Turbo Golo <version>` sur une ligne, avec le commit et la date de build quand le build les a enregistrés, puis quitte. Voir [le numéro de version](versioning.md). |20 | `-version` | booléen | `false` | Affiche `Turbo Golo <version>` sur une ligne, avec le commit et la date de build quand le build les a enregistrés, puis quitte. Voir [le numéro de version](versioning.md). |
21+| `-load-config <url>` | chaîne | aucune | Copie le répertoire `.turbo-golo` trouvé à l'URL d'un dépôt — rickub, GitHub, GitLab ou Codeberg, l'URL du dossier telle que le navigateur l'affiche — dans le répertoire courant, affiche ce qui est arrivé, et quitte. Nécessite `git`. Refuse si `./.turbo-golo` existe déjà. L'éditeur n'est pas lancé. |
21 | `-h`, `-help` | booléen | `false` | Affiche la liste des options et quitte. |22 | `-h`, `-help` | booléen | `false` | Affiche la liste des options et quitte. |
22 23
23 ## Environnement24 ## Environnement
@@ -36,6 +37,7 @@ Chaque `fichier` est ouvert dans sa propre fenêtre. Un fichier qui n'existe pas
36 | Chemin | Rôle |37 | Chemin | Rôle |
37 | --- | --- |38 | --- | --- |
38 | `./.turbo-golo/settings.toml` | Les réglages de ce projet, lus au démarrage puis à chaque enregistrement. Voir [réglages de projet](project-settings.md). |39 | `./.turbo-golo/settings.toml` | Les réglages de ce projet, lus au démarrage puis à chaque enregistrement. Voir [réglages de projet](project-settings.md). |
40+| `./.turbo-golo/` (écrit) | Créé par `-load-config` à partir de la copie d'un dépôt, quand le projet n'en a pas encore. |
39 | `./.turbo-golo/snippets.toml` | Les snippets de ce projet. Voir [snippets](snippets.md). |41 | `./.turbo-golo/snippets.toml` | Les snippets de ce projet. Voir [snippets](snippets.md). |
40 | `./.turbo-golo/tools.toml` | Les outils du menu Golo. Voir [outils Golo](golo-tools.md). |42 | `./.turbo-golo/tools.toml` | Les outils du menu Golo. Voir [outils Golo](golo-tools.md). |
41 | `~/.config/turbo-golo/themes/*.toml` | Thèmes utilisateur sous Linux (`os.UserConfigDir`). |43 | `~/.config/turbo-golo/themes/*.toml` | Thèmes utilisateur sous Linux (`os.UserConfigDir`). |
@@ -82,6 +84,7 @@ turbo-golo main.golo README.md # deux fenêtres
82 turbo-golo -theme turbo-dark main.golo # un autre thème84 turbo-golo -theme turbo-dark main.golo # un autre thème
83 turbo-golo -no-lsp main.golo # sans serveur de langage85 turbo-golo -no-lsp main.golo # sans serveur de langage
84 turbo-golo -list-themes # quels thèmes existent86 turbo-golo -list-themes # quels thèmes existent
87+turbo-golo -load-config https://rickub.com/turbo-editors/configs/tree/main/golang-init # partir d'une configuration partagée
85 ```88 ```
86 89
87 ## Installateur90 ## Installateur
@@ -108,3 +111,7 @@ turbo-golo -list-themes # quels thèmes existent
108 | `turbo-golo: initialising the terminal: …` | Le terminal a été ouvert mais n'a pas pu être mis en mode brut. |111 | `turbo-golo: initialising the terminal: …` | Le terminal a été ouvert mais n'a pas pu être mis en mode brut. |
109 | `Cannot open` (dans une boîte) | Le chemin est un répertoire, ou n'est pas lisible. |112 | `Cannot open` (dans une boîte) | Le chemin est un répertoire, ou n'est pas lisible. |
110 | `Cannot save` (dans une boîte) | Le répertoire n'existe pas, ou n'est pas accessible en écriture. |113 | `Cannot save` (dans une boîte) | Le répertoire n'existe pas, ou n'est pas accessible en écriture. |
114+| `turbo-golo: configrepo: the project already has a configuration directory: …` | `-load-config` dans un projet qui a déjà `.turbo-golo`. Déplacez-le d'abord. |
115+| `turbo-golo: configrepo: git is not installed` | `-load-config` a besoin de la commande `git` dans le `PATH`. |
116+| `turbo-golo: configrepo: no configuration directory at that path: …` | Le dépôt existe mais ne contient pas de `.turbo-golo` là où l'URL pointe. |
117+| `turbo-golo: configrepo: no repository answered: …` | Aucune adresse de clone pour cette URL n'a répondu : l'URL, le réseau, ou un dépôt privé. |
modified go.mod +1 -1
@@ -4,7 +4,7 @@ go 1.26.1
44
55 require (
66 github.com/gdamore/tcell/v2 v2.13.10
7- rickub.com/turbo-editors/turbo-core v1.0.2
7+ rickub.com/turbo-editors/turbo-core v1.0.3
88 )
99
1010 require (
@@ -4,7 +4,7 @@ go 1.26.1
4 4
5 require (5 require (
6 github.com/gdamore/tcell/v2 v2.13.106 github.com/gdamore/tcell/v2 v2.13.10
7- rickub.com/turbo-editors/turbo-core v1.0.27+ rickub.com/turbo-editors/turbo-core v1.0.3
8 )8 )
9 9
10 require (10 require (
modified go.sum +2 -2
@@ -45,5 +45,5 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
4545 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
4646 golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
4747 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
48-rickub.com/turbo-editors/turbo-core v1.0.2 h1:OA/LhR6JkvtUlp6lTgYa0wwaWou3HKXd1Glnoscyffw=
49-rickub.com/turbo-editors/turbo-core v1.0.2/go.mod h1:rmfIY5gsFEo3sC5IIJFapwsGvdKG6NjrD7ACmnNTKq8=
48+rickub.com/turbo-editors/turbo-core v1.0.3 h1:j+bqzIIBsese8iLgre9PQdbpi9YkoOMIHP6pOli5UjE=
49+rickub.com/turbo-editors/turbo-core v1.0.3/go.mod h1:rmfIY5gsFEo3sC5IIJFapwsGvdKG6NjrD7ACmnNTKq8=
@@ -45,5 +45,5 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
45 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=45 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
46 golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=46 golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
47 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=47 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
48-rickub.com/turbo-editors/turbo-core v1.0.2 h1:OA/LhR6JkvtUlp6lTgYa0wwaWou3HKXd1Glnoscyffw=48+rickub.com/turbo-editors/turbo-core v1.0.3 h1:j+bqzIIBsese8iLgre9PQdbpi9YkoOMIHP6pOli5UjE=
49-rickub.com/turbo-editors/turbo-core v1.0.2/go.mod h1:rmfIY5gsFEo3sC5IIJFapwsGvdKG6NjrD7ACmnNTKq8=49+rickub.com/turbo-editors/turbo-core v1.0.3/go.mod h1:rmfIY5gsFEo3sC5IIJFapwsGvdKG6NjrD7ACmnNTKq8=
modified main.go +38 -0
@@ -16,6 +16,7 @@
1616 // -list-themes print the available themes and exit
1717 // -no-lsp do not start a language server
1818 // -version print the version and exit
19+// -load-config url copy the .turbo-golo directory found at a repository URL into the working directory and exit
1920 package main
2021
2122 import (
@@ -24,10 +25,12 @@ import (
2425 "flag"
2526 "fmt"
2627 "os"
28+ "strings"
2729
2830 "github.com/gdamore/tcell/v2"
2931
3032 "rickub.com/turbo-editors/turbo-core/app"
33+ "rickub.com/turbo-editors/turbo-core/configrepo"
3134 "rickub.com/turbo-editors/turbo-core/profile"
3235 "rickub.com/turbo-editors/turbo-core/settings"
3336 "rickub.com/turbo-editors/turbo-core/theme"
@@ -47,6 +50,7 @@ func main() {
4750 type options struct {
4851 theme string
4952 listThemes bool
53+ loadConfig string
5054 noLSP bool
5155 version bool
5256 files []string
@@ -63,6 +67,7 @@ func parseFlags() options {
6367 flag.BoolVar(&opts.listThemes, "list-themes", false, "print the available themes and exit")
6468 flag.BoolVar(&opts.noLSP, "no-lsp", false, "do not start a language server")
6569 flag.BoolVar(&opts.version, "version", false, "print the version and exit")
70+ flag.StringVar(&opts.loadConfig, "load-config", "", "copy the .turbo-golo directory found at this repository URL into the working directory, then exit")
6671 flag.Parse()
6772
6873 opts.files = flag.Args()
@@ -83,6 +88,8 @@ func run() error {
8388 return nil
8489 case opts.listThemes:
8590 return listThemes(p)
91+ case opts.loadConfig != "":
92+ return loadConfig(p, opts.loadConfig)
8693 }
8794
8895 return edit(opts, p)
@@ -107,6 +114,37 @@ func listThemes(p profile.Profile) error {
107114 return nil
108115 }
109116
117+// loadConfig copies a shared configuration — the .turbo-golo directory at a
118+// repository URL, on rickub, GitHub, GitLab or Codeberg — into the working
119+// directory, and says what arrived. The editor is not started: this is a
120+// set-up step, and the next command is the one that opens the project.
121+//
122+// A project that already has a .turbo-golo is left alone; turbo-core refuses
123+// rather than overwrite what the project decided.
124+func loadConfig(p profile.Profile, url string) error {
125+ result, err := configrepo.Load(context.Background(), p, url, ".")
126+ if err != nil {
127+ return err
128+ }
129+ fmt.Print(describeLoad(result))
130+ return nil
131+}
132+
133+// describeLoad is what a successful -load-config prints: where the files
134+// came from, and each of them, so the reader knows what is now in force.
135+func describeLoad(result configrepo.Result) string {
136+ var out strings.Builder
137+ fmt.Fprintf(&out, "Copied %s from %s", result.Dir, result.Remote)
138+ if result.Ref != "" {
139+ fmt.Fprintf(&out, " (%s)", result.Ref)
140+ }
141+ out.WriteString(":\n")
142+ for _, file := range result.Files {
143+ fmt.Fprintf(&out, " %s\n", file)
144+ }
145+ return out.String()
146+}
147+
110148 // edit opens the terminal and runs the editor until the user leaves.
111149 func edit(opts options, p profile.Profile) error {
112150 project, projectSettings := loadProjectSettings(p)
@@ -16,6 +16,7 @@
16 // -list-themes print the available themes and exit16 // -list-themes print the available themes and exit
17 // -no-lsp do not start a language server17 // -no-lsp do not start a language server
18 // -version print the version and exit18 // -version print the version and exit
19+// -load-config url copy the .turbo-golo directory found at a repository URL into the working directory and exit
19 package main20 package main
20 21
21 import (22 import (
@@ -24,10 +25,12 @@ import (
24 "flag"25 "flag"
25 "fmt"26 "fmt"
26 "os"27 "os"
28+ "strings"
27 29
28 "github.com/gdamore/tcell/v2"30 "github.com/gdamore/tcell/v2"
29 31
30 "rickub.com/turbo-editors/turbo-core/app"32 "rickub.com/turbo-editors/turbo-core/app"
33+ "rickub.com/turbo-editors/turbo-core/configrepo"
31 "rickub.com/turbo-editors/turbo-core/profile"34 "rickub.com/turbo-editors/turbo-core/profile"
32 "rickub.com/turbo-editors/turbo-core/settings"35 "rickub.com/turbo-editors/turbo-core/settings"
33 "rickub.com/turbo-editors/turbo-core/theme"36 "rickub.com/turbo-editors/turbo-core/theme"
@@ -47,6 +50,7 @@ func main() {
47 type options struct {50 type options struct {
48 theme string51 theme string
49 listThemes bool52 listThemes bool
53+ loadConfig string
50 noLSP bool54 noLSP bool
51 version bool55 version bool
52 files []string56 files []string
@@ -63,6 +67,7 @@ func parseFlags() options {
63 flag.BoolVar(&opts.listThemes, "list-themes", false, "print the available themes and exit")67 flag.BoolVar(&opts.listThemes, "list-themes", false, "print the available themes and exit")
64 flag.BoolVar(&opts.noLSP, "no-lsp", false, "do not start a language server")68 flag.BoolVar(&opts.noLSP, "no-lsp", false, "do not start a language server")
65 flag.BoolVar(&opts.version, "version", false, "print the version and exit")69 flag.BoolVar(&opts.version, "version", false, "print the version and exit")
70+ flag.StringVar(&opts.loadConfig, "load-config", "", "copy the .turbo-golo directory found at this repository URL into the working directory, then exit")
66 flag.Parse()71 flag.Parse()
67 72
68 opts.files = flag.Args()73 opts.files = flag.Args()
@@ -83,6 +88,8 @@ func run() error {
83 return nil88 return nil
84 case opts.listThemes:89 case opts.listThemes:
85 return listThemes(p)90 return listThemes(p)
91+ case opts.loadConfig != "":
92+ return loadConfig(p, opts.loadConfig)
86 }93 }
87 94
88 return edit(opts, p)95 return edit(opts, p)
@@ -107,6 +114,37 @@ func listThemes(p profile.Profile) error {
107 return nil114 return nil
108 }115 }
109 116
117+// loadConfig copies a shared configuration — the .turbo-golo directory at a
118+// repository URL, on rickub, GitHub, GitLab or Codeberg — into the working
119+// directory, and says what arrived. The editor is not started: this is a
120+// set-up step, and the next command is the one that opens the project.
121+//
122+// A project that already has a .turbo-golo is left alone; turbo-core refuses
123+// rather than overwrite what the project decided.
124+func loadConfig(p profile.Profile, url string) error {
125+ result, err := configrepo.Load(context.Background(), p, url, ".")
126+ if err != nil {
127+ return err
128+ }
129+ fmt.Print(describeLoad(result))
130+ return nil
131+}
132+
133+// describeLoad is what a successful -load-config prints: where the files
134+// came from, and each of them, so the reader knows what is now in force.
135+func describeLoad(result configrepo.Result) string {
136+ var out strings.Builder
137+ fmt.Fprintf(&out, "Copied %s from %s", result.Dir, result.Remote)
138+ if result.Ref != "" {
139+ fmt.Fprintf(&out, " (%s)", result.Ref)
140+ }
141+ out.WriteString(":\n")
142+ for _, file := range result.Files {
143+ fmt.Fprintf(&out, " %s\n", file)
144+ }
145+ return out.String()
146+}
147+
110 // edit opens the terminal and runs the editor until the user leaves.148 // edit opens the terminal and runs the editor until the user leaves.
111 func edit(opts options, p profile.Profile) error {149 func edit(opts options, p profile.Profile) error {
112 project, projectSettings := loadProjectSettings(p)150 project, projectSettings := loadProjectSettings(p)
modified main_test.go +41 -0
@@ -1,13 +1,16 @@
11 package main
22
33 import (
4+ "errors"
45 "flag"
56 "os"
67 "path/filepath"
78 "slices"
9+ "strings"
810 "testing"
911
1012 "rickub.com/turbo-editors/turbo-core/app"
13+ "rickub.com/turbo-editors/turbo-core/configrepo"
1114 "rickub.com/turbo-editors/turbo-core/settings"
1215
1316 "rickub.com/turbo-editors/turbo-golo/internal/gololang"
@@ -157,3 +160,41 @@ func TestABrokenSettingsFileDoesNotStopTheEditorOpening(t *testing.T) {
157160 t.Errorf("loadProjectSettings() = %+v with a broken file, want the defaults", loaded)
158161 }
159162 }
163+
164+func TestDescribeLoadNamesTheSourceAndEveryFile(t *testing.T) {
165+ got := describeLoad(configrepo.Result{
166+ Remote: "https://git.rickub.com/turbo-editors/configs.git",
167+ Ref: "main",
168+ Dir: "/work/.turbo-golo",
169+ Files: []string{"settings.toml", "tools.toml"},
170+ })
171+
172+ want := "Copied /work/.turbo-golo from https://git.rickub.com/turbo-editors/configs.git (main):\n settings.toml\n tools.toml\n"
173+ if got != want {
174+ t.Errorf("describeLoad() =\n%q\nwant\n%q", got, want)
175+ }
176+}
177+
178+func TestDescribeLoadOmitsTheRefWhenTheDefaultBranchWasUsed(t *testing.T) {
179+ got := describeLoad(configrepo.Result{Remote: "r", Dir: "d"})
180+
181+ if strings.Contains(got, "(") {
182+ t.Errorf("describeLoad() = %q, want no parenthesised ref", got)
183+ }
184+}
185+
186+func TestLoadConfigLeavesAProjectThatHasAConfigurationAlone(t *testing.T) {
187+ // Checked before anything is fetched, so this needs neither git nor a
188+ // network: the project's own .turbo-golo is a decision, not a default.
189+ project := t.TempDir()
190+ if err := os.MkdirAll(filepath.Join(project, ".turbo-golo"), 0o755); err != nil {
191+ t.Fatal(err)
192+ }
193+ t.Chdir(project)
194+
195+ err := loadConfig(gololang.Profile(), "https://rickub.com/turbo-editors/configs/tree/main/golang-init")
196+
197+ if !errors.Is(err, configrepo.ErrExists) {
198+ t.Errorf("loadConfig() error = %v, want ErrExists", err)
199+ }
200+}
@@ -1,13 +1,16 @@
1 package main1 package main
2 2
3 import (3 import (
4+ "errors"
4 "flag"5 "flag"
5 "os"6 "os"
6 "path/filepath"7 "path/filepath"
7 "slices"8 "slices"
9+ "strings"
8 "testing"10 "testing"
9 11
10 "rickub.com/turbo-editors/turbo-core/app"12 "rickub.com/turbo-editors/turbo-core/app"
13+ "rickub.com/turbo-editors/turbo-core/configrepo"
11 "rickub.com/turbo-editors/turbo-core/settings"14 "rickub.com/turbo-editors/turbo-core/settings"
12 15
13 "rickub.com/turbo-editors/turbo-golo/internal/gololang"16 "rickub.com/turbo-editors/turbo-golo/internal/gololang"
@@ -157,3 +160,41 @@ func TestABrokenSettingsFileDoesNotStopTheEditorOpening(t *testing.T) {
157 t.Errorf("loadProjectSettings() = %+v with a broken file, want the defaults", loaded)160 t.Errorf("loadProjectSettings() = %+v with a broken file, want the defaults", loaded)
158 }161 }
159 }162 }
163+
164+func TestDescribeLoadNamesTheSourceAndEveryFile(t *testing.T) {
165+ got := describeLoad(configrepo.Result{
166+ Remote: "https://git.rickub.com/turbo-editors/configs.git",
167+ Ref: "main",
168+ Dir: "/work/.turbo-golo",
169+ Files: []string{"settings.toml", "tools.toml"},
170+ })
171+
172+ want := "Copied /work/.turbo-golo from https://git.rickub.com/turbo-editors/configs.git (main):\n settings.toml\n tools.toml\n"
173+ if got != want {
174+ t.Errorf("describeLoad() =\n%q\nwant\n%q", got, want)
175+ }
176+}
177+
178+func TestDescribeLoadOmitsTheRefWhenTheDefaultBranchWasUsed(t *testing.T) {
179+ got := describeLoad(configrepo.Result{Remote: "r", Dir: "d"})
180+
181+ if strings.Contains(got, "(") {
182+ t.Errorf("describeLoad() = %q, want no parenthesised ref", got)
183+ }
184+}
185+
186+func TestLoadConfigLeavesAProjectThatHasAConfigurationAlone(t *testing.T) {
187+ // Checked before anything is fetched, so this needs neither git nor a
188+ // network: the project's own .turbo-golo is a decision, not a default.
189+ project := t.TempDir()
190+ if err := os.MkdirAll(filepath.Join(project, ".turbo-golo"), 0o755); err != nil {
191+ t.Fatal(err)
192+ }
193+ t.Chdir(project)
194+
195+ err := loadConfig(gololang.Profile(), "https://rickub.com/turbo-editors/configs/tree/main/golang-init")
196+
197+ if !errors.Is(err, configrepo.ErrExists) {
198+ t.Errorf("loadConfig() error = %v, want ErrExists", err)
199+ }
200+}