neovim/runtime/lua/vim
Evgeni Chasnovski f61efe3fe7
perf(filetype): implement parent pattern pre-matching (#29660)
Problem: calling `vim.filetype.match()` has performance bottleneck in
  that it has to match a lot of Lua patterns against several versions of
  input file name. This might be the problem if users need to call it
  synchronously a lot of times.

Solution: add "parent pattern pre-matching" which can be used to quickly
  reject several potential pattern matches at (usually rare) cost of
  adding time for one extra Lua pattern match.

  "Parent pattern" is a manually added/tracked grouping of filetype
  patterns which should have two properties:
    - Match at least the same set of strings as its filetype patterns.
      But not too much more.
    - Be fast to match.

  For them to be effective, group should consist from at least three
  filetype patterns.

  Example: for a filetpye pattern ".*/etc/a2ps/.*%.cfg", both "/etc/"
  and "%.cfg" are good parent patterns (prefer the one which can group
  more filetype patterns).

  After this commit, `vim.filetype.match()` on most inputs runs ~3.4
  times faster (while some inputs may see less impact if they match
  many parent patterns).
2024-07-18 10:26:27 -05:00
..
_meta vim-patch:c1b3984: runtime(doc): minor updates. (#29778) 2024-07-18 08:08:56 +08:00
deprecated refactor(lua): use tuple syntax everywhere #29111 2024-06-04 06:06:02 -07:00
filetype vim-patch:9.1.0555: filetype: angular ft detection is still problematic 2024-07-11 00:41:40 +02:00
func fix(treesitter): return correct match table in iter_captures() 2024-03-27 10:39:46 +00:00
health fix(lua): change some vim.fn.expand() to vim.fs.normalize() (#29583) 2024-07-09 19:17:50 +08:00
lsp fix(lsp): inlay hints are rendered in the correct order (#29707) 2024-07-17 16:44:53 +02:00
provider fix(health): fix fetching url with python in provider health (#29594) 2024-07-07 16:37:39 +08:00
treesitter fix(treesitter): recognize aliased parsers in omnifunc, query linter 2024-07-17 12:13:53 +02:00
ui/clipboard fix(osc52): use nvim_chan_send() to stderr for copying (#26690) 2023-12-21 11:47:04 +08:00
_comment.lua feat(lua): add vim._with 2024-06-08 21:38:06 +02:00
_defaults.lua fix(defaults): default @/Q broken when 'ignorecase' is set (#29343) 2024-06-15 10:21:16 +08:00
_editor.lua docs: misc (#28837) 2024-06-07 10:55:14 +08:00
_init_packages.lua refactor(types): more fixes 2024-03-06 10:45:22 +00:00
_inspector.lua refactor: use vim._with where possible 2024-06-28 19:58:31 +02:00
_meta.lua refactor: fix luals type warnings 2024-05-27 20:48:46 +02:00
_options.lua fix(vim.wo): never allow non-zero bufnr 2024-06-12 15:42:56 +01:00
_system.lua fix(vim.ui): open() may wait indefinitely #28325 2024-04-15 04:33:09 -07:00
_watch.lua feat(lsp): drop fswatch, use inotifywait (#29374) 2024-07-06 11:44:19 +02:00
diagnostic.lua fix(diagnostic): fix backwards compatibility for goto_next and goto_prev (#29593) 2024-07-09 14:08:12 -05:00
F.lua fix(diagnostic): typing 2024-01-16 09:33:10 +00:00
filetype.lua perf(filetype): implement parent pattern pre-matching (#29660) 2024-07-18 10:26:27 -05:00
fs.lua fix(fs): make vim.fs.root work for relative paths and unnamed buffers (#28964) 2024-05-24 10:48:32 -05:00
func.lua fix(treesitter): return correct match table in iter_captures() 2024-03-27 10:39:46 +00:00
glob.lua fix(glob): avoid subcapture nesting too deep error (#29520) 2024-07-06 11:40:08 +02:00
health.lua refactor: fix luals type warnings 2024-05-27 20:48:46 +02:00
highlight.lua refactor: use vim._with where possible 2024-06-28 19:58:31 +02:00
inspect.lua fix(inspect): escape identifiers that are lua keywords (#19898) 2022-08-23 13:02:55 +02:00
iter.lua fix(types): use vararg return type annotation 2024-06-11 16:36:29 +01:00
keymap.lua refactor(lua): type annotations 2024-03-16 19:26:10 +00:00
loader.lua perf(loader): use a quicker version of vim.fs.normalize 2024-05-15 12:38:26 +01:00
lsp.lua fix(lsp): don't show codelens for buffers that don't support it (#29690) 2024-07-16 19:48:54 +02:00
provider.lua refactor: create function for deferred loading 2024-02-03 16:53:41 +01:00
re.lua docs: auto-generate docs for vim.lpeg and vim.re 2024-01-14 11:08:33 +00:00
secure.lua refactor(lua): type annotations 2024-03-16 19:26:10 +00:00
shared.lua fix(lua): use rawget() to get __call in vim.is_callable() (#29536) 2024-07-04 06:36:00 +08:00
snippet.lua fix(snippet): modify base indentation when there's actually whitespace (#29670) 2024-07-16 19:30:22 +02:00
termcap.lua docs: various fixes (#28208) 2024-04-30 07:04:42 +08:00
text.lua fix(vim.text): remove assert from vim.text.hexdecode 2024-05-31 08:25:35 -05:00
treesitter.lua refactor(lua): use tuple syntax everywhere #29111 2024-06-04 06:06:02 -07:00
ui.lua fix(lua): change some vim.fn.expand() to vim.fs.normalize() (#29583) 2024-07-09 19:17:50 +08:00
uri.lua fix(lua): remove uri fragment from file paths (#27647) 2024-02-28 10:50:53 +01:00
version.lua docs: support inline markdown 2024-03-09 11:21:55 +00:00
vimhelp.lua feat(help): use treesitter for table of contents 2024-06-09 13:54:34 +02:00