diff --git a/lua/lspconfig/configs/atlas.lua b/lua/lspconfig/configs/atlas.lua index 7d890b8103..b862f3d7c0 100644 --- a/lua/lspconfig/configs/atlas.lua +++ b/lua/lspconfig/configs/atlas.lua @@ -29,6 +29,26 @@ You may also need to configure the filetype for *.hcl files: `autocmd BufNewFile,BufRead *.test.hcl set filetype=atlas-test` `autocmd BufNewFile,BufRead *.plan.hcl set filetype=atlas-plan` +or + +```lua +vim.filetype.add({ + filename = { + ['atlas.hcl'] = 'atlas-config', + }, + pattern = { + ['.*/*.my.hcl'] = 'atlas-schema-mysql', + ['.*/*.pg.hcl'] = 'atlas-schema-postgresql', + ['.*/*.lt.hcl'] = 'atlas-schema-sqlite', + ['.*/*.ch.hcl'] = 'atlas-schema-clickhouse', + ['.*/*.ms.hcl'] = 'atlas-schema-mssql', + ['.*/*.rs.hcl'] = 'atlas-schema-redshift', + ['.*/*.test.hcl'] = 'atlas-test', + ['.*/*.plan.hcl'] = 'atlas-plan', + }, +}) +``` + ]], }, }