Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IDE-Plugin
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DP-Group 14
IDE-Plugin
Commits
d485c29e
Commit
d485c29e
authored
3 years ago
by
Smit, P.J.M. (Peter, Student M-CS)
Browse files
Options
Downloads
Patches
Plain Diff
renamed runTool and progressToken to run and runToken
parent
eb08c59c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/commands.ts
+7
-6
7 additions, 6 deletions
src/commands.ts
src/extension.ts
+1
-1
1 addition, 1 deletion
src/extension.ts
src/sidebar.ts
+4
-4
4 additions, 4 deletions
src/sidebar.ts
src/utils.ts
+1
-1
1 addition, 1 deletion
src/utils.ts
with
13 additions
and
12 deletions
src/commands.ts
+
7
−
6
View file @
d485c29e
...
...
@@ -233,13 +233,13 @@ export namespace ModestCommands {
toolName
:
"
mosta (export-to-dot)
"
,
constants
:
[],
parameters
:
parameters
,
progressToken
:
runToken
runToken
:
"
dot
"
+
runToken
};
vscode
.
window
.
withProgress
({
location
:
vscode
.
ProgressLocation
.
Window
,
title
:
`Loading new dot for
${
this
.
fileUri
.
path
.
split
(
"
/
"
).
pop
()}
`
},
async
(
progress
,
token
)
=>
{
await
new
Promise
<
null
>
(
async
(
resolveProgress
,
_
)
=>
{
try
{
let
resultHandler
=
(
data
:
ResultNotification
)
=>
{
if
(
data
.
progress
Token
===
jsonObject
.
progress
Token
)
{
if
(
data
.
run
Token
===
jsonObject
.
run
Token
)
{
if
(
data
.
data
&&
data
.
data
!==
""
)
{
try
{
this
.
lastDotString
=
data
.
data
;
...
...
@@ -270,15 +270,16 @@ export namespace ModestCommands {
private
dotToSvg
(
runToken
:
string
,
resolveProgress
:
(
value
:
any
|
PromiseLike
<
any
>
)
=>
void
)
{
let
jsonObject
=
{
dot
:
this
.
lastDotString
,
runToken
:
runToken
runToken
:
"
svg
"
+
runToken
};
client
?.
sendRequest
(
"
modest/cancelRunTool
"
,
{
progressToken
:
this
.
lastRunToken
});
if
(
this
.
lastRunToken
)
{
client
?.
sendRequest
(
"
modest/cancelRun
"
,
{
runToken
:
this
.
lastRunToken
});
}
this
.
lastRunToken
=
runToken
;
let
resultHandler
=
(
data
:
ResultNotification
)
=>
{
if
(
data
.
progress
Token
===
runToken
)
{
if
(
data
.
run
Token
===
jsonObject
.
runToken
)
{
if
(
data
.
data
&&
data
.
data
!==
""
)
{
try
{
this
.
lastSvgString
=
data
.
data
;
...
...
This diff is collapsed.
Click to expand it.
src/extension.ts
+
1
−
1
View file @
d485c29e
...
...
@@ -129,7 +129,7 @@ function createClient(): LanguageClient | undefined {
client
.
onReady
().
then
(()
=>
{
initializeTools
();
clientReady
=
true
;
client
.
onNotification
(
new
NotificationType
<
ResultNotification
>
(
"
modest/
toolR
esult
"
),
result
=>
{
client
.
onNotification
(
new
NotificationType
<
ResultNotification
>
(
"
modest/
r
esult
"
),
result
=>
{
resultHandlers
.
forEach
(
handler
=>
{
handler
(
result
);
});
...
...
This diff is collapsed.
Click to expand it.
src/sidebar.ts
+
4
−
4
View file @
d485c29e
...
...
@@ -109,7 +109,7 @@ function runTool(uri: string, toolName: string, constants: { name: string; value
toolName
:
toolName
,
constants
:
constants
,
parameters
:
serverParameters
,
progress
Token
:
uri
+
toolName
+
JSON
.
stringify
(
constants
)
+
JSON
.
stringify
(
serverParameters
)
+
Date
.
now
()
run
Token
:
uri
+
toolName
+
JSON
.
stringify
(
constants
)
+
JSON
.
stringify
(
serverParameters
)
+
Date
.
now
()
};
vscode
.
window
.
activeTextEditor
?.
document
.
save
();
...
...
@@ -121,12 +121,12 @@ function runTool(uri: string, toolName: string, constants: { name: string; value
return
;
}
try
{
let
progressHandler
=
client
?.
onProgress
(
new
ProgressType
<
ProgressIndication
>
(),
jsonObject
.
progress
Token
,
indication
=>
{
let
progressHandler
=
client
?.
onProgress
(
new
ProgressType
<
ProgressIndication
>
(),
jsonObject
.
run
Token
,
indication
=>
{
progress
.
report
({
message
:
indication
.
message
,
increment
:
indication
.
progress
*
100
});
});
if
(
progressHandler
)
{
disposalQueue
.
push
(
progressHandler
);
}
let
resultHandler
=
(
data
:
ResultNotification
)
=>
{
if
(
data
.
progress
Token
===
jsonObject
.
progress
Token
)
{
if
(
data
.
run
Token
===
jsonObject
.
run
Token
)
{
if
(
data
.
data
&&
data
.
data
!==
""
)
{
try
{
analysisResultsProvider
.
setJsonObject
(
JSON
.
parse
(
data
.
data
.
trim
()));
...
...
@@ -160,7 +160,7 @@ function runTool(uri: string, toolName: string, constants: { name: string; value
}
});
token
.
onCancellationRequested
(
_
=>
{
client
?.
sendRequest
(
"
modest/cancelRun
Tool
"
,
{
progress
Token
:
jsonObject
.
progress
Token
});
client
?.
sendRequest
(
"
modest/cancelRun
"
,
{
run
Token
:
jsonObject
.
run
Token
});
},
null
,
disposalQueue
);
await
client
?.
sendRequest
<
string
>
(
"
modest/runTool
"
,
jsonObject
);
}
catch
(
e
)
{
...
...
This diff is collapsed.
Click to expand it.
src/utils.ts
+
1
−
1
View file @
d485c29e
...
...
@@ -24,7 +24,7 @@ export interface ProgressIndication {
}
export
interface
ResultNotification
{
progress
Token
:
string
,
run
Token
:
string
,
data
:
string
}
//#endregion
...
...
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