- automatic configuration of
- treesitter (folding, highlighting)
- markdown codefences (nested folding, highlighting)
- language servers
- ts will be used in non-glint projects
- glint v1 will be used when detected
- glint v2 will be used when detected
- all language servers are scoped to the project, and not editor-instance wide (like vscode), enabling you to have a mix of types of projects in the same repo (or have multiple repos open)
- compatible with the
mainbranch ofnvim-treesitter(notmaster) - pins the glimmer parsers (
glimmer,glimmer_javascript,glimmer_typescript) to known-good revisions, sincenvim-treesitteris archived and its bundled pins no longer receive fixes
nvim-treesitter (main) is archived and ships frozen parser revisions that lag behind
upstream fixes (e.g. the glimmer comment-with-equals parsing fix). ember.nvim
overrides those pins via the documented User TSUpdate autocmd, so the correct parsers
are used on install/update. The pinned parsers are glimmer, glimmer_javascript, and
glimmer_typescript.
- Fresh installs pick up the pinned revisions automatically.
- Existing installs already have the older parsers; run
:TSUpdate glimmer glimmer_javascript glimmer_typescriptonce to move to the pinned revisions (a no-op install won't change an already-installed parser).
The pins live in require('ember.nvim').parser_revisions; bump them as upstream gains
fixes worth shipping.
use {
'NullVoxPopuli/ember.nvim',
requires = {
'nvim-treesitter/nvim-treesitter',
},
config = function()
require('ember.nvim').config()
end
}This configuration may interest you, but may be out of scope for this project.
format on save with conform
use {
'stevearc/conform.nvim',
config = function()
local config = { "prettier", stop_after_first = true }
require('conform').setup({
formatters_by_ft = {
-- Use a sub-list to run only the first available formatter
javascript = config,
typescript = config,
['javascript.glimmer'] = config,
['typescript.glimmer'] = config,
},
format_on_save = {
timeout_ms = 1000,
lsp_fallback = true,
},
notify_on_error = false,
formatters = {
-- We don't want to enable prettierd
-- because it requires global installation, and then
-- we can't even have projects without prettier
-- NOTE: make sure prettier (and prettierd) are not installed globally
prettier = {
require_cwd = true
}
}
})
end
}Ensure that your prettier configure in your project is using the "template tag" plugin:
export default {
printWidth: 100,
plugins: ["prettier-plugin-ember-template-tag"],
overrides: [
{
// Lol, JavaScript
files: ["*.js", "*.ts", "*.cjs", ".mjs", ".cts", ".mts", ".gjs", ".gts"],
options: {
singleQuote: true,
templateSingleQuote: false,
trailingComma: "es5",
},
},
],
};Welcome! Any improvement is welcome <3