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
ce94d747
Commit
ce94d747
authored
4 years ago
by
Sytze de Witte
Browse files
Options
Downloads
Patches
Plain Diff
added clear view button and undo button
parent
e6660a94
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
package.json
+13
-2
13 additions, 2 deletions
package.json
src/extension.ts
+20
-4
20 additions, 4 deletions
src/extension.ts
with
33 additions
and
6 deletions
package.json
+
13
−
2
View file @
ce94d747
...
...
@@ -66,6 +66,10 @@
"command"
:
"analysisResults.openInCompView"
,
"title"
:
"Show results in comparison view"
},
{
"command"
:
"analysisResults.clear"
,
"title"
:
"Clear view"
},
{
"command"
:
"analysisResultsCompView.load"
,
"title"
:
"Open analysis results"
...
...
@@ -97,10 +101,16 @@
},
{
"command"
:
"analysisResults.openFileInEditor"
,
"when"
:
"view == analysisResults"
"when"
:
"view == analysisResults"
,
"group"
:
"show"
},
{
"command"
:
"analysisResults.openInCompView"
,
"when"
:
"view == analysisResults"
,
"group"
:
"show"
},
{
"command"
:
"analysisResults.clear"
,
"when"
:
"view == analysisResults"
},
{
...
...
@@ -115,7 +125,8 @@
},
{
"command"
:
"analysisResultsCompView.openFileInEditor"
,
"when"
:
"view == analysisResultsCompView"
"when"
:
"view == analysisResultsCompView"
,
"group"
:
"show"
},
{
"command"
:
"analysisResultsCompView.clearCompView"
,
...
...
This diff is collapsed.
Click to expand it.
src/extension.ts
+
20
−
4
View file @
ce94d747
...
...
@@ -223,13 +223,17 @@ export function activate(context: ExtensionContext) {
);
vscode
.
commands
.
registerCommand
(
"
analysisResults.
openInCompView
"
,
()
=>
analysisResultsCompProvider
.
setJsonObject
(
analysisResultsProvider
.
getJsonObject
()
)
"
analysisResults.
clear
"
,
()
=>
clearView
(
analysisResultsProvider
)
);
vscode
.
commands
.
registerCommand
(
"
analysisResultsCompView.clearCompView
"
,
()
=>
analysisResultsCompProvider
.
setJsonObject
(
null
)
()
=>
clearView
(
analysisResultsCompProvider
)
);
vscode
.
commands
.
registerCommand
(
"
analysisResults.openInCompView
"
,
()
=>
analysisResultsCompProvider
.
setJsonObject
(
analysisResultsProvider
.
getJsonObject
())
);
//#endregion
}
...
...
@@ -389,6 +393,18 @@ function openFileInEditor(prov: AnalysisResultsProvider) {
}
}
async
function
clearView
(
prov
:
AnalysisResultsProvider
)
{
if
(
prov
.
getJsonObject
())
{
const
jsonObject
=
prov
.
getJsonObject
();
prov
.
setJsonObject
(
null
);
var
choice
=
await
vscode
.
window
.
showInformationMessage
(
"
Analysis results view has been cleared.
"
,
"
Undo
"
);
if
(
choice
===
"
Undo
"
)
{
prov
.
setJsonObject
(
jsonObject
);
}
}
}
function
pathExists
(
p
:
string
):
boolean
{
try
{
fs
.
accessSync
(
p
);
...
...
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