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
c16ded3a
Commit
c16ded3a
authored
3 years ago
by
Sytze de Witte
Browse files
Options
Downloads
Patches
Plain Diff
save as text implemented + minor bugfix regex
parent
835fd93c
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/analysisResults.ts
+1
-1
1 addition, 1 deletion
src/analysisResults.ts
src/extension.ts
+9
-6
9 additions, 6 deletions
src/extension.ts
src/sidebar.ts
+1
-1
1 addition, 1 deletion
src/sidebar.ts
src/utils.ts
+3
-2
3 additions, 2 deletions
src/utils.ts
with
14 additions
and
10 deletions
src/analysisResults.ts
+
1
−
1
View file @
c16ded3a
...
...
@@ -272,7 +272,7 @@ export class Result extends vscode.TreeItem {
// Icons for other types of model formats (e.g. JANI) can be added here...
}
const
plottableRegex
=
/
\((\d
+
\.?\d
*
[
e|E
]?\d
*
)
,
\s
*
(\d
+
\.?\d
*
[
e|E
]?\d
*
)\)
/gm
;
// (num, num), num in the form of 1, 2.3, 4e5, 4.5e6
const
plottableRegex
=
/
\((
-
?
\d
+
\.?\d
*
[
e|E
]?
-
?
\d
*
)
,
\s
*
(
-
?
\d
+
\.?\d
*
[
e|E
]?
-
?
\d
*
)\)
/gm
;
// (num, num), num in the form of
-
1, 2.3, 4e5, 4.5e6
if
(
value
.
match
(
plottableRegex
))
{
this
.
isPlottable
=
true
;
}
...
...
This diff is collapsed.
Click to expand it.
src/extension.ts
+
9
−
6
View file @
c16ded3a
...
...
@@ -292,7 +292,7 @@ export function activate(context: ExtensionContext) {
context
.
subscriptions
.
push
(
vscode
.
commands
.
registerCommand
(
"
analysisResults.openInCompView
"
,
()
=>
analysisResultsCompProvider
.
setJsonObject
(
analysisResultsProvider
.
getJsonObject
())
()
=>
analysisResultsCompProvider
.
setJsonObject
(
analysisResultsProvider
.
getJsonObject
()
,
analysisResultsProvider
.
getTextOutput
()
)
));
context
.
subscriptions
.
push
(
vscode
.
commands
.
registerCommand
(
...
...
@@ -355,10 +355,12 @@ function saveAsText(prov: AnalysisResultsProvider) {
:
undefined
;
vscode
.
window
.
showSaveDialog
({
defaultUri
:
defaultUri
}).
then
(
f
=>
{
if
(
f
)
{
fs
.
writeFileSync
(
f
.
fsPath
,
JSON
.
stringify
(
prov
.
getJsonObjec
t
())
)
;
fs
.
writeFileSync
(
f
.
fsPath
,
prov
.
getTextOutpu
t
());
}
});
}
}
else
{
vscode
.
window
.
showErrorMessage
(
"
No text version available.
"
);
}
}
function
openInEditor
(
prov
:
AnalysisResultsProvider
,
res
:
Result
)
{
...
...
@@ -476,12 +478,13 @@ function openFileInEditor(prov: AnalysisResultsProvider) {
async
function
clearView
(
prov
:
AnalysisResultsProvider
)
{
if
(
prov
.
getJsonObject
())
{
const
undo
=
prov
.
getJsonObject
();
const
jsonObject
=
prov
.
getJsonObject
();
const
textOutput
=
prov
.
getTextOutput
();
prov
.
setJsonObject
(
null
);
var
choice
=
await
vscode
.
window
.
showInformationMessage
(
"
Analysis results view has been cleared.
"
,
"
Undo
"
);
if
(
choice
===
"
Undo
"
)
{
prov
.
setJsonObject
(
undo
);
prov
.
setJsonObject
(
jsonObject
,
textOutput
);
}
}
}
...
...
@@ -523,7 +526,7 @@ function plotValue(res: Result, context: ExtensionContext) {
var
dataPoints
:
{
x
:
number
,
y
:
number
}[]
=
[];
const
value
=
res
.
getValue
();
const
regex
=
/
\((\d
+
\.?\d
*
[
e|E
]?\d
*
)
,
\s
*
(\d
+
\.?\d
*
[
e|E
]?\d
*
)\)
/gm
;
// (num, num), num in the form of 1, 2.3, 4e5, 4.5e6
const
regex
=
/
\((
-
?
\d
+
\.?\d
*
[
e|E
]?
-
?
\d
*
)
,
\s
*
(
-
?
\d
+
\.?\d
*
[
e|E
]?
-
?
\d
*
)\)
/gm
;
// (num, num), num in the form of
-
1, 2.3, 4e5, 4.5e6
let
matches
=
(
value
.
match
(
regex
)
||
[]).
map
(
e
=>
[
e
.
replace
(
regex
,
'
$1
'
),
e
.
replace
(
regex
,
'
$2
'
)]);
matches
.
forEach
((
element
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/sidebar.ts
+
1
−
1
View file @
c16ded3a
...
...
@@ -129,7 +129,7 @@ function runTool(uri: string, toolName: string, constants: { name: string; value
if
(
data
.
runToken
===
jsonObject
.
runToken
)
{
if
(
data
.
data
&&
data
.
data
!==
""
)
{
try
{
analysisResultsProvider
.
setJsonObject
(
JSON
.
parse
(
data
.
data
.
trim
()),
"
No text version available.
"
);
// TODO: text version
analysisResultsProvider
.
setJsonObject
(
JSON
.
parse
(
data
.
data
.
trim
()),
data
.
text
);
const
treeRoot
=
analysisResultsProvider
.
getTreeRoot
();
treeView
.
reveal
(
treeRoot
,
{
focus
:
false
,
select
:
false
,
expand
:
true
});
}
catch
(
error
)
{
...
...
This diff is collapsed.
Click to expand it.
src/utils.ts
+
3
−
2
View file @
c16ded3a
...
...
@@ -25,7 +25,8 @@ export interface ProgressIndication {
export
interface
ResultNotification
{
runToken
:
string
,
data
:
string
data
:
string
,
text
:
string
}
//#endregion
...
...
@@ -42,4 +43,4 @@ export function getNonce() {
}
return
text
;
}
//#endregion
\ No newline at end of file
//#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