Skip to content

Conversation

@kris3713
Copy link
Contributor

@kris3713 kris3713 commented Dec 20, 2025

Add's important root markers for this LSP config.

Changes how the LSP config recognizes Systemd unit files, and added important documentation regarding autocmds.

@kris3713 kris3713 mentioned this pull request Dec 20, 2025
@justinmk
Copy link
Member

root_markers does not (yet) support wildcards/glob.

@kris3713
Copy link
Contributor Author

let me correct that

@kris3713
Copy link
Contributor Author

Will this work?

image

@kris3713
Copy link
Contributor Author

I tried it with a service file, and it seems to work just fine.

000001_2025-12-20_14-40-53
000001_2025-12-20_14-42-00

@kris3713
Copy link
Contributor Author

@justinmk, Don't merge this PR just yet, one user (@brady444) is reporting that the current Lsp config (including my fork for this PR) isn't working for them.

@kris3713
Copy link
Contributor Author

kris3713 commented Dec 21, 2025

@justinmk, All issues have been solved. You can merge this PR without any more trouble.

@kris3713 kris3713 changed the title feat(systemd_lsp): Add important root markers feat(systemd_lsp): Use root_dir instead of root_markers. Dec 21, 2025
@kris3713 kris3713 changed the title feat(systemd_lsp): Use root_dir instead of root_markers. feat(systemd_lsp): Update functionality. Dec 21, 2025
@kris3713 kris3713 changed the title feat(systemd_lsp): Update functionality. feat(systemd_lsp): Update functionality and add extra documentation. Dec 21, 2025
@kris3713
Copy link
Contributor Author

Hey @justinmk, why is this PR not being merged?

@magnuslarsen
Copy link
Contributor

Hi @kris3713 - systemd-lsp just had a new release, with support for a bunch of podman/quadlet files. The autocmd note could be updated as so:

vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
	desc = "Set filetype to systemd for systemd unit files",
	group = vim.api.nvim_create_augroup("systemd-filetypes", { clear = true }),
	pattern = {
		-- systemd unit files
		"*.service",
		"*.socket",
		"*.timer",
		"*.mount",
		"*.automount",
		"*.swap",
		"*.target",
		"*.path",
		"*.slice",
		"*.scope",
		"*.device",
		-- Podman Quadlet files
		"*.container",
		"*.volume",
		"*.network",
		"*.kube",
		"*.pod",
		"*.build",
		"*.image",
	},
	callback = function()
		local bufnr = vim.api.nvim_get_current_buf()
		vim.bo[bufnr].filetype = "systemd"
	end,
})

ref: JFryy/systemd-lsp#22

…ttern from lspconfig.utils

This is a correction of the previous commit
@kris3713
Copy link
Contributor Author

kris3713 commented Jan 2, 2026

@justinmk, I managed to add your suggestions. Sorry for the delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants