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
eb3e1b7c
Commit
eb3e1b7c
authored
Oct 12, 2019
by
Timon Stampfli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feature workspaceconfig is adjusted to platform
parent
7cfec2d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
6 deletions
+58
-6
src/soiworkspace.ts
src/soiworkspace.ts
+9
-4
src/soiworkspaceFormats/soiworkspace-0-8-0.ts
src/soiworkspaceFormats/soiworkspace-0-8-0.ts
+48
-1
src/store.ts
src/store.ts
+1
-1
No files found.
src/soiworkspace.ts
View file @
eb3e1b7c
...
...
@@ -52,6 +52,7 @@ async function determineWorkspaceFolder(): Promise<string | null> {
}
async
function
determineWorkspaceSettingsFileContent
(
store
:
Store
,
workspace
:
string
):
Promise
<
string
|
null
>
{
let
workspaceSettings
=
await
vscode
.
workspace
.
findFiles
(
"
soiworkspace.json
"
);
...
...
@@ -73,7 +74,7 @@ async function determineWorkspaceSettingsFileContent(
try
{
await
fs
.
writeFile
(
path
.
join
(
workspace
,
"
soiworkspace.json
"
),
soiWorkspaceTemplate_0_8_0
()
soiWorkspaceTemplate_0_8_0
(
store
)
);
}
catch
(
err
)
{
vscode
.
window
.
showErrorMessage
(
...
...
@@ -98,9 +99,11 @@ async function determineWorkspaceSettingsFileContent(
}
async
function
determineWorkspaceSettings
(
store
:
Store
,
workspace
:
string
):
Promise
<
WorkspaceSettings
|
null
>
{
let
workspaceSettingsFileContent
=
await
determineWorkspaceSettingsFileContent
(
store
,
workspace
);
if
(
workspaceSettingsFileContent
===
null
)
{
...
...
@@ -118,12 +121,14 @@ async function determineWorkspaceSettings(
}
}
export
async
function
readWorkspaceState
():
Promise
<
WorkspaceState
>
{
export
async
function
readWorkspaceState
(
store
:
Store
):
Promise
<
WorkspaceState
>
{
let
workdir
=
await
determineWorkspaceFolder
();
if
(
workdir
===
null
)
{
return
"
NoFolderOpen
"
;
}
let
settings
=
await
determineWorkspaceSettings
(
workdir
);
let
settings
=
await
determineWorkspaceSettings
(
store
,
workdir
);
if
(
settings
===
null
)
{
return
"
NoSOIWorkspace
"
;
}
...
...
@@ -139,6 +144,6 @@ export async function readWorkspaceState(): Promise<WorkspaceState> {
export
async
function
initializeWorkspace
(
store
:
Store
)
{
let
workspace
=
await
determineWorkspaceFolder
();
if
(
workspace
!==
null
)
{
await
determineWorkspaceSettings
(
workspace
);
await
determineWorkspaceSettings
(
store
,
workspace
);
}
}
src/soiworkspaceFormats/soiworkspace-0-8-0.ts
View file @
eb3e1b7c
export
function
soiWorkspaceTemplate_0_8_0
():
string
{
import
{
determinePlatform
}
from
"
../util
"
;
import
{
Store
}
from
"
../store
"
;
import
*
as
path
from
"
path
"
;
export
function
soiWorkspaceTemplate_0_8_0
(
store
:
Store
):
string
{
if
(
determinePlatform
()
===
"
windows-amd64
"
)
{
return
`{
"workspace":{
"templateVersion":"0.8.0"
},
"settings": {
"compilerPath": "
${
path
.
join
(
store
.
soicodeExtensionDataPath
,
"
bundle
"
,
"
soiheaders
"
,
"
compiler
"
,
"
bin
"
)}
",
"debuggerPath": "no/gdb",
"cppHeaderPath": "
${
path
.
join
(
store
.
soicodeExtensionDataPath
,
"
bundle
"
,
"
soiheaders
"
,
"
soiheader
"
)}
",
"soiHeaderPath": "",
"flags": "-Wall -Wextra -std=c++17 -g3 -ggdb3 -D_GLIBCXX_DEBUG",
"useBundledSoiHeaders": true
}
}
`
;
}
if
(
determinePlatform
()
===
"
darwin-amd64
"
)
{
return
`{
"workspace":{
"templateVersion":"0.8.0"
},
"settings": {
"compilerPath": "/usr/bin/c++",
"debuggerPath": "/usr/bin/gdb",
"cppHeaderPath": "",
"soiHeaderPath": "",
"flags": "-Wall -Wextra -std=c++17 -g3 -ggdb3 -D_GLIBCXX_DEBUG",
"useBundledSoiHeaders": true
}
}
`
;
}
return
`{
"workspace":{
"templateVersion":"0.8.0"
...
...
src/store.ts
View file @
eb3e1b7c
...
...
@@ -55,7 +55,7 @@ export class Store {
}
emitFsChange
(
this
:
Store
)
{
readWorkspaceState
().
then
(
workspaceState
=>
{
readWorkspaceState
(
this
).
then
(
workspaceState
=>
{
this
.
workspace
=
workspaceState
;
for
(
let
sub
of
this
.
fileChangeSubscribers
)
{
sub
();
...
...
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