Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbdf0c32

Browse files
committed
cleanup todos
1 parent0fd10d3 commitbdf0c32

File tree

18 files changed

+40
-32
lines changed

18 files changed

+40
-32
lines changed

‎src/actions/tutorialConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const tutorialConfig = async (
2626
})
2727
})
2828

29-
// TODO: if remote not already set
29+
// TODO if remote not already set
3030
awaitgit.setupRemote(config.repo.uri).catch(error=>{
3131
onError({title:error.message,description:'Remove your current Git project and restarting'})
3232
})

‎src/actions/utils/openFiles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const openFiles = async (files: string[]) => {
88
}
99
for(constfilePathoffiles){
1010
try{
11-
// TODO: figure out why this does not work
11+
// TODO figure out why this does not work
1212
// try {
1313
// const absoluteFilePath = join(workspaceRoot.uri.path, filePath)
1414
// const doc = await vscode.workspace.openTextDocument(absoluteFilePath)

‎src/channel/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,6 @@ class Channel implements Channel {
114114
onError,
115115
)
116116
return
117-
case'EDITOR_SYNC_PROGRESS':
118-
// sync client progress on server
119-
this.context.position.set(action.payload.position)
120-
this.context.progress.set(action.payload.progress)
121-
return
122117
// load step actions (git commits, commands, open files)
123118
case'SETUP_ACTIONS':
124119
vscode.commands.executeCommand(COMMANDS.SET_CURRENT_STEP,action.payload)

‎src/channel/state/Position.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,25 @@ class Position {
1313
this.value=defaultValue
1414
}
1515
publicget=()=>{
16+
if(!this.value.levelId||!this.value.stepId){
17+
console.log('NO POSITION RETURNED')
18+
}
19+
console.log(this.value)
1620
returnthis.value
1721
}
1822
publicset=(value:CR.Position)=>{
23+
console.log('--- position set')
24+
console.log(value)
1925
this.value=value
2026
}
2127
publicreset=()=>{
2228
this.value=defaultValue
2329
}
2430
// calculate the current position based on the saved progress
2531
publicsetPositionFromProgress=(tutorial:G.Tutorial,progress:CR.Progress):CR.Position=>{
32+
console.log('--- set position from progress')
2633
// tutorial already completed
27-
// TODO: handle start again?
34+
// TODO handle start again?
2835
if(progress.complete){
2936
returnthis.value
3037
}
@@ -36,7 +43,7 @@ class Position {
3643
const{ levels}=tutorial.version.data
3744

3845
constlastLevelIndex:number|undefined=levels.findIndex((l:G.Level)=>!progress.levels[l.id])
39-
// TODO: consider all levels complete as progress.complete
46+
// TODO consider all levels complete as progress.complete
4047
if(lastLevelIndex>=levels.length){
4148
thrownewError('Error setting progress level')
4249
}
@@ -56,6 +63,9 @@ class Position {
5663
levelId:currentLevel.id,
5764
stepId:currentStep.id,
5865
}
66+
67+
console.log('--- calculated set position from progress')
68+
console.log(this.value)
5969
returnthis.value
6070
}
6171
}

‎src/channel/state/Progress.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ class Progress {
4343
publicsetStepComplete=(stepId:string):CR.Progress=>{
4444
constnext=this.value
4545
next.steps[stepId]=true
46+
47+
// TODO validate if progress is complete for a level or tutorial
48+
4649
returnthis.set(next)
4750
}
4851
}

‎src/channel/state/Tutorial.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,21 @@ import Storage from '../../services/storage'
66
// Tutorial
77
classTutorial{
88
privatestorage:Storage<G.Tutorial|null>
9-
privatevalue:G.Tutorial|null
9+
privatevalue:G.Tutorial|null=null
1010
constructor(workspaceState:vscode.Memento){
1111
this.storage=newStorage<G.Tutorial|null>({
1212
key:'coderoad:currentTutorial',
1313
storage:workspaceState,
1414
defaultValue:null,
1515
})
16-
this.value=null
1716
// set value from storage
1817
this.storage.get().then((value:G.Tutorial|null)=>{
1918
this.value=value
2019
})
2120
}
22-
publicget=()=>this.value
21+
publicget=()=>{
22+
returnthis.value
23+
}
2324
publicset=(value:G.Tutorial|null)=>{
2425
this.value=value
2526
this.storage.set(value)

‎src/editor/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const createCommands = ({ extensionPath, workspaceState, workspaceRoot }:
2626
return{
2727
// initialize
2828
[COMMANDS.START]:async()=>{
29-
// TODO: replace with a prompt to open a workspace
29+
// TODO replace with a prompt to open a workspace
3030
// await isEmptyWorkspace()
3131

3232
letwebviewState:'INITIALIZING'|'RESTARTING'
@@ -58,6 +58,7 @@ export const createCommands = ({ extensionPath, workspaceState, workspaceRoot }:
5858
// send test pass message back to client
5959
vscode.window.showInformationMessage('PASS')
6060
webview.send({type:'TEST_PASS', payload})
61+
// update local storage
6162
},
6263
onFail:(payload:Payload,message:string)=>{
6364
// send test fail message back to client
@@ -75,7 +76,6 @@ export const createCommands = ({ extensionPath, workspaceState, workspaceRoot }:
7576
})
7677
},
7778
[COMMANDS.SET_CURRENT_STEP]:({ stepId}:Payload)=>{
78-
// NOTE: as async, may sometimes be inaccurate
7979
// set from last setup stepAction
8080
currentStepId=stepId
8181
},

‎src/services/git/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export async function checkRemoteExists(): Promise<boolean> {
119119
returnfalse
120120
}
121121
// string match on remote output
122-
// TODO: improve the specificity of this regex
122+
// TODO improve the specificity of this regex
123123
return!!stdout.match(gitOrigin)
124124
}catch(error){
125125
returnfalse

‎src/services/storage/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class Storage<T> {
1616
this.defaultValue=defaultValue
1717
}
1818
publicget=async():Promise<T>=>{
19-
//const value: string | undefined = await this.storage.get(this.key)
20-
//if (value) {
21-
//return JSON.parse(value)
22-
//}
19+
constvalue:string|undefined=awaitthis.storage.get(this.key)
20+
if(value){
21+
returnJSON.parse(value)
22+
}
2323
returnthis.defaultValue
2424
}
2525
publicset=(value:T):void=>{

‎src/webview/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface ReactWebViewProps {
1212

1313
constcreateReactWebView=({ extensionPath, workspaceState, workspaceRoot}:ReactWebViewProps)=>{
1414
letloaded=false
15-
// TODO: add disposables
15+
// TODO add disposables
1616
constdisposables:vscode.Disposable[]=[]
1717

1818
functioncreateWebViewPanel():vscode.WebviewPanel{

‎typings/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ interface MessageState {
108108
state:string
109109
}
110110

111-
//todo: type each string param and payload
111+
//TODO type each string param and payload
112112
exporttypeEditorDispatch=(type:string,payload?:MessageData|MessageState|any)=>void
113113

114114
exportinterfaceProcessEvent{

‎web-app/src/Routes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const { Route } = Router
1515
consttempSend=(action:any)=>console.log('sent')
1616

1717
constRoutes=()=>{
18-
// TODO: refactor for typescript to understand send & context passed into React.cloneElement's
18+
// TODO refactor for typescript to understand send & context passed into React.cloneElement's
1919
return(
2020
<Workspace>
2121
<Router>

‎web-app/src/components/Markdown/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const Markdown = (props: Props) => {
3636
<p>${props.children}</p>
3737
</div>`
3838
}
39-
// TODO: sanitize markdown or HTML
39+
// TODO sanitize markdown or HTML
4040
return<divdangerouslySetInnerHTML={{__html:html}}/>
4141
}
4242

‎web-app/src/components/Markdown/prism.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ import 'prismjs/components/prism-javascript'
1010
import'prismjs/components/prism-json'
1111
import'prismjs/components/prism-sql'
1212
import'prismjs/components/prism-typescript'
13-
// TODO: import all - current list only supports js related
13+
// TODO import all - current list only supports js related

‎web-app/src/components/StepHelp/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface Props {
2727
}
2828

2929
constStepHelp=(props:Props)=>{
30-
// TODO: extract or replace load solution
30+
// TODO extract or replace load solution
3131
const[loadedSolution,setLoadedSolution]=React.useState()
3232
constonClickHandler=()=>{
3333
if(!loadedSolution){

‎web-app/src/services/state/actions/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default {
3232
.catch(console.error)
3333

3434
if(!result||!result.data){
35-
// TODO: handle failed authentication
35+
// TODO handle failed authentication
3636
console.error('ERROR: Authentication failed')
3737
consterror={
3838
title:'Authentication Failed',

‎web-app/src/services/state/actions/context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default {
4747
//@ts-ignore
4848
updateStepPosition:assign({
4949
position:(context:CR.MachineContext,event:CR.MachineEvent):CR.Position=>{
50-
// TODO: calculate from progress
50+
// TODO calculate from progress
5151

5252
const{ position}=context
5353
// merge in the updated position
@@ -176,7 +176,7 @@ export default {
176176
constlevel:G.Level=selectors.currentLevel(context)
177177

178178
const{ steps}=level
179-
// TODO: verify not -1
179+
// TODO verify not -1
180180
conststepIndex=steps.findIndex((s:G.Step)=>s.id===position.stepId)
181181
constfinalStep=stepIndex===steps.length-1
182182
conststepComplete=progress.steps[position.stepId]

‎web-app/src/services/state/machine.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
9797
},
9898
},
9999
states:{
100-
// TODO: move Initialize into New Tutorial setup
100+
// TODO move Initialize into New Tutorial setup
101101
Initialize:{
102102
onEntry:['initializeTutorial'],
103103
on:{
104104
TUTORIAL_CONFIGURED:'Summary',
105-
// TUTORIAL_CONFIG_ERROR: 'Start' // TODO: should handle error
105+
// TUTORIAL_CONFIG_ERROR: 'Start' // TODO should handle error
106106
},
107107
},
108108
Summary:{
@@ -189,7 +189,6 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
189189
},
190190
},
191191
LevelComplete:{
192-
onEntry:['syncProgress'],
193192
on:{
194193
LEVEL_NEXT:'#tutorial-load-next',
195194
},
@@ -198,7 +197,7 @@ export const machine = Machine<CR.MachineContext, CR.MachineStateSchema, CR.Mach
198197
},
199198
Completed:{
200199
id:'completed-tutorial',
201-
onEntry:['syncProgress','userTutorialComplete'],
200+
onEntry:['userTutorialComplete'],
202201
on:{
203202
SELECT_TUTORIAL:{
204203
target:'#start-new-tutorial',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp