JetBrains: Move settings from XML to the UI
Created by: vdavid
Context
Settings, such as Sourcegraph URL and access token are currently in the (project-specific) sourcegraph.xml
file.
Problem
Without a UI, it's not convenient to edit the settings.
Solution
Move them to the application Preferences (“Settings” on Windows) window.
The IntelliJ SDK has a pretty good toolkit to add a custom UI for plugins to edit their settings. docs here
The settings we currently have are:
- Sourcegraph URL: string, default is “https://www.sourcegraph.com”, needs a textbox
- Default branch name: string, default is “main”, needs a textbox
-
Remote URL replacements:
- currently, just a string
- it should actually be an array of string pairs: “search” → “replacement”.
- This UI element would be totally cool and hopefully simple to use: https://share.cleanshot.com/qGbHFI – but this UI doesn’t seem to be part of IntelliJ Community Edition, so we can’t just copy and paste it.
- There is a similar one: https://share.cleanshot.com/c8wSWQ and we have source code for this one, just has an extra column that we don’t need.
- Globbing on/off: boolean, needs a checkbox
- Access token: string, default is “”, needs a textbox
It’s a good question which ones we want to make project-specific and which ones should be IDE-specific. Project-specific seems like a better solution.