vim-patch:9.1.1935: filetype: not all Erlang files are recognized

Problem:  filetype: not all Erlang files are recognized
Solution: Detect *.app.src and rebar.config files as erlang filetype
          (John Parise).

*.app.src files contain Erlang application definitions. (There are also
*.app files, which are similar but more often build artifacts, and that
file extension is too ambiguous to be recognized by default.)

Reference:
- https://www.erlang.org/doc/system/applications.html

Rebar is the Erlang build tool. rebar.config uses Erlang syntax.

Reference:
- https://rebar3.org/docs/configuration/configuration/

closes: vim/vim#18835

2b2580e61a

Co-authored-by: Jon Parise <jon@indelible.org>
This commit is contained in:
zeertzjq
2025-12-01 09:27:29 +08:00
parent 23ddb2028b
commit 8310f20526
2 changed files with 3 additions and 1 deletions

View File

@@ -1605,6 +1605,7 @@ local filename = {
Earthfile = 'earthfile',
['.editorconfig'] = 'editorconfig',
['elinks.conf'] = 'elinks',
['rebar.config'] = 'erlang',
['mix.lock'] = 'elixir',
['filter-rules'] = 'elmfilt',
['exim.conf'] = 'exim',
@@ -2631,6 +2632,7 @@ local pattern = {
['^www%.conf'] = starsetf('dosini'),
['^drac%.'] = starsetf('dracula'),
['/dtrace/.*%.d$'] = 'dtrace',
['%.app%.src$'] = 'erlang',
['esmtprc$'] = 'esmtprc',
['/0%.orig/'] = starsetf(detect.foam),
['/0/'] = starsetf(detect.foam),

View File

@@ -275,7 +275,7 @@ func s:GetFilenameChecks() abort
\ 'elsa': ['file.lc'],
\ 'elvish': ['file.elv'],
\ 'epuppet': ['file.epp'],
\ 'erlang': ['file.erl', 'file.hrl', 'file.yaws'],
\ 'erlang': ['file.erl', 'file.hrl', 'file.yaws', 'file.app.src', 'rebar.config'],
\ 'eruby': ['file.erb', 'file.rhtml'],
\ 'esdl': ['file.esdl'],
\ 'esmtprc': ['anyesmtprc', 'esmtprc', 'some-esmtprc'],