Skip to content

Commit

Permalink
add documentation explaining compound filetypes
Browse files Browse the repository at this point in the history
  • Loading branch information
baodrate committed May 11, 2024
1 parent ba97875 commit 9eafc28
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/lspconfig/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ M.default_config = {
-- global on_setup hook
M.on_setup = nil

---@param filetype string the filetype to check (can be a compound, dot-separated filetype; see |'filetype'|)
---Test if a given filetype string matches any of the expected filetypes
---
---Note that vim filetypes can be a dot-separated string containing multiple filetypes, and the plugins/syntax rules for
---all sub-filetypes are applied to the buffer. e.g. a buffer with a filetype of `yaml.ansible` will load the ftplugin
---and syntax rules for both `yaml` and `ansible` (and in that order). see `:h 'filetype'`
---
---Accordingly, this will attempt to match any of the sub-filetypes against the expected filetype(s)
---@param filetype string the filetype to check (can be a compound, dot-separated filetype)
---@param expected string|string[] the filetype(s) to match against
---@return boolean
function M.ft_matches(filetype, expected)
Expand Down

0 comments on commit 9eafc28

Please sign in to comment.