mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
languages/svelte: fix svelte-language-server not reloading .js/.ts files on change (#1097)
This commit is contained in:
commit
18cba4f03e
2 changed files with 10 additions and 1 deletions
|
@ -319,6 +319,7 @@
|
||||||
- Add global function `nvf_lint` under
|
- Add global function `nvf_lint` under
|
||||||
`vim.diagnostics.nvim-lint.lint_function`.
|
`vim.diagnostics.nvim-lint.lint_function`.
|
||||||
- Deprecate `vim.scrollOffset` in favor of `vim.options.scrolloff`.
|
- Deprecate `vim.scrollOffset` in favor of `vim.options.scrolloff`.
|
||||||
|
- Fix `svelte-language-server` not reloading .js/.ts files on change.
|
||||||
|
|
||||||
[Sc3l3t0n](https://github.com/Sc3l3t0n):
|
[Sc3l3t0n](https://github.com/Sc3l3t0n):
|
||||||
|
|
||||||
|
@ -480,7 +481,6 @@
|
||||||
|
|
||||||
[soliprem](https://github.com/soliprem):
|
[soliprem](https://github.com/soliprem):
|
||||||
|
|
||||||
|
|
||||||
- fix broken `neorg` grammars
|
- fix broken `neorg` grammars
|
||||||
- remove obsolete warning in the `otter` module
|
- remove obsolete warning in the `otter` module
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,15 @@
|
||||||
'';
|
'';
|
||||||
on_attach = mkLuaInline ''
|
on_attach = mkLuaInline ''
|
||||||
function(client, bufnr)
|
function(client, bufnr)
|
||||||
|
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||||
|
pattern = { '*.js', '*.ts' },
|
||||||
|
group = vim.api.nvim_create_augroup('svelte_js_ts_file_watch', {}),
|
||||||
|
callback = function(ctx)
|
||||||
|
-- internal API to sync changes that have not yet been saved to the file system
|
||||||
|
client:notify('$/onDidChangeTsOrJsFile', { uri = ctx.match })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspMigrateToSvelte5', function()
|
vim.api.nvim_buf_create_user_command(bufnr, 'LspMigrateToSvelte5', function()
|
||||||
client:exec_cmd({
|
client:exec_cmd({
|
||||||
command = 'migrate_to_svelte_5',
|
command = 'migrate_to_svelte_5',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue