Skip to content

Commit

Permalink
Merge pull request #5 from olrtg/add-js-filetype
Browse files Browse the repository at this point in the history
Added javascript and typescript as valid filetypes
  • Loading branch information
olrtg authored Oct 16, 2022
2 parents 90a433d + dae4286 commit 43f2a8e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/nvim-rename-state/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ M.rename_state = function()
vim.lsp.util.apply_workspace_edit(result, client.offset_encoding)

local filetype = vim.api.nvim_buf_get_option(0, "filetype")
local is_jsx_file = filetype == "javascriptreact" or filetype == "typescriptreact"
local is_valid_filetype = filetype == "javascript"
or filetype == "typescript"
or filetype == "javascriptreact"
or filetype == "typescriptreact"

if not is_jsx_file then
if not is_valid_filetype then
return
end

Expand Down

0 comments on commit 43f2a8e

Please sign in to comment.