We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8b9dce commit c114e42Copy full SHA for c114e42
lua/codecompanion/strategies/chat/slash_commands/symbols.lua
@@ -162,6 +162,18 @@ function SlashCommand:output(selected, opts)
162
opts = opts or {}
163
164
local ft = vim.filetype.match({ filename = selected.path })
165
+ -- weird TypeScript bug for vim.filetype.match
166
+ -- see: https://github.com/neovim/neovim/issues/27265
167
+ if not ft then
168
+ local base_name = vim.fs.basename(selected.path)
169
+ local split_name = vim.split(base_name, "%.")
170
+ if #split_name > 1 then
171
+ local ext = split_name[#split_name]
172
+ if ext == "ts" then
173
+ ft = "typescript"
174
+ end
175
176
177
local content = path.new(selected.path):read()
178
179
local query = vim.treesitter.query.get(ft, "symbols")
0 commit comments