I hacked this little extension together to get code completion and compiler warnings with the
dfx _language-service command.
This has been only tested on
0.5.2 and assumes your
dfx binary lives in
/usr/local/bin/dfx (this should be easy to fix). If you need to change the directory, use
which dfxto get the correct path
- modify the path in line 12 to the output of
- safe the file and exit
- restart vscode
It also only works for projects with only one canister specified in
dfx.json (but this shouldn’t be to hard to fix). If you want realtime feedback from the server, not only when you manually save your file, go to
- vscode settings
- set to
- Tweak the
Files: Auto Save Delayto your preferences.
dfx _language-service is not (afaik) officially supported yet. There will very likely be a way better client provided by dfinity itself which will render this obsolete. This is for people that don’t want to wait !
It would be great if anyone wants to collaborate on the two issues mentioned above! Enjoy