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

5 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?

3 Likes

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

2 Likes

any progress on this? :slightly_smiling_face:

1 Like

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.

2 Likes

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

1 Like

oh year it is :stuck_out_tongue:

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

1 Like

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

1 Like

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

4 Likes

Its a pretty good little extension for VSCode

2 Likes

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

1 Like

There is an alpha ready now!

3 Likes