Skip to content

Commit b313aa2

Browse files
committed
fix #965
1 parent b37ebce commit b313aa2

File tree

4 files changed

+53
-1
lines changed

4 files changed

+53
-1
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# changelog
22

3+
## 2.6.7
4+
* `FIX` [#965](https://github.com/sumneko/lua-language-server/issues/965)
5+
36
## 2.6.6
47
`2022-2-21`
58
* `NEW` formatter preview, use `--preview` to enable this feature, [read more](https://github.com/sumneko/lua-language-server/issues/960)

script/glob/matcher.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local m = require 'lpeglabel'
33
local Slash = m.S('/\\')^1
44
local Symbol = m.S',{}[]*?/\\'
55
local Char = 1 - Symbol
6-
local Path = (1 - m.S[[\/:*?"<>|]])^1 * Slash
6+
local Path = (1 - m.S[[\/*?"<>|]])^1 * Slash
77
local NoWord = #(m.P(-1) + Symbol)
88
local function whatHappened()
99
return m.Cmt(m.P(1)^1, function (...)

test/tclient/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ require 'tclient.tests.library-ignore-limit'
33
require 'tclient.tests.multi-workspace'
44
require 'tclient.tests.folders-with-single-file'
55
require 'tclient.tests.load-library'
6+
require 'tclient.tests.files-associations'
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
local lclient = require 'tclient.lclient'
2+
local ws = require 'workspace'
3+
local files = require 'files'
4+
local furi = require 'file-uri'
5+
local util = require 'utility'
6+
local fs = require 'bee.filesystem'
7+
8+
local rootPath = LOGPATH .. '/files-associations'
9+
local rootUri = furi.encode(rootPath)
10+
11+
fs.create_directories(fs.path(rootPath))
12+
13+
local filePath = rootPath .. '/test.lua.txt'
14+
local fileUri = furi.encode(filePath)
15+
util.saveFile(filePath, '')
16+
17+
---@async
18+
lclient():start(function (client)
19+
client:registerFakers()
20+
21+
client:register('workspace/configuration', function ()
22+
return {
23+
{},
24+
{
25+
["*.lua.txt"] = "lua",
26+
}
27+
}
28+
end)
29+
30+
client:initialize {
31+
rootPath = rootPath,
32+
rootUri = rootUri,
33+
workspaceFolders = {
34+
{
35+
name = 'ws',
36+
uri = rootUri,
37+
},
38+
}
39+
}
40+
41+
ws.awaitReady(rootUri)
42+
43+
assert(files.isLua(furi.encode 'aaa.lua.txt') == true)
44+
assert(files.isLua(furi.encode '/aaa.lua.txt') == true)
45+
assert(files.isLua(furi.encode 'D:\\aaa.lua.txt') == true)
46+
assert(files.isLua(fileUri) == true)
47+
assert(files.exists(fileUri) == true)
48+
end)

0 commit comments

Comments
 (0)