In your editor
Install the editor plugin on Windows
Everything comes from your own Git Code Review server: it is the one that holds your rules, and a fair number of these installations have no way out to the internet at all. Visual Studio Code and Cursor install the same package. The JetBrains IDEs and Eclipse run the language server underneath it, which needs Node and nothing else. Allow about ten minutes for the first one and two for each after that.
What to do
-
Make a token first. On your Git Code Review server open IDE tokens and make one with review and rules both ticked. One with only a single permission connects and then fails on the first save, which reads like a broken server. Copy it when it is shown: only its hash is kept, so nobody can show it to you again.
-
On the same server open Editor plugins and download the
.vsix. It carries the version of the server that handed it over, so take it from your own server rather than from a colleague. -
Open the editor and press Ctrl+Shift+P. A search box drops down from the top of the window. Anything the editor can do can be found by typing its name in there, and every step below starts by opening it. Its name is the command palette, and this guide calls it the search box from here on.
-
In that box, type Install from VSIX. Choose Extensions: Install from VSIX from the list underneath, then pick the file you downloaded. This always works and needs nothing set up first. Cursor is the same editor underneath and takes the same file.
-
Only if you would rather use PowerShell: the same thing as one command.
code --install-extension $env:USERPROFILE\Downloads\git-code-review-1.0.1.vsix cursor --install-extension $env:USERPROFILE\Downloads\git-code-review-1.0.1.vsix -
If that says the term
codeis not recognized, the installer was run without Add to PATH ticked, or this window was open before it was installed. Close the window and open a new one first. If it still does not answer, use the step above, which does the same job, or call the binary where it lives.& "$env:LOCALAPPDATA\Programs\Microsoft VS Code\bin\code.cmd" ` --install-extension $env:USERPROFILE\Downloads\git-code-review-1.0.1.vsix -
Tell it where the server is. File, Preferences, Settings, search for
gitCodeReview, or put this insettings.jsonwith your own address."gitCodeReview.server": "https://your-server/api/v1", "gitCodeReview.reviewOn": "save", "gitCodeReview.changedLinesOnly": true -
Open the search box again (Ctrl+Shift+P) and run Git Code Review: Set the token, then paste the token in. It goes into the editor's own secret storage rather than into a settings file, which is the file that ends up in backups and sometimes in a repository.
-
Check it before trusting it: search box again, then Git Code Review: Check the connection. It answers in a message at the bottom right, and names what is wrong when something is rather than failing quietly on the next save.
-
For IntelliJ, PyCharm, GoLand, WebStorm or Rider, start with Node. Any recent version does; the language server has no dependencies of its own.
winget install OpenJS.NodeJS.LTS -
Download the language server from the same Editor plugins page and unpack it somewhere that will stay put, such as
C:\Tools\git-code-review-lsp. -
In the IDE install LSP4IJ from the JetBrains Marketplace. It is free, it works in the Community editions, and it is what lets a JetBrains IDE run a language server it was not built with. Then Settings, Languages & Frameworks, Language Servers, add a user defined server.
Name: Git Code Review Command: node C:\Tools\git-code-review-lsp\server\main.js Env: GCR_SERVER=https://your-server/api/v1 GCR_TOKEN=<your token> -
Eclipse is the same server through LSP4E, which is on the Eclipse Marketplace. Install it, then Preferences, Language Servers, add a server with that same command and those same two variables, and associate it with the content types you want read.
-
Open a file and save it. Findings appear as ordinary problems in the editor, on the lines you changed. The status bar says how many older ones are in the file without drawing them.
Worth knowing
A token is you, with less of you. On Windows the JetBrains and Eclipse ones sit in a run configuration on disk, so give them the shortest expiry you can live with and delete them on the IDE tokens page the day you stop using that machine.
Other guides
Install the editor plugin on macOS or Linux
The same three files, with the paths and the package manager that platform uses.
ReadExclude one credential everywhere it appears
The same test key committed to nine repositories, set aside once.
ReadStop a rule that is drowning everything else
One rule producing a fifth of your findings is not telling you anything.
Read