Repository navigation
Conversation
0.5.0 splits the grammars into nine features. Enable the eight that contain the grammars Winc maps to limn. Contextual keywords such as Java record and when, Groovy trait and Scala given are now keywords only where the grammar allows them, so the tests check them in declarations instead of as bare words.
limn gives JSX child text and plain identifiers the same kind, so the capitalized type pass colored words such as Hello in element text. Track tags, children and brace expressions from the punctuation limn emits and skip the pass inside child text.
limn takes Nix escapes as more than one character, so "\u{" leaks a
string into the following lines. It also interpolates $${ and lets a
path swallow a following indented string. The DFA rules handle all of
these, so the tests assert every original expectation again.
limn treats %{ and %} on their own lines as line comments, so the
lines between them are colored as code. The DFA rules color the whole
block. They need the compiler's if-value action again.
Add an optional Plugins module, off by default, with a settings page that lists, installs and removes plugins. Watch the plugins folder, apply global and project choices, and ask before granting process permissions, which can be revoked one by one.
Apply plugin themes, file types and shortcuts for built-in actions. Use plugin formatters, fixers and language servers after project and user settings, keeping the project before the user.
List approved plugin commands in the command palette and let shortcuts run them. Run commands in the terminal or in the background, locally or on the connected host.
Show plugin settings on the Plugins page and store their values in the user config. Substitute setting values and the active file and project in commands, quoted for the shell that runs them.
Register languages defined by plugins for detection, comments, indentation and the language picker. They render as plain text and work with plugin file types, tools and language servers.
Register a local folder as a development plugin, used in place and watched for changes. It takes the place of an installed plugin with the same id, and removing it only forgets the path.
Read plugin manifests and validate compatibility, contributions and process permissions. Report invalid entries per item and expose the declaration types used by the plugins module.
Plugins can be installed from any https Git URL. The clone is shallow, https only and never prompts, runs in a temporary folder inside the plugins folder, and goes through the same checks and replace confirmation as a folder install. The source is kept in state.json so the plugin menu can offer an update from Git.
The manifest and each language server, formatter, fixer, command and keybinding entry accept "platforms" with macos, linux and windows. Tools and commands follow the system where the program runs (local, WSL or the SSH host), keybindings follow the local system, and entries for disjoint systems no longer conflict. A plugin that leaves out the local system says so on its row. On Windows a plugin program without an extension means <name>.exe. PATH lookup, permission coverage and the shell line all use that exact file instead of PATHEXT, so a .cmd or .bat must be named explicitly. Programs from the user's own settings keep the PATHEXT lookup.
Niox1337
force-pushed
the
feat/1086-plugins
branch
from
December 6, 2026 06:15
d42ac61 to
bf7cbe7
Compare
Niox1337
force-pushed
the
feat/1086-plugins
branch
from
December 6, 2026 10:30
858a7d4 to
5adc5fd
Compare
A plugin can declare dialogs in contributes.dialogs. A dialog shows some of the plugin's settings and run-time inputs in separate groups, button rows that run commands, and a footer with a fixed Close button, one optional left button and the plugin's right buttons, the last one being primary. Apply writes settings and project inputs and keeps the dialog open. Command buttons apply, close the dialog and run the command. Dialogs open from keybindings, menus and buttons through dialog:<plugin>.<id> and from a command palette entry per dialog.
A plugin can ship locales/<tag>.json files with flat key to string maps. Localizable manifest fields written as "%key%" resolve against the interface language, then the same language, then en-US and en. Missing keys keep the literal text and are reported once. Choice settings and inputs accept optionLabels for translated option text while stored values stay unchanged. Switching the interface language updates plugin text right away from the loaded tables.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #96
Fixes #1221
Part of #1086.
Builds on #933 (limn highlighting and runtime language definitions), so it should be merged after that PR. Until then the diff also shows the commits of #933.
Adds the first stage of #1086: declarative plugins. A plugin is a folder with a
plugin.jsonmanifest and the files it refers to. Its contributions go through the same lookups as the user's own settings, so no plugin code runs inside Winc. Code plugins are tracked in #1220. This also covers snippet completions from language servers (#1205).Plugins are a new module under Settings > Modules, off by default. With the module off Winc never reads, lists or watches the plugin folder, and no contribution tables exist.
Documentation
What plugins can do and how they behave is described in the plugin documentation (Simplified Chinese), which follows this branch: https://niox1337.github.io/winc-plugin-docs/
Implementation notes
snippetSupport, so snippet completions from language servers use the same engine.<name>.exeinstead of thePATHEXTlist, PowerShell runs the resolved path with&, and the remote server gainedwhich-exactfor Windows hosts. Values are quoted for the shell that runs the command, and a value that cannot be passed safely refuses to run.protocol.allow=never,httpsonly, shallow and without submodules or LFS. The community list is fetched only when its page opens, limited to 2 MiB and 15 seconds.state.jsonper plugin version and permission list. Remembered input values are stored there per project. Global plugin settings stay inconfig.json.Cost
With the module off nothing is read, listed, fetched or watched. Each contribution is one map lookup at the place where the built in feature already looks up its setting, with no per frame work. New language metadata is interned once per definition under a 1 MiB budget. Windows without plugin rules create no registry. Plugin snippets are a sorted prefix lookup that only runs when completion would run anyway. Visible buttons are cached and recomputed only when the active document, language, selection, project or contributions change, so opening a menu or drawing a frame reads no files. No new dependencies.
Change type
Verification
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo xtask test --allcargo xtask benchagainst #933 (15c6e8b) with the module off, run as base, branch, branch, base on the same machine:The menus and buttons commit against the previous head (bf7cbe7), run the same way:
Screenshots
The Plugins page.
A plugin language highlighted from its own rules.
A snippet completion from a plugin.
Installing a plugin from a Git URL.
Community plugins and the consent dialog.
Two demo plugins: a run button with an SVG icon in the tab bar for Python files, and a Maven button in the status bar because the project has a
pom.xml.The editor menu with the plugin entry after a separator. Snapshot tests draw the menu inside the window, as on Linux and Windows.
The file tree menu of
pom.xmlwith an entry limited byfileNames.Checklist
cargo xtask benchwhen in doubt).