[vim/vim] better support for non-bzl starlark files (Issue #16686)

12 views
Skip to first unread message

David Mandelberg

unread,
Feb 20, 2025, 7:45:24 PM2/20/25
to vim/vim, Subscribed

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
I'd like to add support for .bara.sky files, which are written in starlark.

#12049 added a filetype for starlark, so it would be easy to detect .bara.sky files as that. However, there was already a filetype for bzl which is also written in starlark, and has much better support in vim (it already has a ftplugin, indent, and syntax file, which starlark doesn't have). Looking through the runtime files for bzl, I only see 1 line that's specific to bzl, as opposed to generic starlark, and even that wouldn't cause any trouble for non-bzl starlark: https://github.com/vim/vim/blob/3cb41489dc8856959c1d586217f141ce057dc373/runtime/syntax/bzl.vim#L15

Describe the solution you'd like
I think it would make sense to rename the runtime files for bzl to starlark, add new files for bzl that source the starlark files, and move the one bzl-specific line back into the bzl file. And also detect foo.bara.sky files as starlark.

Describe alternatives you've considered

  • Get rid of starlark in favor of bzl, since bzl is much better supported.
  • Move bzl files to starlark and get rid of bzl, since that's technically more correct than the above.

Additional context
CC @amaanq from #12049 and @dbarnett from the bzl runtime files.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686@github.com>

dseomndseomn created an issue (vim/vim#16686)

Is your feature request about something that is currently impossible or hard to do? Please describe the problem.
I'd like to add support for .bara.sky files, which are written in starlark.

#12049 added a filetype for starlark, so it would be easy to detect .bara.sky files as that. However, there was already a filetype for bzl which is also written in starlark, and has much better support in vim (it already has a ftplugin, indent, and syntax file, which starlark doesn't have). Looking through the runtime files for bzl, I only see 1 line that's specific to bzl, as opposed to generic starlark, and even that wouldn't cause any trouble for non-bzl starlark: https://github.com/vim/vim/blob/3cb41489dc8856959c1d586217f141ce057dc373/runtime/syntax/bzl.vim#L15

Describe the solution you'd like
I think it would make sense to rename the runtime files for bzl to starlark, add new files for bzl that source the starlark files, and move the one bzl-specific line back into the bzl file. And also detect foo.bara.sky files as starlark.

Describe alternatives you've considered

  • Get rid of starlark in favor of bzl, since bzl is much better supported.
  • Move bzl files to starlark and get rid of bzl, since that's technically more correct than the above.

Additional context
CC @amaanq from #12049 and @dbarnett from the bzl runtime files.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686@github.com>

Christian Brabandt

unread,
Feb 22, 2025, 2:58:12 AM2/22/25
to vim/vim, Subscribed

Thanks, I'd like to hear opinions from othres


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/2676080292@github.com>

chrisbrachrisbra left a comment (vim/vim#16686)

Thanks, I'd like to hear opinions from othres


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/2676080292@github.com>

David Barnett

unread,
Feb 23, 2025, 9:29:25 AM2/23/25
to vim/vim, Subscribed

Yeah I believe it's all the same language and should just keep the original bzl name (but note bazel BUILD files are still a subset with slightly different indentation conventions). Technically Starlark is used outside of the Bazel project but I don't see any huge advantage to changing or forking the name, as long as standard filenames are detected so people don't keep thinking it needs to be created from scratch.

OTOH if everyone wants to rename it I don't have a strong opinion these days, just seems like "bzl" is a fine name and has more momentum.

The .bara.sky thing is indeed a common name for bizarre historical reasons, and certainly shouldn't conflict with anyone else's conventions if it's mapped to bzl.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/2676890293@github.com>

dbarnettdbarnett left a comment (vim/vim#16686)

Yeah I believe it's all the same language and should just keep the original bzl name (but note bazel BUILD files are still a subset with slightly different indentation conventions). Technically Starlark is used outside of the Bazel project but I don't see any huge advantage to changing or forking the name, as long as standard filenames are detected so people don't keep thinking it needs to be created from scratch.

OTOH if everyone wants to rename it I don't have a strong opinion these days, just seems like "bzl" is a fine name and has more momentum.

The .bara.sky thing is indeed a common name for bizarre historical reasons, and certainly shouldn't conflict with anyone else's conventions if it's mapped to bzl.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/2676890293@github.com>

David Mandelberg

unread,
Mar 4, 2025, 8:49:16 PM3/4/25
to vim/vim, Subscribed

I'm fine with that approach, and nobody else has expressed an opinion, so I made #16790 to implement that. I'll make another PR to add support for *.bara.sky afterwards if the first PR is accepted.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/2699518266@github.com>

dseomndseomn left a comment (vim/vim#16686)

I'm fine with that approach, and nobody else has expressed an opinion, so I made #16790 to implement that. I'll make another PR to add support for *.bara.sky afterwards if the first PR is accepted.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/2699518266@github.com>

dkearns

unread,
Mar 4, 2025, 10:36:21 PM3/4/25
to vim/vim, Subscribed

Is there really no value in having the two filetypes? The initial proposal seems like the best one at first glance.

We have been trying to avoid unnecessary backward compatibility issues and dropping a filetype seems unnecessary.

There is also some external use of the filetype: https://github.com/cappyzawa/starlark.vim


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/2699703582@github.com>

dkearnsdkearns left a comment (vim/vim#16686)

Is there really no value in having the two filetypes? The initial proposal seems like the best one at first glance.

We have been trying to avoid unnecessary backward compatibility issues and dropping a filetype seems unnecessary.

There is also some external use of the filetype: https://github.com/cappyzawa/starlark.vim


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/2699703582@github.com>

David Mandelberg

unread,
Mar 4, 2025, 10:52:01 PM3/4/25
to vim/vim, Subscribed

I don't have a strong opinion one way or the other, and I'm happy to make another PR for the initial proposal.

P.S. When I made the PR above I was definitely thinking about https://en.wikipedia.org/wiki/Ward_Cunningham#%22Cunningham's_Law%22

The best way to get the right answer on the Internet is not to ask a question; it's to post the wrong answer.

I figured the best way to move the conversation forward (if there was any more conversation to have) was to just make a PR, not to ask if there was consensus. So I'm glad that worked :)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/2699729466@github.com>

dseomndseomn left a comment (vim/vim#16686)

I don't have a strong opinion one way or the other, and I'm happy to make another PR for the initial proposal.

P.S. When I made the PR above I was definitely thinking about https://en.wikipedia.org/wiki/Ward_Cunningham#%22Cunningham's_Law%22

The best way to get the right answer on the Internet is not to ask a question; it's to post the wrong answer.

I figured the best way to move the conversation forward (if there was any more conversation to have) was to just make a PR, not to ask if there was consensus. So I'm glad that worked :)


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/2699729466@github.com>

Christian Brabandt

unread,
Mar 5, 2025, 3:11:12 PM3/5/25
to vim/vim, Subscribed

so let's keep the current solution for now.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/2701959670@github.com>

chrisbrachrisbra left a comment (vim/vim#16686)

so let's keep the current solution for now.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/2701959670@github.com>

Bruno BELANYI

unread,
Nov 25, 2025, 7:08:17 AM11/25/25
to vim/vim, Subscribed
ambroisie left a comment (vim/vim#16686)

My 2 cents as a user: I think @dseomn's proposal makes sense, Starlark is the official name of the language, it's a historical accident that it is called bzl in Vim's codebase. Using starlark as a base and bzl for BUILD-ish files with more specific tweaks to its ftplugins would be good IMO.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/3575332152@github.com>

Thayne McCombs

unread,
12:16 PM (10 hours ago) 12:16 PM
to vim/vim, Subscribed
tmccombs left a comment (vim/vim#16686)

Currently there are ftdetect rules to detect starlark files, but afaict, there isn't an ftplugin or syntax for starlark. Could we either do one of @dseomn's suggestions, or maybe have starlark files that call the bzl ftplugin and syntax files?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16686/5036361814@github.com>

Reply all
Reply to author
Forward
0 new messages