Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ftdetect for .props #186

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
19 changes: 19 additions & 0 deletions lua/easy-dotnet/filetypes.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
local M = {}

M.enable_filetypes = function()
if vim.b.did_ftplugin then
return
end

vim.b.did_ftplugin = true

vim.api.nvim_create_autocmd({ "BufEnter" }, {
pattern = "*.props",
group = vim.api.nvim_create_augroup("solution_props", { clear = true }),
callback = function()
vim.bo.filetype = "xml"
end,
})
end
GustavEikaas marked this conversation as resolved.
Show resolved Hide resolved

return M
3 changes: 3 additions & 0 deletions lua/easy-dotnet/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ M.setup = function(opts)
require("easy-dotnet.fs-mappings").add_test_signs()
end

if merged_opts.enablenable_filetypes == true then
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enable_filetypes

require('easy-dotnet.filetypes').enable_filetypes()
end

M.test_project = commands.test
M.test_default = function()
Expand Down
1 change: 1 addition & 0 deletions lua/easy-dotnet/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,5 @@ return {
csproj_mappings = true,
fsproj_mappings = true,
auto_bootstrap_namespace = true,
enable_filetypes = true,
}