superblocks-lab
superblocks-lab copied to clipboard
constructor is not a highlighted language keyword
Environment/Browser
Version 1.1.0
Description
Consider updating editor syntax highlighting to comply with language version currently being used.
@filippsen do you have any idea how VSCode actually does it? The language support in VSCode with the Solidity plugin is a lot richer than solidity
support Monaco actually has. Not sure if this improvement in the syntax highlighter comes from VSCode special touch in Monaco or from the Solidity plugin itself.
@javier-tarazaga Labs is using react-monaco-editor
which depends on
"monaco-editor": "^0.15.1"
This in turn has a language dependancy for the syntax highlighting
"monaco-languages": "1.6.0"
https://github.com/Microsoft/monaco-languages/tree/master/src/solidity
The solidity
language pack appears to be based on solidity ^0.4.0
which is why constructor
is not included in the keywords.
A quick fix is to manually add the missing keywords to the language .js file after deployment to the server.
@javier-tarazaga The base Code editor doesn't show any highlighting at all when saving a file with the .sol
file format. It points at the marketplace for "finding a solution".
As you said, Solidity support in Code is user-created content and they all offer a lot more than just syntax highlighting, indeed. They could be used as reference, if someone finds it helpful to read from, but it is a different domain.
@futurejones explained it well. By default, Monaco ships with a set of syntax definitions and it would have to be improved by Lab, considering the original authors have not revisited it since 8 months now.
Just a small correction: Lab sets react-monaco-editor
to ^0.13.0
, leading to even older monaco-languages
package. This apparently doesn't change anything with regards to Solidity language support. The definitions haven't been updated in a while, as very well observed.
I have added the "constructor" keyword to the monaco-languages
package.
https://github.com/Microsoft/monaco-languages/pull/55
This should be included in the next monaco-editor
release.