Skip to content

[vim.lsp.config] ast-grep is trying to get attached even if root_markers are not available #3721

Closed
@ahmedelgabri

Description

@ahmedelgabri

Description

By default, it has root_markers set as { 'sgconfig.yaml', 'sgconfig.yml' }

vim.lsp.enable({'ast_grep'})

When I open any file from a language that's if the filetypes list, I always get the following error.

Client ast_grep quit with exit code 2 and signal 0. Check log for errors: /Users/ahmed/.local/state/nvim/lsp.log

Looking at the logs, I see

[ERROR][2025-04-13 18:49:53] ...p/_transport.lua:36	"rpc"	"ast-grep"	"stderr"	"Error: No ast-grep project configuration is found.\nHelp: You need to create an ast-grep project for this command. Try `sg new` to create one.\nSee also: https://ast-grep.github.io/guide/scan-project.html\n\n"

But why is it trying to run if the root_markers are not available?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions