-- lx format
local format = require("core.format")
local patterns = require("core.format.patterns")
local vcxproj_references = require("format.vcxproj.references")

format.register({
	name = "Visual C++ Project File",
	shortname = "vcxproj",
	author = "liqube",

	extensions = {
		"vcxproj",      -- Visual Studio Project
		"cbproj",       -- C++ Builder Project
		"dproj",        -- Delphi Project
		"groupproj",    -- RAD Studio Group Projet
	},

	inherit = {
		syntax = "module:xml",
		keys = { "headers", "patterns", "block_comment" },
	},
	file_references = vcxproj_references.new(),

	patterns = {
		-- Match braced GUID payloads anywhere in the file
		patterns.guid_braced(),
	},

	outline_patterns = {
		{ pattern = "%s*<Project%s+", line_start = true },
		{ pattern = "%s*<ItemGroup%s+", line_start = true },
		{ pattern = "%s*<ItemGroup>", line_start = true },
		{ pattern = "%s*<PropertyGroup%s+", line_start = true },
		{ pattern = "%s*<ItemDefinitionGroup%s+", line_start = true },
		{ pattern = "%s*<ImportGroup%s+", line_start = true },
	},
})
