#2885 [ANN] StarLord - an LSP for Fantom

SlimerDude Tue 3 Jan 2023

StarLord is a Language Server Protocol (LSP) implementation for Fantom.

https://github.com/Fantom-Factory/afxStarLord

It works as a plugin / addon for most IDEs and Text Editors to report warnings and compilation errors of your Fantom code, as you type.

StarLord screenshots

This alpha / proof of concept version has support for:

  • Standalone Fantom files
  • Tracking file operations (incremental updates, renames, and deletes)
  • Fantom Projects (via build.fan files and LSP Workspaces)
  • Reporting compilation errors and warnings (via LSP Diagnostics)
  • Class outline views (via LSP Document Symbols)

StarLord has been tested on:

  • Eclipse IDE (the latest 2022 versions)
  • Kate Editor
  • Sublime Text

It should also be possible to use StarLord with the likes of Intelli-J and M$ VSCode, but they seem to require you to create and compile custom extensions - and (given I don't use these editors) that's a step too far for me at the moment.

I've been dabbling on and off with a Fantom LSP for a few months now, and it has just gotten to the point where it feels useful - i.e. it can compile whole Fantom projects! So now seemed like a good time to put it out for a bit of general testing.

StarLord is just a binary download for now, and setup instructions can be found on the GitHub page.

Happy New Year!

brian Wed 4 Jan 2023

This is awesome Steve! I can't wait to see where it goes.

Do you have the afxLspFantom code on GitHub yet? I would be very curious to take a look since this is a project I've been mulling for many years that we really need. I feel like these days almost everyone I see uses VS Code

Jay Herron2 Thu 5 Jan 2023

So cool Steve! Great job!

SlimerDude Thu 5 Jan 2023

Hi Brian, Jay, thanks!

this is a project I've been mulling for many years

I know what you mean, I first released JSON-RPC with LSP in mind, back in June 2021!

Do you have the afxLspFantom code on GitHub?

This LSP project has been a good proving ground for our new AFX platform. But AFX is (currently) closed source - so there's little sense at the moment in openly releasing afxLspFantom.

But I guess you're more interested in how I've been mangling your compiler code! I can send you samples off line.

The main pain point was that the Fantom AST and compiler errors only give a start location, whereas LSP mandates that Ranges are always given with start and end locations.

Related, I'm expecting there be to tricky problems when inspecting statements - looking for where local variables are declared and such like. (I suspect all this should be done before closures are initialised / normalised.)

Login or Signup to reply.