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

make namespaces have global scope by default #28469

Open
altermo opened this issue Apr 23, 2024 · 1 comment
Open

make namespaces have global scope by default #28469

altermo opened this issue Apr 23, 2024 · 1 comment
Labels
enhancement feature request needs:discussion For PRs that propose significant changes to some part of the architecture or API

Comments

@altermo
Copy link
Contributor

altermo commented Apr 23, 2024

Problem

I originally designed scoped namespaces to only be able to have window scopes. But now I think that having other types of scopes would be a good idea and also to be able to use namespace scopes for other objects like keymaps and autocmds.

The problem is that by default namespaces have no scopes, which means that when you want to apply a namespace scope to an object that has an associated namespace (like extmarks), one needs to set a scoped option to true to use the namespace scope. Setting an extra option feels a bit cumbersome (especially if scoped namespaces are implemented for other objects like autocmds (#28436)).

Expected behavior

The proposed change is to make namespaces have by default a global scope.
(Note that global scoped namespaces haven't yet been implemented)
This means that if you want to only do some window scoped namespace, you first need to remove the global namespace.

If we don't want this to be a BREAKING-CHANGE then we can make it so that the scoped option for extmarks just skips the global scope check for namespaces.

What do you think? Is it better to make everything have an extra option to apply namespace scopes or is it better to require the removal of the global scope from a namespace?

@altermo altermo added the enhancement feature request label Apr 23, 2024
@altermo altermo changed the title breaking change: make namespaces have global scope by default make namespaces have global scope by default Apr 23, 2024
@justinmk justinmk added the needs:discussion For PRs that propose significant changes to some part of the architecture or API label Apr 23, 2024
@justinmk
Copy link
Member

See also #28441

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request needs:discussion For PRs that propose significant changes to some part of the architecture or API
Projects
None yet
Development

No branches or pull requests

2 participants