Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Timon Stampfli
soicode
Commits
66e33403
Commit
66e33403
authored
Nov 05, 2020
by
Timon Stampfli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allowing to disable compiler timeout
parent
54809dcf
Pipeline
#5681
passed with stages
in 59 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
6 deletions
+36
-6
package.json
package.json
+4
-0
src/extension.ts
src/extension.ts
+19
-0
src/runner.ts
src/runner.ts
+11
-6
src/store.ts
src/store.ts
+2
-0
No files found.
package.json
View file @
66e33403
...
...
@@ -110,6 +110,10 @@
{
"command"
:
"soicode.createSolutionForSoitask"
,
"title"
:
"Create a new cpp solution file for the currently open soitask"
},
{
"command"
:
"soicode.toggleCompilerTimeout"
,
"title"
:
"Enables/Disables compiler timeout of 10 sec"
}
],
"properties"
:
{},
...
...
src/extension.ts
View file @
66e33403
...
...
@@ -104,6 +104,12 @@ export async function activate(context: vscode.ExtensionContext) {
);
context
.
subscriptions
.
push
(
createSolutionForSoitaskCommand
);
let
toggleDisableCompilerTimeoutCommand
=
vscode
.
commands
.
registerCommand
(
"
soicode.toggleCompilerTimeout
"
,
toggleDisableCompilerTimeout
.
bind
(
undefined
,
store
)
);
context
.
subscriptions
.
push
(
toggleDisableCompilerTimeoutCommand
);
let
taskTreeViewProvider
=
new
TaskTreeViewProvider
(
store
);
let
samplesTreeViewProvider
=
new
SamplesTreeViewProvider
(
store
);
...
...
@@ -134,6 +140,19 @@ async function debugSolutionOnSample() {
);
}
async
function
toggleDisableCompilerTimeout
(
store
:
Store
)
{
store
.
disableCompilerTimeout
=
!
store
.
disableCompilerTimeout
;
if
(
store
.
disableCompilerTimeout
)
{
await
vscode
.
window
.
showInformationMessage
(
"
Compilation timeout is now disabled
"
);
}
else
{
await
vscode
.
window
.
showInformationMessage
(
"
Compilation timeout is now enabled
"
);
}
}
// async function updateIsSOITaskContext() {
// let result = await vscode.workspace.findFiles(".soitask");
// console.log(".soitask files: ", result);
...
...
src/runner.ts
View file @
66e33403
...
...
@@ -58,8 +58,11 @@ export class Runner {
let
finished
:
vscode
.
Disposable
[]
=
[];
let
finishedTimeout
:
vscode
.
Disposable
[]
=
[];
let
timer
=
new
Timer
(
10000
);
finished
.
push
(
timer
);
let
timer
:
Timer
|
undefined
;
if
(
this
.
store
.
disableCompilerTimeout
)
{
timer
=
new
Timer
(
10000
);
finished
.
push
(
timer
);
}
const
cleanup
=
(
abort
?:
boolean
)
=>
{
for
(
let
d
of
finished
)
{
d
.
dispose
();
...
...
@@ -205,10 +208,12 @@ export class Runner {
})
);
await
timer
.
timer
;
this
.
store
.
logError
(
"
compilation
"
,
`timed out compilation`
);
cleanup
(
true
);
resolve
(
"
Failed
"
);
if
(
timer
!==
undefined
)
{
await
timer
.
timer
;
this
.
store
.
logError
(
"
compilation
"
,
`timed out compilation`
);
cleanup
(
true
);
resolve
(
"
Failed
"
);
}
});
}
...
...
src/store.ts
View file @
66e33403
...
...
@@ -27,6 +27,7 @@ export class Store {
allSampleChangeSubscribers
:
(()
=>
void
)[];
sampleUpdateSubscriber
:
((
s
:
string
)
=>
void
)[];
private
channel
:
vscode
.
OutputChannel
;
disableCompilerTimeout
:
boolean
;
constructor
(
context
:
vscode
.
ExtensionContext
)
{
this
.
channel
=
vscode
.
window
.
createOutputChannel
(
"
soicode
"
);
...
...
@@ -40,6 +41,7 @@ export class Store {
this
.
fileChangeSubscribers
=
[];
this
.
allSampleChangeSubscribers
=
[];
this
.
sampleUpdateSubscriber
=
[];
this
.
disableCompilerTimeout
=
false
;
this
.
subscribeStoreToEvents
(
context
);
}
...
...
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