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

Resolve failed launch on CodeAlly#527

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 2 commits intomasterfromfeat/detect-failed-launch
Nov 21, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletionssrc/actions/onStartup.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,9 +42,9 @@ const onStartup = async (context: Context): Promise<void> => {
consttutorial=awaittutorialRes.json()
send({type:'START_TUTORIAL_FROM_URL',payload:{ tutorial}})
return
}catch(e){
}catch(e:any){
// on failure to load a tutorial url fallback to NEW
console.log(`Failed to load tutorial from url${TUTORIAL_URL} with error "${e.message}"`)
thrownewError(`Failed to load tutorial from url${TUTORIAL_URL} with error "${e.message}"`)
}
}
// NEW from start click
Expand All@@ -56,7 +56,7 @@ const onStartup = async (context: Context): Promise<void> => {
const{ position}=awaitcontext.onContinue(tutorial)
// communicate to client the tutorial & stepProgress state
send({type:'LOAD_STORED_TUTORIAL',payload:{ env, tutorial, position}})
}catch(e){
}catch(e:any){
consterror={
type:'UnknownError',
message:`Location: Editor startup\n\n${e.message}`,
Expand Down
2 changes: 1 addition & 1 deletionsrc/actions/onTutorialConfigContinue.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,7 +25,7 @@ const onTutorialConfigContinue = async (action: T.Action, context: Context): Pro
if(tutorialToContinue.config?.webhook){
setupWebhook(tutorialToContinue.config.webhook)
}
}catch(e){
}catch(e:any){
consterror={
type:'UnknownError',
message:`Location: Editor tutorial continue config.\n\n${e.message}`,
Expand Down
5 changes: 5 additions & 0 deletionssrc/channel.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,11 @@ class Channel implements Channel {

// receive from webview
publicreceive=async(action:T.Action):Promise<void>=>{
if(action.source!=='coderoad'){
// filter out events from other extensions
return
}

// action may be an object.type or plain string
constactionType:string=typeofaction==='string' ?action :action.type

Expand Down
2 changes: 1 addition & 1 deletionsrc/services/hooks/utils/openFiles.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,7 @@ const openFiles = async (files: string[] = []): Promise<void> => {
const absoluteFilePath = join(wr, filePath)
const doc = await vscode.workspace.openTextDocument(absoluteFilePath)
await vscode.window.showTextDocument(doc, vscode.ViewColumn.One)
} catch (error) {
} catch (error: any) {
console.log(`Failed to open file ${filePath}: ${error.message}`)
}
}
Expand Down
2 changes: 1 addition & 1 deletionsrc/services/hooks/utils/runCommands.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,7 @@ const runCommands = async (commands: string[] = []): Promise<void> => {
try{
result=awaitexec({ command})
console.log(result)
}catch(error){
}catch(error:any){
console.error(`Command failed:${error.message}`)
send({type:'COMMAND_FAIL',payload:{process:{ ...process,status:'FAIL'}}})
return
Expand Down
2 changes: 1 addition & 1 deletionsrc/services/reset/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -63,7 +63,7 @@ const reset = async ({ branch, hash }: Input): Promise<void> => {
awaitexec({
command:`git reset --hard${hash}`,
})
}catch(error){
}catch(error:any){
console.error('Error resetting')
console.error(error.message)
}
Expand Down
2 changes: 1 addition & 1 deletionsrc/services/testRunner/index.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -75,7 +75,7 @@ const createTestRunner = (data: TT.Tutorial, callbacks: Callbacks): ((params: an
}
logger('COMMAND',command)
result=awaitexec({ command,dir:testRunnerConfig.directory})
}catch(err){
}catch(err:any){
result={stdout:err.stdout,stderr:err.stack}
}

Expand Down
6 changes: 5 additions & 1 deletionsrc/services/webview/create.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,7 +56,11 @@ const createReactWebView = ({ extensionPath, channel }: ReactWebViewProps): Outp

// Handle messages from the webview
constreceive=channel.receive
constsend=(action:T.Action)=>panel.webview.postMessage(action)
constsend=(action:T.Action)=>
panel.webview.postMessage({
...action,
source:'coderoad',// filter events on client by source. origin is not reliable
})

panel.webview.onDidReceiveMessage(receive,null,disposables)

Expand Down
1 change: 1 addition & 0 deletionstypings/index.d.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -49,6 +49,7 @@ export interface Position {
// current tutorial state

exportinterfaceAction{
source?:'coderoad'// filter received actions by this
type:string
payload?:any
meta?:any
Expand Down
16 changes: 10 additions & 6 deletionsweb-app/src/services/state/useStateMachine.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,10 @@ declare let acquireVsCodeApi: any
const editor = acquireVsCodeApi()
const editorSend = (action: T.Action) => {
logger(`TO EXT: "${action.type}"`)
return editor.postMessage(action)
return editor.postMessage({
...action,
source: 'coderoad', // filter events by source on editor side
})
}

// router finds first state match of <Route path='' />
Expand All@@ -31,14 +34,15 @@ const useStateMachine = (): Output => {
// event bus listener
React.useEffect(() => {
const listener = 'message'
//propograte channel event to state machine
//propagate channel event to state machine
const handler = (event: any) => {
// ensure events are coming from coderoad webview
if (!event.origin.match(/^vscode-webview/)) {
return
}
// NOTE: must call event.data, cannot destructure. VSCode acts odd
const action = event.data

if (action.source !== 'coderoad') {
// filter out events from other extensions
return
}
sendWithLog(action)
}
window.addEventListener(listener, handler)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp