summaryrefslogtreecommitdiff
path: root/autoload/ale.vim
diff options
context:
space:
mode:
authorBartek thindil Jasicki <thindil@laeran.pl>2020-08-29 10:42:25 +0200
committerBartek thindil Jasicki <thindil@laeran.pl>2020-08-29 10:42:25 +0200
commit0de847a8e1793b597ba0a73ae8e20797a5fce920 (patch)
tree6f465b404af38ff25dddde94e052bdfa0a3a38c8 /autoload/ale.vim
parent62f07d820c2b474216657bd43a3a919469c9584f (diff)
parent7d4ce4e6aa960a6052a16d90322566d6f4fddb7c (diff)
downloadale-0de847a8e1793b597ba0a73ae8e20797a5fce920.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'autoload/ale.vim')
-rw-r--r--autoload/ale.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim
index 6251b47b..b75c9fc9 100644
--- a/autoload/ale.vim
+++ b/autoload/ale.vim
@@ -266,3 +266,23 @@ function! ale#GetLocItemMessage(item, format_string) abort
return l:msg
endfunction
+
+" Given a buffer and a linter or fixer name, return an Array of two-item
+" Arrays describing how to map filenames to and from the local to foreign file
+" systems.
+function! ale#GetFilenameMappings(buffer, name) abort
+ let l:linter_mappings = ale#Var(a:buffer, 'filename_mappings')
+
+ if type(l:linter_mappings) is v:t_list
+ return l:linter_mappings
+ endif
+
+ let l:name = a:name
+
+ if !has_key(l:linter_mappings, l:name)
+ " Use * as a default setting for all tools.
+ let l:name = '*'
+ endif
+
+ return get(l:linter_mappings, l:name, [])
+endfunction