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
baf594c0
Commit
baf594c0
authored
Nov 02, 2020
by
Timon Stampfli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'provide-some-debug-information' into 'master'
providing a debug log for compilation See merge request
!12
parents
4202b0df
41f9a4b1
Pipeline
#5662
passed with stages
in 1 minute
Changes
5
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
14 deletions
+85
-14
package-lock.json
package-lock.json
+3
-3
package.json
package.json
+1
-1
src/helperBinaryResultReceiver.ts
src/helperBinaryResultReceiver.ts
+6
-5
src/runner.ts
src/runner.ts
+31
-5
src/store.ts
src/store.ts
+44
-0
No files found.
package-lock.json
View file @
baf594c0
...
...
@@ -5389,9 +5389,9 @@
"dev"
:
true
},
"typescript"
:
{
"version"
:
"
3.6.3
"
,
"resolved"
:
"https://registry.npmjs.org/typescript/-/typescript-
3.6.3
.tgz"
,
"integrity"
:
"sha512-
N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw
=="
,
"version"
:
"
4.0.5
"
,
"resolved"
:
"https://registry.npmjs.org/typescript/-/typescript-
4.0.5
.tgz"
,
"integrity"
:
"sha512-
ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ
=="
,
"dev"
:
true
},
"uc.micro"
:
{
...
...
package.json
View file @
baf594c0
...
...
@@ -277,7 +277,7 @@
"
mocha
"
:
"
^6.1.4
"
,
"
ts-loader
"
:
"
^6.2.0
"
,
"
tslint
"
:
"
^5.12.1
"
,
"
typescript
"
:
"
^
3.3.1
"
,
"
typescript
"
:
"
^
4.0.5
"
,
"
vsce
"
:
"
^1.67.1
"
,
"
vscode-test
"
:
"
^1.2.0
"
,
"
webpack
"
:
"
^4.41.0
"
,
...
...
src/helperBinaryResultReceiver.ts
View file @
baf594c0
...
...
@@ -76,13 +76,14 @@ export class HelperBinaryResultReceiver {
processResult
(
this
:
HelperBinaryResultReceiver
,
res
:
string
)
{
let
parsed
=
checkServerResponseTyped
(
JSON
.
parse
(
res
));
if
(
parsed
===
null
)
{
throw
Error
(
"
invalid package received
"
);
this
.
store
.
handleError
(
"
Downloading dependencies
"
,
"
Downloaded a invalid compiler bundle
"
,
Error
(
"
invalid package received
"
)
);
}
let
[
binarypath
,
samplename
,
result
]
=
parsed
;
let
taskname
=
fspathToTasknameOrError
(
this
.
store
,
binarypath
);
let
taskname
=
fspathToTasknameOrError
(
this
.
store
,
binarypath
);
this
.
store
.
addExecutionResult
(
taskname
,
samplename
,
result
);
}
}
src/runner.ts
View file @
baf594c0
...
...
@@ -38,11 +38,16 @@ export class Runner {
try
{
await
fs
.
readFile
(
compilerPath
);
}
catch
{
}
catch
(
err
)
{
vscode
.
window
.
showErrorMessage
(
"
Compiler executable not found at expected path
"
);
return
;
this
.
store
.
logError
(
"
compilation
"
,
`
file at compilerpath '
${
compilerPath
}
' not found
`
,
err
);
resolve
(
"
Failed
"
);
}
let
compileTaskDefinition
=
{
label
:
"
build
"
+
taskname
+
"
development
"
,
...
...
@@ -76,8 +81,18 @@ export class Runner {
try
{
await
fs
.
unlink
(
soitaskFiles
.
binaryFsPath
);
}
catch
(
err
)
{
if
(
err
.
code
!==
"
ENOENT
"
)
{
throw
err
;
if
(
err
.
code
===
"
ENOENT
"
)
{
this
.
store
.
logInfo
(
"
compilation
"
,
`
compiled binary '
${
compilerPath
}
' not found
`
,
err
);
}
else
{
this
.
store
.
handleError
(
"
compilation
"
,
`
deleting binary '
${
soitaskFiles
.
binaryFsPath
}
' failed
`
,
err
);
}
}
...
...
@@ -92,6 +107,7 @@ export class Runner {
try
{
await
vscode
.
tasks
.
executeTask
(
compileTask
);
}
catch
(
err
)
{
this
.
store
.
logError
(
"
compilation
"
,
"
executing task failed
"
,
err
);
resolve
(
"
Failed
"
);
}
...
...
@@ -102,6 +118,11 @@ export class Runner {
resolve
(
"
Success
"
);
});
}
catch
(
err
)
{
this
.
store
.
logError
(
"
compilation
"
,
`
reading binary '
${
soitaskFiles
.
binaryFsPath
}
" failed
`
,
err
);
if
(
err
.
code
!==
"
EEXIST
"
)
{
resolve
(
"
Failed
"
);
}
...
...
@@ -110,6 +131,7 @@ export class Runner {
});
setTimeout
(()
=>
{
this
.
store
.
logError
(
"
compilation
"
,
`
timed out compilation
`
);
resolve
(
"
Failed
"
);
},
10000
);
});
...
...
@@ -292,12 +314,16 @@ export class Runner {
vscode
.
window
.
showErrorMessage
(
"
Unknown error occured when checking binary:
"
+
err
.
toString
()
);
throw
err
;
}
else
{
vscode
.
window
.
showErrorMessage
(
"
The binary to debug does not exist
"
+
err
.
toString
()
);
}
this
.
store
.
handleError
(
"
debug
"
,
`
binary path '
${
soitaskFiles
.
binaryFsPath
}
'does not exist
`
,
err
);
}
let
workspaceFolder
=
vscode
.
workspace
.
getWorkspaceFolder
(
vscode
.
Uri
.
file
(
soitaskFiles
.
binaryFsPath
)
...
...
src/store.ts
View file @
baf594c0
...
...
@@ -26,8 +26,11 @@ export class Store {
fileChangeSubscribers
:
(()
=>
void
)[];
allSampleChangeSubscribers
:
(()
=>
void
)[];
sampleUpdateSubscriber
:
((
s
:
string
)
=>
void
)[];
private
channel
:
vscode
.
OutputChannel
;
constructor
(
context
:
vscode
.
ExtensionContext
)
{
this
.
channel
=
vscode
.
window
.
createOutputChannel
(
"
soicode
"
);
context
.
subscriptions
.
push
(
this
.
channel
);
this
.
soicodeExtensionDataPath
=
context
.
globalStoragePath
;
this
.
soicodeExtensionImagePath
=
context
.
asAbsolutePath
(
"
images
"
);
this
.
soicodeExtensionDistPath
=
context
.
asAbsolutePath
(
"
dist
"
);
...
...
@@ -40,6 +43,47 @@ export class Store {
this
.
subscribeStoreToEvents
(
context
);
}
handleError
(
this
:
Store
,
location
:
string
,
info
:
string
,
err
:
Error
):
never
{
this
.
channel
.
appendLine
(
`
#### Error
${
location
}
####
`
);
this
.
channel
.
appendLine
(
info
);
this
.
channel
.
appendLine
(
"
error name:
"
);
this
.
channel
.
appendLine
(
err
.
name
);
this
.
channel
.
appendLine
(
"
message:
"
);
this
.
channel
.
appendLine
(
err
.
message
);
if
(
err
.
stack
!==
undefined
)
{
this
.
channel
.
appendLine
(
"
stack trace
"
);
this
.
channel
.
appendLine
(
err
.
stack
);
}
this
.
channel
.
show
();
throw
err
;
}
logInfo
(
this
:
Store
,
location
:
string
,
info
:
string
,
err
?:
Error
)
{
this
.
channel
.
appendLine
(
`
#### info at [
${
location
}
] ####
`
);
this
.
channel
.
appendLine
(
info
);
if
(
err
!==
undefined
)
{
this
.
channel
.
appendLine
(
err
.
name
);
this
.
channel
.
appendLine
(
"
message:
"
);
this
.
channel
.
appendLine
(
err
.
message
);
if
(
err
.
stack
!==
undefined
)
{
this
.
channel
.
appendLine
(
"
stack trace
"
);
this
.
channel
.
appendLine
(
err
.
stack
);
}
}
}
logError
(
this
:
Store
,
location
:
string
,
info
:
string
,
err
?:
Error
)
{
this
.
channel
.
appendLine
(
`
#### error at [
${
location
}
] ####
`
);
this
.
channel
.
appendLine
(
info
);
if
(
err
!==
undefined
)
{
this
.
channel
.
appendLine
(
err
.
name
);
this
.
channel
.
appendLine
(
"
message:
"
);
this
.
channel
.
appendLine
(
err
.
message
);
if
(
err
.
stack
!==
undefined
)
{
this
.
channel
.
appendLine
(
"
stack trace
"
);
this
.
channel
.
appendLine
(
err
.
stack
);
}
}
}
addExecutionResult
(
this
:
Store
,
taskname
:
string
,
...
...
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