Skip to content
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

Redesign and rewrite some parts of porcupine.settings #1481

Open
Akuli opened this issue Mar 31, 2024 · 0 comments
Open

Redesign and rewrite some parts of porcupine.settings #1481

Akuli opened this issue Mar 31, 2024 · 0 comments

Comments

@Akuli
Copy link
Owner

Akuli commented Mar 31, 2024

I'm no longer happy with some of the things it does. There are many small problems, so I decided to just make one issue about them.

In #1193, I discovered that the JSON serializing code is leaking memory. I should replace the class-in-function hack it's using now with something much simpler.

To merge tab settings from multiple places, such as .editorconfig and filetypes.toml, it would be nice to provide a priority when settings are set. Then the .set() with highest priority would be used. For example, the editorconfig plugin would use a higher priority than the filetypes plugin, so that it overrides whatever filetypes sets. The loading order is no longer enough, because I want to reload filetypes.toml configs without reloading editorconfigs, but things set in editorconfig should still take precedence.

In the past, benjamin-kirkbride has been confused by settings.get("setting_name", list[str]). It looks somewhat like dict.get, but behaves differently.

If a setting can be None, you can still .get() it with a non-None type whenever it isn't set to None. You then get a runtime error when the value is None. See #1440 for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant