VSCode language client for frege.
Head over to the Frege IDE docs website.
- Download the latest version
.vsix
file from Releases. - Install the extension with
code --install-extension <path to downloaded extension.vsix>
or via the Command Palette (Ctrl/Cmd+Shift+P)Install from VSIX...
.
If you save or open a frege file with errros then the compiler warnings or errors are displayed in the problem tab of the extension host.
Whenever you hover over the first word of a line (which is usually a function), you will see its type signature in a popup.
- Gradle and Gradle wrapper. Run
gradle wrapper
in the Frege root project dir. - A Frege project setup with Frege Gradle Plugin >= 1.5.0. See examples.
If a Frege file contains a main
function, then a code lens with Run
and Repl
appears.
- If you click on the
Run
Code Lens, then themain
function is executed. - If you click on the
Repl
Code Lens, then the Frege Repl with all the specified dependencies is started in a new terminal. Also, it copies the command to load the current file to your clipboard so that you only need to paste it into the Repl for a blazingly fast experience:smiley:.
- Add more tests and features:smiley:.
- Install nodejs
14.x
git clone https://github.com/tricktron/frege-vscode.git
npm install
- Open the project's root folder in vscode.
- Run the
Release Frege
debug task by pressingrun -> start debugging
or just pressf5
.
This downloads the frege lsp server and starts both the frege client and server. See the extension.ts code for more details.
A second vscode instance, called Extension development host is started
.
Open any .fr
file in the extension development host
and try to code some correct Frege functions.
Git clone (https://github.com/tricktron/frege-lsp-server)
- Make some changes to the frege lsp server.
- Run
./gradlew installDist
and note the startScript path in<yourRoot>/build/install/frege-lsp-server/bin/frege-lsp-server
. - Set the
LOCAL_FREGE_SERVER_PATH
in launch.json to the value in step 3. - Run the
Local Frege LSP
debug task.
How to Debug the Client and a Local Frege Server Version end-to-end with Java Breakpoints in the Server
-
Follow How to Debug the Client and a Local Frege Server Version.
-
Add the following
launch.json
to the Frege-lsp-server project:
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Attach to Frege LSP Server for Debugging",
"request": "attach",
"hostName": "localhost",
"port": 6008
}
]
}
- Set a java breakpoint in the Frege LSP code.
- Run the
Local Frege LSP with Java Debugging
debug task. - Trigger an LSP event in the client.
- Watch how the breakpoint is automatically hit.
- Debug
- Run
npm test
to execute the unit tests.
- Make sure that the
https_proxy
variable is set. - If you also have self-signed certificates you need to include them
by setting
export NODE_EXTRA_CA_CERTS=<path to your self-signed CA certs>
.