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

Commit6d2263a

Browse files
committed
resolve startup issues
1 parenteff8d42 commit6d2263a

File tree

9 files changed

+30
-15
lines changed

9 files changed

+30
-15
lines changed

‎src/actions/tutorialConfig.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ const tutorialConfig = async ({tutorial, alreadyConfigured, onComplete}: Tutoria
1919
if(onComplete){onComplete()}
2020
}
2121

22-
//TODO:allow multiple coding languages in a tutorial
23-
constlanguages:G.CodingLanguage[]=tutorial.version.data.config.codingLanguages
22+
// allow multiple coding languages in a tutorial
23+
constlanguages:string[]=tutorial.version.data.config.codingLanguages.map(lang=>lang.toLowerCase())
2424

2525
// setup onSave hook
2626
vscode.workspace.onDidSaveTextDocument((document:vscode.TextDocument)=>{
2727
//@ts-ignore // issue with GQL enums in TS
28-
if(document.uri.scheme==='file'&&languages.includes(document.languageId.toUpperCase())){
28+
if(document.uri.scheme==='file'&&languages.includes(document.languageId)){
2929
vscode.commands.executeCommand('coderoad.run_test')
3030
}
3131
})

‎src/channel/state/Position.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class Position {
3030
returnthis.value
3131
}
3232

33+
if(!tutorial||!tutorial.version||!tutorial.version.data||!tutorial.version.data.levels){
34+
thrownewError('Error setting position from progress')
35+
}
36+
3337
const{levels}=tutorial.version.data
3438

3539
constlastLevelIndex:number|undefined=levels.findIndex((l:G.Level)=>!progress.levels[l.id])

‎src/editor/ReactWebView.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ class ReactWebView {
5252

5353
// // // prevents moving coderoad panel on top of left panel
5454
// vscode.window.onDidChangeVisibleTextEditors((textEditors: vscode.TextEditor[]) => {
55-
// console.log('onDidChangeVisibleTextEditors')
56-
// console.log(textEditors)
5755
// // updateWindows()
5856
// })
5957

‎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-
constvalue:string|undefined=awaitthis.storage.get(this.key)
20-
if(value){
21-
returnJSON.parse(value)
22-
}
19+
//const value: string | undefined = await this.storage.get(this.key)
20+
//if (value) {
21+
//return JSON.parse(value)
22+
//}
2323
returnthis.defaultValue
2424
}
2525
publicset=(value:T):void=>{

‎src/test/runTest.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as path from 'path'
33
import{runTests}from'vscode-test'
44

55
asyncfunctionmain(){
6-
console.log('__dirname',__dirname)
76
// The folder containing the Extension Manifest package.json
87
// Passed to `--extensionDevelopmentPath`
98
constextensionDevelopmentPath:string=path.resolve(__dirname,'../../')

‎src/test/suite/extension.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ suite('Extension tests', () => {
1515
awaitvscode.commands.executeCommand('coderoad.start')
1616
awaitsetTimeout(()=>Promise.resolve(),5000)
1717
// const webview = vscode.window.activeTextEditor
18-
// console.log(webview)
1918
assert.equal(2,2)
2019
})
2120

‎web-app/src/services/apollo/mutations/authenticate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default gql`
44
mutation Authenticate(
55
$machineId: String!,
66
$sessionId: String!,
7-
$editor:EditorEnum!
7+
$editor:Editor!
88
) {
99
editorLogin(input: {
1010
machineId: $machineId,

‎web-app/src/services/apollo/queries/tutorial.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default gql`
1313
data {
1414
config {
1515
testRunner
16+
codingLanguages
1617
repo {
1718
uri
1819
}

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
11
import*asCRfrom'typings'
2+
import*asGfrom'typings/graphql'
23
importclientfrom'../../apollo'
34
importauthenticateMutationfrom'../../apollo/mutations/authenticate'
45
import{setAuthToken}from'../../apollo/auth'
56
importchannelfrom'../../../services/channel'
67

8+
interfaceAuthenticateData{
9+
editorLogin:{
10+
token:string
11+
user:G.User
12+
}
13+
}
14+
15+
interfaceAuthenticateVariables{
16+
machineId:string
17+
sessionId:string
18+
editor:'VSCODE'
19+
}
20+
721
exportdefault{
822
authenticate:(async(context:CR.MachineContext):Promise<void>=>{
923

10-
constresult=awaitclient.mutate({
24+
constresult=awaitclient.mutate<AuthenticateData,AuthenticateVariables>({
1125
mutation:authenticateMutation,
1226
variables:{
1327
machineId:context.env.machineId,
1428
sessionId:context.env.sessionId,
1529
editor:'VSCODE',
1630
}
17-
})
18-
31+
}).catch(console.error)
1932

2033
if(!result||!result.data){
2134
// TODO: handle failed authentication
2235
console.error('ERROR: Authentication failed')
36+
return
2337
}
2438
const{token}=result.data.editorLogin
2539
// add token to headers

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp