Skip to content

Commit

Permalink
fix: rojo project pattern
Browse files Browse the repository at this point in the history
closes #28
  • Loading branch information
lopi-py committed Aug 18, 2024
1 parent 69f8c6e commit 9f58cc2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ local defaults = {
root_dir = function(path)
local server = require "luau-lsp.server"
return server.root(path, function(name)
return name:match ".*%.project.json$"
return name:match ".+%.project%.json$"
end) or server.root(path, {
".git",
".luaurc",
Expand Down Expand Up @@ -311,7 +311,7 @@ require("luau-lsp").setup {
```lua
local function rojo_project()
return vim.fs.root(0, function(name)
return name:match "%s.project.json$"
return name:match ".+%.project%.json$"
end)
end

Expand All @@ -327,15 +327,15 @@ require("luau-lsp").setup {
```lua
local function rojo_project()
return vim.fs.root(0, function(name)
return name:match "%s.project.json$"
return name:match ".+%.project%.json$"
end)
end

if rojo_project() then
vim.filetype.add {
extension = {
lua = function(path)
return path:match ".nvim.lua$" and "lua" or "luau"
return path:match "%.nvim%.lua$" and "lua" or "luau"
end,
},
}
Expand Down
2 changes: 1 addition & 1 deletion lua/luau-lsp/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ local defaults = {
root_dir = function(path)
local server = require "luau-lsp.server"
return server.root(path, function(name)
return name:match ".*%.project.json$"
return name:match ".+%.project%.json$"
end) or server.root(path, {
".git",
".luaurc",
Expand Down

0 comments on commit 9f58cc2

Please sign in to comment.