Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For Diagnostics info the server watches for changes in the file and compiles the edited code using Solang, the compiler info for the respective code is then formatted and returned back to the server as compiler errors, warnings and hints.

For Hovers the server first traverses the AST(syntax tree) resolved by the Solang compiler on the edited code. While traversing it creates a map containing line, column and messages for the respective tokens from the AST. This map is then used to map cursor positions on the client side(line, column) to return the respective hovers. Eg: If on client side the mouse is hovered over a variable 'a' of type uint256 at line no 10 and column 10. The server will look into the map and check for entries that are defined for line 10 and column 10. For variable 'a' the map has message 'uint256 a' which is then returned to the client.  



Methodology

I followed the “Design-Code-Test-Document​” methodology.

...