Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 48 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,52 @@ jobs:
name: extension-vscode
path: artifacts/vscode/*.vsix

build-rider:

# macOS so the plugin includes the Eto.macOS preview host
runs-on: macos-latest

steps:
- uses: actions/checkout@v7
with:
submodules: true

- name: Setup .NET Core
uses: actions/setup-dotnet@v6
with:
dotnet-version: |
${{ env.DotNetVersion }}
8.0.x

- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- name: Install macOS workload
run: dotnet workload install macos

- uses: actions/setup-java@v6
with:
distribution: temurin
java-version: '21'

# caches the Rider download between runs
- uses: gradle/actions/setup-gradle@v6

- name: Build plugin
working-directory: src/Eto.DevExtension.Rider
# builds against the oldest supported Rider
run: ./gradlew buildPlugin -PuseLocalRider=false

- name: Upload plugin
uses: actions/upload-artifact@v7
with:
name: extension-rider
path: src/Eto.DevExtension.Rider/build/distributions/*.zip

publish:
needs: [ build-windows, build-vscode ]
needs: [ build-windows, build-vscode, build-rider ]
runs-on: ubuntu-latest
if: (github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/'))
permissions:
Expand All @@ -114,4 +158,6 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
fail_on_unmatched_files: true
files: extensions/*.vsix
files: |
extensions/*.vsix
extensions/*.zip
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,26 @@
"${workspaceFolder}/src/Eto.DevExtension.VSCode/out/**/*.js"
]
},
{
// runs the newest Rider installed, or set riderPath in src/Eto.DevExtension.Rider/gradle.properties
"name": "Eto.DevExtension.Rider",
"type": "node-terminal",
"request": "launch",
"command": "./gradlew runIde",
"windows": {
"command": ".\\gradlew.bat runIde"
},
"cwd": "${workspaceFolder}/src/Eto.DevExtension.Rider"
},
{
// needs the Debugger for Java extension
"name": "Eto.DevExtension.Rider (debug)",
"type": "java",
"request": "attach",
"hostName": "localhost",
"port": 5005,
"preLaunchTask": "run-rider-debug"
},
{
"name": "Eto.DevExtension.VisualStudio.Windows.2022",
"type": "clr",
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"var": {
"configuration" : "Debug",
"buildProperties" : "/v:Minimal /p:GenerateFullPaths=True /consoleLoggerParameters:NoSummary"
}
},
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "interactive"
}
36 changes: 36 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,42 @@
},
"problemMatcher": "$tsc",
"group": "build"
},
{
"label": "build-rider-plugin",
"type": "shell",
"command": "./gradlew",
"windows": {
"command": ".\\gradlew.bat"
},
"args": [ "buildPlugin" ],
"options": {
"cwd": "${workspaceFolder}/src/Eto.DevExtension.Rider"
},
"problemMatcher": [],
"group": "build"
},
{
// waits for a debugger on port 5005 before Rider starts
"label": "run-rider-debug",
"type": "shell",
"command": "./gradlew",
"windows": {
"command": ".\\gradlew.bat"
},
"args": [ "runIde", "--debug-jvm" ],
"options": {
"cwd": "${workspaceFolder}/src/Eto.DevExtension.Rider"
},
"isBackground": true,
"problemMatcher": {
"owner": "gradle",
"pattern": { "regexp": "^\\b$" },
"background": {
"beginsPattern": "Using Rider|No local Rider found",
"endsPattern": "Listening for transport dt_socket at address"
}
}
}
],
"inputs": [
Expand Down
3 changes: 2 additions & 1 deletion src/Eto.Designer/DesignPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public static Control GetContent(Control content)
// swap out window for a panel so we can add it as a child
content = new Panel
{
BackgroundColor = window.BackgroundColor,
// Gtk reports a window's colour as transparent, which would leave the form without a background
BackgroundColor = window.BackgroundColor.A > 0 ? window.BackgroundColor : Global.Theme.DesignerPanel,
Padding = window.Padding,
StyleProvider = window.StyleProvider,
MinimumSize = window.MinimumSize,
Expand Down
3 changes: 2 additions & 1 deletion src/Eto.DevExtension.PreviewHost/HostTheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Color Get(string name, Color fallback) =>
public Color SummaryBackground => Get(nameof(SummaryBackground), SystemColors.Control);
public Color SummaryForeground => Get(nameof(SummaryForeground), SystemColors.ControlText);
public Color DesignerBackground => Get(nameof(DesignerBackground), SystemColors.Control);
public Color DesignerPanel => Get(nameof(DesignerPanel), Color.FromRgb(0xF0F0F0));
// the platform's window colour, so panels look like forms in dark mode, but Gtk can report it as transparent
public Color DesignerPanel => Get(nameof(DesignerPanel), SystemColors.WindowBackground is { A: > 0 } window ? window : Color.FromRgb(0xF0F0F0));
public IEnumerable<PlatformColor> AllColors => Enumerable.Empty<PlatformColor>();
}
}
5 changes: 5 additions & 0 deletions src/Eto.DevExtension.Rider/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.gradle/
.intellijPlatform/
.kotlin/
build/
bin/
42 changes: 42 additions & 0 deletions src/Eto.DevExtension.Rider/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Eto.Forms Designer for Rider

Autocompletion, hover documentation and a live preview for [Eto.Forms](https://github.com/picoe/Eto) designer files,
with the same features as the VS Code extension. Needs Rider 2025.1 or newer.

## Features

- A live preview of `.xeto`, `.jeto` and `.eto.cs` files in the **Eto Preview** tool window, which appears once you open
one of those files. Open it from its button on the right-hand side, **View | Tool Windows**, or **Open Eto Preview** in
the editor's right-click menu. It follows the file you're editing and redraws as you type and after each build. Drag the corner handle to try other sizes; click the size label to go back to the form's own size
- Pick the platform to draw with from the drop down in the preview, the same as in VS Code. The **Log** tab shows the preview host's output
- Completion of controls, properties, events and values, including your own controls once the project is built
- Hover documentation from the Eto.Forms xml docs
- Syntax highlighting for both file types, using the VS Code extension's grammars

Requires the [.NET 8 runtime](https://dotnet.microsoft.com/download) or newer. On Windows the preview also needs the
.NET Desktop Runtime, and on Linux GTK 3.

## Settings

**Settings | Tools | Eto.Forms Designer** has the same options as VS Code's `eto.*` settings: the `dotnet` executable,
the language server and preview host paths, and the folder of the `Eto.dll` to complete against. Run
**Tools | Restart Eto Language Server** to pick up a different project's Eto version.

## Building

Needs a JDK 17 or newer to run Gradle (`JAVA_HOME` or on `PATH`), and the .NET SDK. Gradle downloads the JDK it compiles with.

```sh
./gradlew runIde # starts Rider with the plugin, in a separate sandbox
./gradlew buildPlugin # zip in build/distributions, installable from Settings | Plugins | Install Plugin from Disk
```

Both build the language server and preview hosts first. The Eto.macOS preview host is only built on a Mac with the
.NET macOS workload; without it Mac previews use Eto.Mac64.

The build uses the newest Rider installed in the usual places for Windows, macOS and Linux, including JetBrains Toolbox,
snap and flatpak installs. Set `riderPath` in `gradle.properties` (or the `RIDER_PATH` environment variable) to use a
specific one. With no Rider installed, Rider `riderVersion` is downloaded instead, which is large.

From VS Code, run **Eto.DevExtension.Rider** from Run and Debug. **Eto.DevExtension.Rider (debug)** attaches a debugger
to Rider, which needs the Debugger for Java extension.
Loading
Loading