Skip to content

Rekkonnect/Syndiesis

Repository files navigation

Syndiesis

The most revolutionary syntax visualizer and more for C# and Visual Basic

Legal Dislcaimers

This project is not endorsed by any third-party and does not intend to violate any rights of their respective holders. The software distributes other third-party software as follows:

  • Icons from Microsoft's Visual Studio 2022 Image Library
  • Software libraries mentioned below, with compatible distribution policies

Motivation

The project was inspired by the task for applying into a Roslyn internship position regarding C# syntax highlighting at JetBrains (possibly dead links: project / task)

The main design inspiration is SharpLab. The syntax view feature of SharpLab is the main design that the app built upon.

Despite not applying for the internship, I wanted to finish the project and release it into a usable state without entering the depths of feature creep. Feature creep inevitably occurred.

Usage

For Windows, Linux and macOS on x64 and arm64 architectures, download from the Releases page. You may still manually compile the program on your machine with the instructions written below.

The program is designed to be cross-platform on desktop machines (including Windows, Linux and macOS). It's heavily tested to run on Windows 10, and it's moderately tested on Windows 11 and macOS. Please file an issue if platform-specific problems occur.

Check the change log here.

View the wiki for detailed documentation, including a list of keybinds.

Compiling

To compile this program you will need an IDE like Visual Studio 2022, or JetBrains Rider 2024.3+. Load the solution file (Syndiesis.sln) from the IDE of your choice and build the project (recommended to switch to Release mode).

Demo

The video was shot in version 1.2.0

Syndiesis.1.2.0.demo.mp4

Stack

Dependencies

Features

Below is a short list of features:

  • Code editor
    • AvaloniaEdit's features
    • Font zoom
    • Syntax and semantic colorization
    • Go to definition using F12
    • Custom nagivation to outer syntax nodes based on the current selection
    • Diagnostics display
    • Automatic recognition of the snippet's language (C# or VB)
    • Selection of any available language version
    • Quick symbol info
  • Syntax and semantic analysis visualizer
    • Current caret syntax node highlighting
    • Tree view of nodes
    • Display of property names of syntax objects
    • Colorful display of different analysis list view nodes
    • Navigation to code snippet span of selected node
    • Syntax, symbol, operation and attribute analysis
    • Node details view
    • Indication of throwing properties per node
    • Loading nodes respects responsiveness of the app
  • General
    • Auto updating via GitHub Releases
    • Appearance and behavior customization through settings

A large portion of the app is built using basic components in Avalonia. The code editor is from AvaloniaEdit. Some icons were taken from the free version of FontAwesome.

Bugs and Issues

Any issues regarding the code editor are most likely to be reported in AvaloniaEdit. This includes behavior not specific to Syndiesis. Issues will be closed if they are specific to AvaloniaEdit, and must be reported there.

Syndiesis exposes data retrieved from Roslyn itself with minimal intervention for readability purposes. If you encounter misrepresented data, it is probably a Roslyn bug, but feel free to report it regardless. Examples of known Roslyn bugs include:

Desired Features

Desired features among other issues are listed in the issues.

Design Philosophy

The syntax visualizer should provide detailed information about how Roslyn parses the given C# code snippet, and in a pretty and user-friendly format. SharpLab lacks in readability of the tree, and it also doesn't paint the entire picture as intended.

The properties of the nodes are automatically extracted via reflection. Some are filtered out due to duplication in most cases, and in other cases they were not providing any helpful information.

Each different node type is differently treated to extract the most useful information out of it. If you encounter a node missing critical information, or displaying it weirdly, please file an issue.

With 1.1.0 onwards, the program's direction was shifted more towards explaining and visualizing the expected results by using Roslyn itself. This expands the initial scope of the program into being a handy utility making the usage of Roslyn more predictable, especially when testing analyzers or source generators.

On 1.2.0 the node details view was added, focusing more on giving direct feedback for the specified node. This also helps with troubleshooting issues and discovering potential bugs in Roslyn itself.

Sponsor this project

  •  

Contributors 3

  •  
  •  
  •  

Languages