-
Notifications
You must be signed in to change notification settings - Fork 328
Filter Linux workspace open targets by XDG category #2494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -369,6 +369,16 @@ function parseDesktopEntryValue(line: string): [string, string] | null { | |
| ]; | ||
| } | ||
|
|
||
| const LINUX_WORKSPACE_APPLICATION_CATEGORIES = new Set([ | ||
| "FileManager", | ||
| "TerminalEmulator", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 A real GNOME Terminal entry uses |
||
| "TextEditor", | ||
| ]); | ||
|
|
||
| function parseDesktopEntryList(value: string | undefined): string[] { | ||
| return value?.split(";").filter(Boolean) ?? []; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚨 The desktop-entry standard permits escaped semicolons in |
||
| } | ||
|
|
||
| function parseLinuxDesktopApplication( | ||
| desktopFilePath: string, | ||
| content: string, | ||
|
|
@@ -403,7 +413,14 @@ function parseLinuxDesktopApplication( | |
|
|
||
| const label = fields.get("Name"); | ||
| const exec = fields.get("Exec"); | ||
| if (!label || !exec) { | ||
| const categories = parseDesktopEntryList(fields.get("Categories")); | ||
| if ( | ||
| !label || | ||
| !exec || | ||
| !categories.some((category) => | ||
| LINUX_WORKSPACE_APPLICATION_CATEGORIES.has(category), | ||
| ) | ||
| ) { | ||
| return null; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨
slopcop/review— The allowlist excludes standard IDE entries.The desktop menu standard defines
IDEas a category. GNOME Builder usesCategories=GNOME;GTK;Development;IDE;, and this repository has no explicit GNOME Builder adapter. This change removes that useful workspace target. AddIDEto the allowlist and cover it with a fixture.