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
35aa1dab
Commit
35aa1dab
authored
3 years ago
by
最萌小汐
Browse files
Options
Downloads
Patches
Plain Diff
improve
parent
e0cc99cf
No related branches found
No related tags found
Loading
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
script/core/noder.lua
+15
-29
15 additions, 29 deletions
script/core/noder.lua
test.lua
+1
-1
1 addition, 1 deletion
test.lua
with
16 additions
and
30 deletions
script/core/noder.lua
+
15
−
29
View file @
35aa1dab
...
...
@@ -363,8 +363,6 @@ local function getNodeKey(source)
return
key
,
node
end
local
IDList
=
{}
local
IDList2
=
{}
---获取语法树单元的字符串ID
---@param source parser.guide.object
---@return string? id
...
...
@@ -383,38 +381,26 @@ local function getID(source)
tracy
.
ZoneBeginN
'getID'
local
_
<
close
>
=
tracy
.
ZoneEnd
local
current
=
source
local
index
=
0
while
true
do
if
current
.
type
==
'paren'
then
while
current
.
type
==
'paren'
do
current
=
current
.
exp
if
not
current
then
source
.
_id
=
false
return
nil
end
goto
CONTINUE
end
local
id
,
node
=
getNodeKey
(
current
)
if
not
id
then
break
end
index
=
index
+
1
IDList
[
index
]
=
id
if
not
node
then
break
end
current
=
node
::
CONTINUE
::
end
if
index
==
0
then
source
.
_id
=
false
return
nil
end
for
i
=
index
+
1
,
#
IDList2
do
IDList2
[
i
]
=
nil
if
node
then
local
pid
=
getID
(
node
)
if
not
pid
then
source
.
_id
=
false
return
nil
end
for
i
=
1
,
index
do
IDList2
[
i
]
=
IDList
[
index
-
i
+
1
]
id
=
pid
..
SPLIT_CHAR
..
id
end
local
id
=
tconcat
(
IDList2
,
SPLIT_CHAR
)
source
.
_id
=
id
return
id
end
...
...
@@ -1427,6 +1413,6 @@ files.watch(function (ev, uri)
end
end
)
--
require 'tracy'.enable()
require
'tracy'
.
enable
()
return
m
This diff is collapsed.
Click to expand it.
test.lua
+
1
−
1
View file @
35aa1dab
...
...
@@ -91,7 +91,7 @@ local function main()
--config.Lua.intelliSense.searchDepth = 5
--loadDocMetas()
--
test 'full'
test
'full'
require
'bee.platform'
.
OS
=
'Windows'
testAll
()
...
...
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