Extension API for Getting User Settings

Feature: an Extension API endpoint to fetch the user’s settings information as is returned from the updateEditorPreferences graphql operation:

[
    {
        "data": {
            "updateEditorPreferences": {
                "id": 1234,
                "editorPreferences": {
                    "fontSize": 12,
                    "indentIsSpaces": true,
                    "indentSize": 2,
                    "keyboardHandler": "vim",
                    "wrapping": true,
                    "codeIntelligence": true,
                    "codeSuggestion": true,
                    "accessibleTerminal": false,
                    "multiselectModifierKey": "altKey",
                    "webviewAutoOpenOnPortOpened": true,
                    "minimapDisplay": "none",
                    "__typename": "EditorPreferences"
                },
                "__typename": "CurrentUser"
            }
        }
    }
]

If an extension needs to present a text editor to the user, it would be nice if this text editor would behave in the expected manner, like other text editors in Replit. This is especially true for the keyboardHandler setting!

I am creating a Replit extension that allows the user to edit the content of an SVG file on Replit and see a live preview of their changes. Without this extension you have to download, modify, and re-upload the file. However I use Vim keybindings, so not having my normal keybindings in the CodeMirror editor that my extension creates is very painful. And if I make the extension default to my preferred settings I’m sure that would make it less useful to others.

2 Likes

Thanks for this, definitely something we can consider adding in the future!

1 Like