Motoko grammar/parser code

Hello

I would like to know if there is any chance to get the Motoko compiler/parser code or a grammar so that we can build nice developer tools such as syntax coloring to Motoko on VSCode

4 Likes

hey david, welcome to our community! so far this code is closed source, but we will open source it at some point in the future. in the newest version 0.4.7 of the sdk, there is a new feature called dfx ide which looks like its a language server ( from the release notes at least). so far i havent worked out how to use it, but if you are familiar with building developer tools maybe you can?

2 Likes

I am not really familiar with the language server – I will try to make it happen :grinning:

1 Like

any progress on this? :slightly_smiling_face:

I just checked, and dfx ide has been removed from the newest release.

I found mo-ide in /Users/username/.cache/dfinity/versions/0.4.13 that I ran using
./mo-ide --canister-main "/Users/user/hello" --debug

I pressed enter, and the same error as this one appeared.

1 Like

how did you come up with the flags? is this a CLI ?

oh year it is :stuck_out_tongue:

could you work with the fact that this is a LSP server?

You’ll find “dfx ide” has been renamed “dfx _language-service” .

There are some new docs here for it: https://sdk.dfinity.org/developers-guide/lang-service-ide.html

i can now install the motoko language extension for vscode, seems to work :open_mouth:

https://marketplace.visualstudio.com/items?itemName=BlockInsight.dfinity

although it looks like this is only a color theme for highlighting

3 Likes

Its a pretty good little extension for VSCode

1 Like

indeed it is! getting the full potential out of the language server would still be great for developing

There is an alpha ready now!

2 Likes