The atlas language server supports Atlas config and schema files.
Filetype Configuration
Because Atlas uses .hcl files with specific suffixes for different databases, you should configure the filetypes in Neovim to ensure the LSP attaches correctly. You can use vim.filetype.add to map specific patterns to Atlas filetypes.
Treesitter Integration
To improve syntax highlighting, you can register Atlas filetypes as hcl in Treesitter.
-- Configure filetypes for Atlas
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',
['.*/*.rule.hcl'] = 'atlas-rule',
},
})
-- Register with Treesitter for HCL highlighting
vim.treesitter.language.register('hcl', 'atlas-config')
-- ... repeat for other atlas filetypes
-- Enable the LSP
vim.lsp.enable('atlas')