Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Apache NetBeans
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NetBeans
Apache NetBeans
Commits
818d41ab
Unverified
Commit
818d41ab
authored
4 years ago
by
Dusan Balek
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixing failing build. (#2718)
parent
a000e7ca
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
java/java.lsp.server/build.xml
+1
-0
1 addition, 0 deletions
java/java.lsp.server/build.xml
java/java.lsp.server/vscode/src/extension.ts
+24
-13
24 additions, 13 deletions
java/java.lsp.server/vscode/src/extension.ts
with
25 additions
and
13 deletions
java/java.lsp.server/build.xml
+
1
−
0
View file @
818d41ab
...
...
@@ -87,6 +87,7 @@
<delete
dir=
"${build.dir}/bundles"
/>
<mkdir
dir=
"${build.dir}/bundles/package"
/>
<copy
file=
"vscode/package.json"
todir=
"${build.dir}/bundles/package"
/>
<copy
file=
"vscode/package-lock.json"
todir=
"${build.dir}/bundles/package"
/>
<exec
executable=
"mvn"
failonerror=
"true"
dir=
"${nb_all}/nbbuild/misc/prepare-bundles"
>
<arg
value=
"package"
/>
...
...
This diff is collapsed.
Click to expand it.
java/java.lsp.server/vscode/src/extension.ts
+
24
−
13
View file @
818d41ab
...
...
@@ -197,7 +197,7 @@ export function activate(context: ExtensionContext): VSNetBeansAPI {
}
},
humanVisibleDelay
);
}
else
{
reject
(
`cannot compile workspace; client is
${
c
lient
}
`
);
reject
(
`cannot compile workspace; client is
${
c
}
`
);
}
});
});
...
...
@@ -242,30 +242,34 @@ let maintenance : Promise<void> | null;
let
activationPending
:
boolean
=
false
;
function
activateWithJDK
(
specifiedJDK
:
string
|
null
,
context
:
ExtensionContext
,
log
:
vscode
.
OutputChannel
,
notifyKill
:
boolean
):
void
{
let
setClient
:
[(
c
:
LanguageClient
)
=>
void
,
(
err
:
any
)
=>
void
];
client
=
new
Promise
<
LanguageClient
>
((
clientOK
,
clientErr
)
=>
{
setClient
=
[
clientOK
,
clientErr
];
});
const
a
:
Promise
<
void
>
|
null
=
maintenance
;
if
(
activationPending
)
{
// do not activate more than once in parallel.
handleLog
(
log
,
"
Server activation requested repeatedly, ignoring...
"
);
return
;
}
let
oldClient
=
client
;
let
setClient
:
[(
c
:
LanguageClient
)
=>
void
,
(
err
:
any
)
=>
void
];
client
=
new
Promise
<
LanguageClient
>
((
clientOK
,
clientErr
)
=>
{
setClient
=
[
clientOK
,
clientErr
];
});
const
a
:
Promise
<
void
>
|
null
=
maintenance
;
commands
.
executeCommand
(
'
setContext
'
,
'
nbJavaLSReady
'
,
false
);
activationPending
=
true
;
// chain the restart after termination of the former process.
if
(
a
!=
null
)
{
handleLog
(
log
,
"
Server activation initiated while in maintenance mode, scheduling after maintenance
"
);
a
.
then
(()
=>
killNbProcess
(
notifyKill
,
log
)).
then
(()
=>
doActivateWithJDK
(
specifiedJDK
,
context
,
log
,
notifyKill
,
setClient
));
a
.
then
(()
=>
stopClient
(
oldClient
)).
then
(()
=>
killNbProcess
(
notifyKill
,
log
)).
then
(()
=>
{
doActivateWithJDK
(
specifiedJDK
,
context
,
log
,
notifyKill
,
setClient
);
});
}
else
{
handleLog
(
log
,
"
Initiating server activation
"
);
killNbProcess
(
notifyKill
,
log
).
then
(
()
=>
doActivateWithJDK
(
specifiedJDK
,
context
,
log
,
notifyKill
,
setClient
)
);
stopClient
(
oldClient
).
then
(()
=>
killNbProcess
(
notifyKill
,
log
)
)
.
then
(
()
=>
{
doActivateWithJDK
(
specifiedJDK
,
context
,
log
,
notifyKill
,
setClient
)
;
}
);
}
}
function
killNbProcess
(
notifyKill
:
boolean
,
log
:
vscode
.
OutputChannel
,
specProcess
?:
ChildProcess
)
:
Promise
<
void
>
{
const
p
=
nbProcess
;
handleLog
(
log
,
"
Request to kill LSP server.
"
);
...
...
@@ -345,6 +349,9 @@ function doActivateWithJDK(specifiedJDK: string | null, context: ExtensionContex
});
nbProcess
=
p
;
p
.
on
(
'
close
'
,
function
(
code
:
number
)
{
if
(
p
==
nbProcess
)
{
nbProcess
=
null
;
}
if
(
p
==
nbProcess
&&
code
!=
0
&&
code
)
{
vscode
.
window
.
showWarningMessage
(
"
Apache NetBeans Language Server exited with
"
+
code
);
}
...
...
@@ -449,7 +456,6 @@ function doActivateWithJDK(specifiedJDK: string | null, context: ExtensionContex
handleLog
(
log
,
'
Language Client: Starting
'
);
c
.
start
();
c
.
onReady
().
then
(()
=>
{
commands
.
executeCommand
(
'
setContext
'
,
'
nbJavaLSReady
'
,
true
);
c
.
onNotification
(
StatusMessageRequest
.
type
,
showStatusBarMessage
);
c
.
onNotification
(
LogMessageNotification
.
type
,
(
param
)
=>
handleLog
(
log
,
param
.
message
));
c
.
onRequest
(
QuickPickRequest
.
type
,
async
param
=>
{
...
...
@@ -461,6 +467,7 @@ function doActivateWithJDK(specifiedJDK: string | null, context: ExtensionContex
});
handleLog
(
log
,
'
Language Client: Ready
'
);
setClient
[
0
](
c
);
commands
.
executeCommand
(
'
setContext
'
,
'
nbJavaLSReady
'
,
true
);
}).
catch
(
setClient
[
1
]);
}).
catch
((
reason
)
=>
{
activationPending
=
false
;
...
...
@@ -534,11 +541,15 @@ function doActivateWithJDK(specifiedJDK: string | null, context: ExtensionContex
}
}
function
stopClient
(
clinetPromise
:
Promise
<
LanguageClient
>
):
Thenable
<
void
>
{
return
clinetPromise
?
clinetPromise
.
then
(
c
=>
c
.
stop
())
:
Promise
.
resolve
();
}
export
function
deactivate
():
Thenable
<
void
>
{
if
(
nbProcess
!=
null
)
{
nbProcess
.
kill
();
}
return
client
.
then
(
c
=>
c
.
stop
()
);
return
stopClient
(
client
);
}
class
NetBeansDebugAdapterDescriptionFactory
implements
vscode
.
DebugAdapterDescriptorFactory
{
...
...
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