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
a8c97700
Commit
a8c97700
authored
4 years ago
by
Smit, P.J.M. (Peter, Student M-CS)
Browse files
Options
Downloads
Patches
Plain Diff
added Modest executable location in configuration
parent
c25f5ddb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
package.json
+12
-3
12 additions, 3 deletions
package.json
src/commands.ts
+26
-1
26 additions, 1 deletion
src/commands.ts
with
38 additions
and
4 deletions
package.json
+
12
−
3
View file @
a8c97700
...
...
@@ -16,14 +16,12 @@
"title"
:
"Simulate Model"
}
],
"commandPalette"
:
[
{
"command"
:
"extension.simulate"
,
"when"
:
"editorLangId == modest"
}
],
"languages"
:
[
{
"id"
:
"modest"
,
...
...
@@ -41,9 +39,20 @@
{
"language"
:
"modest"
,
"scopeName"
:
"source.modest"
,
"path"
:
"./syntaxes/modest.tmLanguage.json"
}
],
"configuration"
:
[
{
"title"
:
"Modest"
,
"properties"
:
{
"modest.executableLocation"
:
{
"type"
:
"string"
,
"default"
:
"C:
\\
Program Files
\\
modest
\\
modest.exe"
,
"description"
:
"Location of the Modest executable"
}
}
}
]
},
"activationEvents"
:
[
...
...
This diff is collapsed.
Click to expand it.
src/commands.ts
+
26
−
1
View file @
a8c97700
import
{
pathToFileURL
}
from
'
url
'
;
import
*
as
vscode
from
'
vscode
'
;
import
*
as
path
from
"
path
"
;
export
namespace
ModestCommands
{
const
paramHistory
:
Map
<
string
,
string
>
=
new
Map
();
function
modestExecutable
():
string
|
undefined
{
let
executable
:
string
|
undefined
=
vscode
.
workspace
.
getConfiguration
(
"
modest
"
).
get
(
"
executableLocation
"
);
if
(
executable
===
undefined
)
{
vscode
.
window
.
showInformationMessage
(
"
It looks like you don't have the modest configurable located yet.
"
,
"
Go to settings
"
)
.
then
(
result
=>
{
//TODO: Figure out how to link to settings.
});
return
;
}
// Surround any directory with whitespace in quotes
return
executable
.
split
(
path
.
sep
).
map
(
value
=>
value
.
match
(
/
\s
/
)
?
`"
${
value
}
"`
:
value
).
join
(
path
.
sep
);
}
export
let
simCommand
=
vscode
.
commands
.
registerCommand
(
'
extension.simulate
'
,
async
()
=>
{
//activeTextEditor should never be undefined
if
(
vscode
.
window
.
activeTextEditor
===
undefined
)
{
return
;
}
let
executable
:
string
|
undefined
=
modestExecutable
();
if
(
executable
===
undefined
)
{
return
;
}
var
currentFile
=
vscode
.
window
.
activeTextEditor
.
document
.
fileName
;
// Show parameter input box
let
parms
=
await
vscode
.
window
.
showInputBox
({
...
...
@@ -25,7 +50,7 @@ export namespace ModestCommands {
// Create a terminal and run the simulation
let
term
=
vscode
.
window
.
createTerminal
(
"
Modest simulation
"
);
term
.
sendText
(
`
modest
simulate
${
currentFile
}
${
parms
}
\n`
);
term
.
sendText
(
`
${
executable
}
simulate
${
currentFile
}
${
parms
}
\n`
);
term
.
show
(
true
);
});
}
\ No newline at end of file
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