Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lua-language-server-srb2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LJ Sonic
lua-language-server-srb2
Commits
9b9b538a
Commit
9b9b538a
authored
4 years ago
by
最萌小汐
Browse files
Options
Downloads
Patches
Plain Diff
cleanup
parent
7b619cb4
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
script/core/searcher.lua
+18
-14
18 additions, 14 deletions
script/core/searcher.lua
test.lua
+1
-1
1 addition, 1 deletion
test.lua
with
19 additions
and
15 deletions
script/core/searcher.lua
+
18
−
14
View file @
9b9b538a
...
@@ -245,18 +245,19 @@ local function checkCache(status, uri, expect, mode)
...
@@ -245,18 +245,19 @@ local function checkCache(status, uri, expect, mode)
return
false
return
false
end
end
local
function
check
Mark
(
mar
k
,
id
,
field
)
local
function
check
SLock
(
sloc
k
,
id
,
field
)
if
noder
.
getIDLength
(
id
)
>
10
then
if
noder
.
getIDLength
(
id
)
>
10
then
print
(
1
)
print
(
1
)
end
end
local
cmark
=
mar
k
[
id
]
local
cmark
=
sloc
k
[
id
]
if
not
cmark
then
if
not
cmark
then
cmark
=
{}
cmark
=
{}
mar
k
[
id
]
=
{}
sloc
k
[
id
]
=
{}
end
end
if
cmark
[
field
or
''
]
then
if
cmark
[
field
or
''
]
then
return
false
return
false
end
end
cmark
[
field
or
''
]
=
true
local
right
=
''
local
right
=
''
while
field
and
field
~=
''
do
while
field
and
field
~=
''
do
local
lastID
=
noder
.
getLastID
(
field
)
local
lastID
=
noder
.
getLastID
(
field
)
...
@@ -269,7 +270,6 @@ local function checkMark(mark, id, field)
...
@@ -269,7 +270,6 @@ local function checkMark(mark, id, field)
end
end
field
=
field
:
sub
(
1
,
-
#
lastID
-
1
)
field
=
field
:
sub
(
1
,
-
#
lastID
-
1
)
end
end
cmark
[
field
or
''
]
=
true
return
true
return
true
end
end
...
@@ -286,15 +286,18 @@ function m.searchRefsByID(status, uri, expect, mode)
...
@@ -286,15 +286,18 @@ function m.searchRefsByID(status, uri, expect, mode)
local
callStack
=
status
.
callStack
local
callStack
=
status
.
callStack
local
mark
=
status
.
flock
[
uri
]
or
{}
local
slock
=
status
.
slock
[
uri
]
or
{}
status
.
flock
[
uri
]
=
mark
local
elock
=
status
.
elock
[
uri
]
or
{}
status
.
slock
[
uri
]
=
slock
status
.
elock
[
uri
]
=
elock
local
function
search
(
id
,
field
)
local
function
search
(
id
,
field
)
local
firstID
=
noder
.
getFirstID
(
id
)
local
firstID
=
noder
.
getFirstID
(
id
)
if
ignoredIDs
[
firstID
]
and
(
field
or
firstID
~=
id
)
then
if
ignoredIDs
[
firstID
]
and
(
field
or
firstID
~=
id
)
then
return
return
end
end
if
not
checkMark
(
mark
,
id
,
field
)
then
if
not
checkSLock
(
slock
,
id
,
field
)
then
footprint
(
status
,
'slocked:'
,
id
,
field
)
return
return
end
end
footprint
(
status
,
'search:'
,
id
,
field
)
footprint
(
status
,
'search:'
,
id
,
field
)
...
@@ -550,7 +553,8 @@ function m.searchRefsByID(status, uri, expect, mode)
...
@@ -550,7 +553,8 @@ function m.searchRefsByID(status, uri, expect, mode)
end
end
local
tid
=
id
..
(
field
or
''
)
local
tid
=
id
..
(
field
or
''
)
local
sid
=
id
local
sid
=
id
if
ignoredIDs
[
id
]
then
if
ignoredIDs
[
id
]
or
id
==
'dn:string'
then
sid
=
'def:'
..
sid
sid
=
'def:'
..
sid
end
end
for
_
,
guri
in
collector
.
each
(
sid
)
do
for
_
,
guri
in
collector
.
each
(
sid
)
do
...
@@ -577,23 +581,22 @@ function m.searchRefsByID(status, uri, expect, mode)
...
@@ -577,23 +581,22 @@ function m.searchRefsByID(status, uri, expect, mode)
end
end
end
end
local
expanding
=
{}
local
function
lockExpanding
(
id
,
field
)
local
function
lockExpanding
(
id
,
field
)
local
locked
=
e
xpanding
[
id
]
local
locked
=
e
lock
[
id
]
if
locked
and
field
then
if
locked
and
field
then
if
#
locked
<=
#
field
then
if
#
locked
<=
#
field
then
if
field
:
sub
(
-#
locked
)
==
locked
then
if
field
:
sub
(
-#
locked
)
==
locked
then
footprint
(
status
,
'locked:'
,
id
,
locked
,
field
)
footprint
(
status
,
'
e
locked:'
,
id
,
locked
,
field
)
return
false
return
false
end
end
end
end
end
end
e
xpanding
[
id
]
=
field
e
lock
[
id
]
=
field
return
true
return
true
end
end
local
function
releaseExpanding
(
id
,
field
)
local
function
releaseExpanding
(
id
,
field
)
e
xpanding
[
id
]
=
nil
e
lock
[
id
]
=
nil
end
end
local
function
searchNode
(
id
,
node
,
field
)
local
function
searchNode
(
id
,
node
,
field
)
...
@@ -917,7 +920,8 @@ function m.status(mode)
...
@@ -917,7 +920,8 @@ function m.status(mode)
callStack
=
{},
callStack
=
{},
crossed
=
{},
crossed
=
{},
lock
=
{},
lock
=
{},
flock
=
{},
slock
=
{},
elock
=
{},
results
=
{},
results
=
{},
rmark
=
{},
rmark
=
{},
smark
=
{},
smark
=
{},
...
...
This diff is collapsed.
Click to expand it.
test.lua
+
1
−
1
View file @
9b9b538a
...
@@ -10,7 +10,7 @@ ROOT = fs.path(rootPath)
...
@@ -10,7 +10,7 @@ ROOT = fs.path(rootPath)
TEST
=
true
TEST
=
true
DEVELOP
=
true
DEVELOP
=
true
--FOOTPRINT = true
--FOOTPRINT = true
TRACE
=
true
--
TRACE = true
LOGPATH
=
LOGPATH
or
(
ROOT
..
'/log'
)
LOGPATH
=
LOGPATH
or
(
ROOT
..
'/log'
)
METAPATH
=
METAPATH
or
(
ROOT
..
'/meta'
)
METAPATH
=
METAPATH
or
(
ROOT
..
'/meta'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment