LogoScope: NetLogo Syntax Highlighting for Visual Studio Code 🖍️

Hi everyone!

I’m excited to share my new NetLogo project: LogoScope.

LogoScope is a Visual Studio Code extension that provides syntax highlighting for the NetLogo programming language. It supports all NetLogo file extensions (.nlogo, .nlogo3d, .nls, .nlogox, .nlogox3d) and builds on akash raj’s NetLogo Syntax Highlighting extension, last updated in 2020.

The extension is available on the Visual Studio Marketplace, Open VSX, and GitHub.

How It Works

You can install the extension directly from the Visual Studio Code Marketplace or by searching for LogoScope in the Extensions panel.

Theme: Catppuccin Latte

Learn more at: GitHub - danielvartan/logoscope: 🖍️ NetLogo Syntax Highlighting for Visual Studio Code

GitHub Stars are always appreciated! :star:

Cheers,

Daniel Vartanian

4 Likes

I just downloaded this and am using it now. Really nice work!

1 Like

Great work indeed, it works quite well and is very useful! The only thing I noticed is that it doesn’t detect hyphens as part of variable names, instead highlighting them as if they’re subtraction reporters. For example, if I have a variable called user-id, it will get highlighted in three separate parts, with the reporter color in the middle. Pretty minor, but I imagine it would be a pretty simple fix and it would make the code more readable.

1 Like

I’m really glad you guys like it!

I flagged this in issue #9 @ERSUCC .

I still need to optimize the heuristics. It’s always a trade-off when adjusting them :grinning_face_with_smiling_eyes:, but I’ll work on it as soon as possible.

PS: Another side project is on its way to CRAN — a new R package for R–NetLogo interaction. Currently, all existing packages in R only support up to version 6.3.0. This one is called logolink. You can check it out here. I’ll make an announcement once it’s accepted on CRAN.

2 Likes

I love the work, but I cant help but wonder, why would we want to run netlogo in VS code?

I see, it’s a smart process!

I’m glad you like it @lulunum4 !

When working on larger projects, using VS Code really helps, since it provides a more complete IDE (Integrated Development Environment).

One example is the integration with GitHub Copilot. Other helpful features include spell checking, codebase search, and more.

Yes, this is a hard issue to solve.

Since NetLogo can use any extensions (official or not), it’s possible to have many different extension:function combinations. To handle that, I decided to highlight any pattern that follows the extension:function format.

This is indeed a hard problem, and one that is not entirely solved even in NetLogo itself. What you did is probably fine, but if you want to narrow it down slightly, you could highlight extension:function patterns only when the extension portion can be found in the extensions declaration.

1 Like