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
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.![]()
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.![]()
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.![]()
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.![]()
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.![]()
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.![]()
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.![]()
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.![]()
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.![]()