Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
vscode-lua-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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LJ Sonic
vscode-lua-srb2
Commits
d6d8c7d8
Commit
d6d8c7d8
authored
Sep 20, 2022
by
最萌小汐
Browse files
Options
Downloads
Patches
Plain Diff
add support for `Lua.misc.executablePath`
parent
2a76f7d2
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
client/out/languageserver.js
+19
-9
19 additions, 9 deletions
client/out/languageserver.js
client/src/languageserver.ts
+29
-20
29 additions, 20 deletions
client/src/languageserver.ts
with
48 additions
and
29 deletions
client/out/languageserver.js
+
19
−
9
View file @
d6d8c7d8
...
@@ -67,6 +67,24 @@ class LuaClient {
...
@@ -67,6 +67,24 @@ class LuaClient {
};
};
let
config
=
vscode_1
.
workspace
.
getConfiguration
(
undefined
,
(
_a
=
vscode
.
workspace
.
workspaceFolders
)
===
null
||
_a
===
void
0
?
void
0
:
_a
[
0
]);
let
config
=
vscode_1
.
workspace
.
getConfiguration
(
undefined
,
(
_a
=
vscode
.
workspace
.
workspaceFolders
)
===
null
||
_a
===
void
0
?
void
0
:
_a
[
0
]);
let
commandParam
=
config
.
get
(
"
Lua.misc.parameters
"
);
let
commandParam
=
config
.
get
(
"
Lua.misc.parameters
"
);
let
command
=
yield
this
.
getCommand
(
config
);
let
serverOptions
=
{
command
:
command
,
args
:
commandParam
,
};
this
.
client
=
new
node_1
.
LanguageClient
(
'
Lua
'
,
'
Lua
'
,
serverOptions
,
clientOptions
);
//client.registerProposedFeatures();
yield
this
.
client
.
start
();
this
.
onCommand
();
this
.
statusBar
();
});
}
getCommand
(
config
)
{
return
__awaiter
(
this
,
void
0
,
void
0
,
function
*
()
{
let
executablePath
=
config
.
get
(
"
Lua.misc.executablePath
"
);
if
(
executablePath
&&
executablePath
!=
""
)
{
return
executablePath
;
}
let
command
;
let
command
;
let
platform
=
os
.
platform
();
let
platform
=
os
.
platform
();
let
binDir
;
let
binDir
;
...
@@ -86,15 +104,7 @@ class LuaClient {
...
@@ -86,15 +104,7 @@ class LuaClient {
yield
fs
.
promises
.
chmod
(
command
,
'
777
'
);
yield
fs
.
promises
.
chmod
(
command
,
'
777
'
);
break
;
break
;
}
}
let
serverOptions
=
{
return
command
;
command
:
command
,
args
:
commandParam
,
};
this
.
client
=
new
node_1
.
LanguageClient
(
'
Lua
'
,
'
Lua
'
,
serverOptions
,
clientOptions
);
//client.registerProposedFeatures();
yield
this
.
client
.
start
();
this
.
onCommand
();
this
.
statusBar
();
});
});
}
}
stop
()
{
stop
()
{
...
...
This diff is collapsed.
Click to expand it.
client/src/languageserver.ts
+
29
−
20
View file @
d6d8c7d8
...
@@ -72,6 +72,31 @@ class LuaClient {
...
@@ -72,6 +72,31 @@ class LuaClient {
let
config
=
Workspace
.
getConfiguration
(
undefined
,
vscode
.
workspace
.
workspaceFolders
?.[
0
]);
let
config
=
Workspace
.
getConfiguration
(
undefined
,
vscode
.
workspace
.
workspaceFolders
?.[
0
]);
let
commandParam
:
string
[]
=
config
.
get
(
"
Lua.misc.parameters
"
);
let
commandParam
:
string
[]
=
config
.
get
(
"
Lua.misc.parameters
"
);
let
command
:
string
=
await
this
.
getCommand
(
config
);
let
serverOptions
:
ServerOptions
=
{
command
:
command
,
args
:
commandParam
,
};
this
.
client
=
new
LanguageClient
(
'
Lua
'
,
'
Lua
'
,
serverOptions
,
clientOptions
);
//client.registerProposedFeatures();
await
this
.
client
.
start
();
this
.
onCommand
();
this
.
statusBar
();
}
private
async
getCommand
(
config
:
vscode
.
WorkspaceConfiguration
)
{
let
executablePath
:
string
=
config
.
get
(
"
Lua.misc.executablePath
"
);
if
(
executablePath
&&
executablePath
!=
""
)
{
return
executablePath
;
}
let
command
:
string
;
let
command
:
string
;
let
platform
:
string
=
os
.
platform
();
let
platform
:
string
=
os
.
platform
();
let
binDir
:
string
;
let
binDir
:
string
;
...
@@ -96,7 +121,7 @@ class LuaClient {
...
@@ -96,7 +121,7 @@ class LuaClient {
'
lua-language-server
'
'
lua-language-server
'
)
)
);
);
await
fs
.
promises
.
chmod
(
command
,
'
777
'
)
await
fs
.
promises
.
chmod
(
command
,
'
777
'
)
;
break
;
break
;
case
"
darwin
"
:
case
"
darwin
"
:
command
=
this
.
context
.
asAbsolutePath
(
command
=
this
.
context
.
asAbsolutePath
(
...
@@ -106,26 +131,10 @@ class LuaClient {
...
@@ -106,26 +131,10 @@ class LuaClient {
'
lua-language-server
'
'
lua-language-server
'
)
)
);
);
await
fs
.
promises
.
chmod
(
command
,
'
777
'
)
await
fs
.
promises
.
chmod
(
command
,
'
777
'
)
;
break
;
break
;
}
}
return
command
;
let
serverOptions
:
ServerOptions
=
{
command
:
command
,
args
:
commandParam
,
};
this
.
client
=
new
LanguageClient
(
'
Lua
'
,
'
Lua
'
,
serverOptions
,
clientOptions
);
//client.registerProposedFeatures();
await
this
.
client
.
start
();
this
.
onCommand
();
this
.
statusBar
();
}
}
async
stop
()
{
async
stop
()
{
...
...
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