Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
soicode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Timon Stampfli
soicode
Commits
13005750
Commit
13005750
authored
Oct 11, 2019
by
Timon Stampfli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show sample on hover over sample in sampleview
parent
103a282a
Pipeline
#5698
passed with stages
in 1 minute
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
3 deletions
+38
-3
src/samplesTreeView.ts
src/samplesTreeView.ts
+38
-3
No files found.
src/samplesTreeView.ts
View file @
13005750
...
...
@@ -2,6 +2,7 @@ import * as vscode from "vscode";
import
{
Store
}
from
"
./store
"
;
import
*
as
path
from
"
path
"
;
import
{
toSortedKeys
}
from
"
./util
"
;
import
{
EOL
}
from
"
os
"
;
export
class
SamplesTreeViewProvider
implements
vscode
.
TreeDataProvider
<
string
>
{
...
...
@@ -24,13 +25,47 @@ export class SamplesTreeViewProvider
sample
,
vscode
.
TreeItemCollapsibleState
.
None
);
let
sampleData
=
this
.
store
.
samples
.
get
(
sample
);
if
(
sampleData
===
undefined
)
{
vscode
.
window
.
showErrorMessage
(
"
Internal error when showing the sample tree
"
);
throw
new
Error
(
"
Internal error when showing the sample tree
"
);
}
let
input
=
""
;
let
output
=
""
;
sampleData
.
data
.
forEach
(
entry
=>
{
if
(
entry
.
key
===
"
input
"
)
{
input
=
entry
.
value
;
}
if
(
entry
.
key
===
"
output
"
)
{
output
=
entry
.
value
;
}
});
let
inplines
=
input
.
split
(
EOL
);
let
outlines
=
output
.
split
(
EOL
);
let
tooltip
=
"
*Input*:
\n
"
+
(
inplines
.
length
<
12
?
input
:
inplines
.
slice
(
0
,
12
).
join
(
"
\n
"
)
+
`
\n...
${
inplines
.
length
-
12
}
more lines
`
)
+
"
*Output*:
\n
"
+
(
outlines
.
length
<
12
?
output
:
outlines
.
slice
(
0
,
12
).
join
(
"
\n
"
)
+
`
\n...
${
outlines
.
length
-
12
}
more lines
`
);
item
.
contextValue
=
"
sample
"
;
item
.
command
=
{
command
:
"
soicode.openSample
"
,
title
:
"
Open Sample
"
,
arguments
:
[
sample
]
,
tooltip
:
"
Open Sample
"
};
// todo register as command
arguments
:
[
sample
]
};
item
.
tooltip
=
tooltip
;
// switch(this.state.samples.get){
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment