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
543566ef
Commit
543566ef
authored
6 years ago
by
sumneko
Browse files
Options
Downloads
Patches
Plain Diff
暂存
parent
d6807b84
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
server/debugger.lua
+51
-0
51 additions, 0 deletions
server/debugger.lua
server/main.lua
+1
-9
1 addition, 9 deletions
server/main.lua
with
52 additions
and
9 deletions
server/debugger.lua
0 → 100644
+
51
−
0
View file @
543566ef
local
fs
=
require
'bee.filesystem'
local
extensionPath
=
fs
.
path
(
os.getenv
'USERPROFILE'
)
/
'.vscode'
/
'extensions'
log
.
debug
(
'Search extensions at:'
,
extensionPath
:
string
())
if
not
fs
.
is_directory
(
extensionPath
)
then
log
.
debug
(
'Extension path is not a directory.'
)
return
end
local
luaDebugs
=
{}
for
path
in
extensionPath
:
list_directory
()
do
if
fs
.
is_directory
(
path
)
then
local
name
=
path
:
filename
():
string
()
if
name
:
find
(
'actboy168.lua-debug-'
,
1
,
true
)
then
luaDebugs
[
#
luaDebugs
+
1
]
=
name
end
end
end
if
#
luaDebugs
==
0
then
log
.
debug
(
'Cant find "actboy168.lua-debug"'
)
return
end
local
function
getVer
(
filename
)
local
a
,
b
,
c
=
filename
:
match
(
'(%d+)%.(%d+)%.(%d+)$'
)
if
not
a
then
return
0
end
return
a
*
1000000
+
b
*
1000
+
c
end
table.sort
(
luaDebugs
,
function
(
a
,
b
)
return
getVer
(
a
)
>
getVer
(
b
)
end
)
local
debugPath
=
extensionPath
/
luaDebugs
[
1
]
local
cpath
=
"runtime/win64/lua54/?.dll"
local
path
=
"script/?.lua"
package.cpath
=
package.cpath
..
';'
..
(
debugPath
/
cpath
):
string
()
local
function
tryDebugger
()
local
rdebug
=
require
"remotedebug"
local
entry
=
package.searchpath
(
'start_debug'
,
(
debugPath
/
path
):
string
())
local
dbg
=
loadfile
(
entry
)(
rdebug
,
debugPath
:
string
()
..
'/'
,
path
,
cpath
)
local
port
=
"11411"
dbg
:
start
(
"listen:127.0.0.1:"
..
port
,
true
)
log
.
debug
(
'Debugger startup, listen port:'
,
port
)
end
xpcall
(
tryDebugger
,
log
.
debug
)
This diff is collapsed.
Click to expand it.
server/main.lua
+
1
−
9
View file @
543566ef
...
@@ -21,15 +21,7 @@ log.init(ROOT, ROOT / 'log' / 'service.log')
...
@@ -21,15 +21,7 @@ log.init(ROOT, ROOT / 'log' / 'service.log')
log
.
info
(
'Lua Lsp startup, root: '
,
ROOT
)
log
.
info
(
'Lua Lsp startup, root: '
,
ROOT
)
ac
=
{}
ac
=
{}
local
function
tryDebugger
()
--xpcall(dofile, log.debug, rootPath .. 'debugger.lua')
local
dbg
=
require
'debugger'
dbg
:
io
'listen:127.0.0.1:11411'
dbg
:
start
()
log
.
info
(
'Debugger startup, listen port: 11411'
)
end
--pcall(tryDebugger)
require
'utility'
require
'utility'
require
'global_protect'
require
'global_protect'
local
service
=
require
'service'
local
service
=
require
'service'
...
...
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