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
e41dc5f5
Commit
e41dc5f5
authored
Oct 12, 2019
by
Timon Gehr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error messages.
parent
7d0771f1
Pipeline
#4945
passed with stages
in 42 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
30 deletions
+30
-30
src/extension.ts
src/extension.ts
+1
-1
src/runner.ts
src/runner.ts
+6
-6
src/sample.ts
src/sample.ts
+6
-6
src/soitask.ts
src/soitask.ts
+7
-7
src/soiworkspace.ts
src/soiworkspace.ts
+4
-4
src/storeHelper.ts
src/storeHelper.ts
+6
-6
No files found.
src/extension.ts
View file @
e41dc5f5
...
...
@@ -163,7 +163,7 @@ export function deactivate() {}
// }
// let errorMessageClicked = new Promise(async resolve => {
// let answer = await vscode.window.showErrorMessage(
// "Please
C
hoose a name for the new task consisting of alphanumeric symbols",
// "Please
c
hoose a name for the new task consisting of alphanumeric symbols",
// "Ok",
// "Cancel"
// );
...
...
src/runner.ts
View file @
e41dc5f5
...
...
@@ -40,7 +40,7 @@ export class Runner {
await
fs
.
readFile
(
compilerPath
);
}
catch
{
vscode
.
window
.
showErrorMessage
(
"
Compiler executable
could not be found at it's
expected path
"
"
Compiler executable
not found at
expected path
"
);
return
;
}
...
...
@@ -146,7 +146,7 @@ export class Runner {
await
fs
.
readFile
(
helperPath
);
}
catch
{
vscode
.
window
.
showErrorMessage
(
"
Helper binary
could not be found at it's
expected path
"
"
Helper binary
not found at
expected path
"
);
return
;
}
...
...
@@ -249,20 +249,20 @@ export class Runner {
let
debuggerFlavor
=
getDebuggerFlavor
(
this
.
store
);
if
(
debuggerPath
===
null
)
{
vscode
.
window
.
showErrorMessage
(
"
Debuggerpath could not be determined
"
);
vscode
.
window
.
showErrorMessage
(
"
Debugger
path could not be determined
"
);
return
"
Failed
"
;
}
try
{
await
fs
.
readFile
(
debuggerPath
);
}
catch
{
vscode
.
window
.
showErrorMessage
(
"
Debugger executable
could not be found at it's
expected path
"
"
Debugger executable
not found at
expected path
"
);
return
"
Failed
"
;
}
if
(
debuggerFlavor
===
null
)
{
vscode
.
window
.
showErrorMessage
(
"
Could
n't determine th
e type of debugger
"
);
vscode
.
window
.
showErrorMessage
(
"
Could
not determin
e type of debugger
"
);
return
"
Failed
"
;
}
...
...
@@ -295,7 +295,7 @@ export class Runner {
throw
err
;
}
else
{
vscode
.
window
.
showErrorMessage
(
"
The binary
you try to debug doesn'
t exist
"
+
err
.
toString
()
"
The binary
to debug does no
t exist
"
+
err
.
toString
()
);
}
}
...
...
src/sample.ts
View file @
e41dc5f5
...
...
@@ -64,17 +64,17 @@ export async function listSamplesForTaskname(
try
{
content
=
(
await
fs
.
readFile
(
path
)).
toString
();
}
catch
(
err
)
{
vscode
.
window
.
showErrorMessage
(
"
C
ouldn'
t read soitask file
"
);
throw
new
Error
(
"
C
ouldn'
t read soitask file
"
);
vscode
.
window
.
showErrorMessage
(
"
C
anno
t read soitask file
"
);
throw
new
Error
(
"
C
anno
t read soitask file
"
);
}
let
sampleList
=
determineSamples
(
content
);
if
(
sampleList
instanceof
StomlError
)
{
vscode
.
window
.
showErrorMessage
(
"
C
ouldn'
t parse soitask. It has the following error:
"
+
"
C
anno
t parse soitask. It has the following error:
"
+
sampleList
.
toString
()
);
throw
new
Error
(
"
C
ouldn'
t read soitask file
"
);
throw
new
Error
(
"
C
anno
t read soitask file
"
);
}
return
sampleList
;
}
...
...
@@ -112,8 +112,8 @@ export async function gotoSample(
sampleName
=
await
selectSample
(
store
,
taskname
,
sampleName
);
let
sample
=
store
.
samples
.
get
(
sampleName
);
if
(
sample
===
undefined
)
{
vscode
.
window
.
showErrorMessage
(
"
The selected sample does
n'
t exist
"
);
throw
new
Error
(
"
The selected sample does
n'
t exist
"
);
vscode
.
window
.
showErrorMessage
(
"
The selected sample does
no
t exist
"
);
throw
new
Error
(
"
The selected sample does
no
t exist
"
);
}
let
loc
=
new
vscode
.
Range
(
...
...
src/soitask.ts
View file @
e41dc5f5
...
...
@@ -92,8 +92,8 @@ export async function createCppFile(store: Store, taskname: string) {
preExistingTask
!==
undefined
&&
preExistingTask
.
solutionFsPath
!==
null
)
{
vscode
.
window
.
showErrorMessage
(
"
C++
F
ile already exists
"
);
throw
new
Error
(
"
C++
F
ile already exists
"
);
vscode
.
window
.
showErrorMessage
(
"
C++
f
ile already exists
"
);
throw
new
Error
(
"
C++
f
ile already exists
"
);
}
let
workspace
=
getWorkspaceOrShowError
(
store
).
workspaceDir
;
try
{
...
...
@@ -101,8 +101,8 @@ export async function createCppFile(store: Store, taskname: string) {
store
.
emitFsChange
();
}
catch
(
err
)
{
vscode
.
window
.
showErrorMessage
(
"
C
ouldn'
t create .cpp file
"
);
throw
new
Error
(
"
C
ouldn'
t create .cpp file
"
);
vscode
.
window
.
showErrorMessage
(
"
C
anno
t create .cpp file
"
);
throw
new
Error
(
"
C
anno
t create .cpp file
"
);
}
}
...
...
@@ -118,8 +118,8 @@ export async function createSoitaskFile(store: Store, taskname: string) {
await
fs
.
writeFile
(
path
.
join
(
workspace
,
taskname
+
"
.soitask
"
),
""
);
store
.
emitFsChange
();
}
catch
(
err
)
{
vscode
.
window
.
showErrorMessage
(
"
C
ouldn'
t create soitask file
"
);
throw
new
Error
(
"
C
ouldn't create soitask
file
"
);
vscode
.
window
.
showErrorMessage
(
"
C
anno
t create soitask file
"
);
throw
new
Error
(
"
C
annot create soitask
file
"
);
}
}
export
async
function
createTask
(
store
:
Store
)
{
...
...
@@ -131,7 +131,7 @@ export async function createTask(store: Store) {
return
;
}
if
(
taskname
.
length
===
0
)
{
vscode
.
window
.
showErrorMessage
(
"
A empty taskname doesn't work
"
);
vscode
.
window
.
showErrorMessage
(
"
Task name cannot be empty
"
);
await
createTask
(
store
);
return
;
}
...
...
src/soiworkspace.ts
View file @
e41dc5f5
...
...
@@ -66,7 +66,7 @@ async function determineWorkspaceSettingsFileContent(
}
if
(
workspaceSettings
.
length
===
0
)
{
let
answer
=
await
vscode
.
window
.
showErrorMessage
(
"
There needs to be a
initialized W
orkspace
"
,
"
There needs to be a
n initialized w
orkspace
"
,
"
Initialize now
"
,
"
Cancel
"
);
...
...
@@ -78,7 +78,7 @@ async function determineWorkspaceSettingsFileContent(
);
}
catch
(
err
)
{
vscode
.
window
.
showErrorMessage
(
"
Error initializing
W
orkspace:
"
+
err
.
toString
()
"
Error initializing
w
orkspace:
"
+
err
.
toString
()
);
return
null
;
}
...
...
@@ -92,7 +92,7 @@ async function determineWorkspaceSettingsFileContent(
)).
toString
();
}
catch
(
err
)
{
vscode
.
window
.
showErrorMessage
(
"
Error reading soi workspace settings file
"
+
err
.
toString
()
"
Cannot read soi workspace settings file:
"
+
err
.
toString
()
);
return
null
;
}
...
...
@@ -115,7 +115,7 @@ async function determineWorkspaceSettings(
);
}
catch
(
e
)
{
vscode
.
window
.
showErrorMessage
(
"
C
ouldn'
t parse workspace settings file:
"
+
e
.
toString
()
"
C
anno
t parse workspace settings file:
"
+
e
.
toString
()
);
return
null
;
}
...
...
src/storeHelper.ts
View file @
e41dc5f5
...
...
@@ -44,20 +44,20 @@ export function getSoitaskFilesOfFulltaskOrError(
let
workspace
=
getWorkspaceOrShowError
(
store
);
let
soitaskFiles
=
workspace
.
task
.
get
(
taskname
);
if
(
soitaskFiles
===
undefined
)
{
vscode
.
window
.
showErrorMessage
(
"
The task you are using does
n'
t exist
"
);
throw
new
Error
(
"
The task you are using does
n'
t exist
"
);
vscode
.
window
.
showErrorMessage
(
"
The task you are using does
no
t exist
"
);
throw
new
Error
(
"
The task you are using does
no
t exist
"
);
}
if
(
soitaskFiles
.
solutionFsPath
===
null
)
{
vscode
.
window
.
showErrorMessage
(
"
The task you are using does
n't have a solution
"
"
The task you are using does
not have a solution file
"
);
throw
new
Error
(
"
The task you are using does
n't have a solution
"
);
throw
new
Error
(
"
The task you are using does
not have a solution file
"
);
}
if
(
soitaskFiles
.
soitaskFsPath
===
null
)
{
vscode
.
window
.
showErrorMessage
(
"
The task you are using does
n'
t have a soitask
"
"
The task you are using does
no
t have a soitask
"
);
throw
new
Error
(
"
The task you are using does
n'
t have a soitask
"
);
throw
new
Error
(
"
The task you are using does
no
t have a soitask
"
);
}
return
soitaskFiles
;
}
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