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

Commit03e7216

Browse files
committed
remove unused
1 parentb8d01ea commit03e7216

File tree

1 file changed

+64
-44
lines changed

1 file changed

+64
-44
lines changed

‎src/actions/setupActions.ts

Lines changed: 64 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,34 @@ import * as vscode from 'vscode'
44
import*asgitfrom'../services/git'
55
importnodefrom'../services/node'
66

7-
interfaceErrorMessageFilter{
8-
[lang:string]:{
9-
[key:string]:string
10-
}
11-
}
7+
//interface ErrorMessageFilter {
8+
//[lang: string]: {
9+
//[key: string]: string
10+
//}
11+
//}
1212

1313
// TODO: should be loaded on startup based on language
14-
constcommandErrorMessageFilter:ErrorMessageFilter={
15-
JAVASCRIPT:{
16-
'node-gyp':'Error running npm setup command'
17-
}
18-
}
14+
//const commandErrorMessageFilter: ErrorMessageFilter = {
15+
//#"diff-47d0c00fa3c186f7fc510aad6c9706e5d40404c1952033d7c544d0317de2b80b-18-16-0" data-selected="false" role="gridcell" tabindex="-1" valign="top">
16+
//'node-gyp': 'Error running npm setup command'
17+
//}
18+
//}
1919

2020

2121
// TODO: pass command and command name down for filtering. Eg. JAVASCRIPT, 'npm install'
22-
construnCommands=async(commands:string[],language:string='JAVASCRIPT')=>{
22+
construnCommands=async(commands:string[])=>{
2323
for(constcommandofcommands){
2424
const{stdout, stderr}=awaitnode.exec(command)
2525
if(stderr){
2626
console.error(stderr)
2727
// language specific error messages from running commands
28-
constfilteredMessages=Object.keys(commandErrorMessageFilter[language])
29-
for(constmessageoffilteredMessages){
30-
if(stderr.match(message)){
31-
// ignored error
32-
thrownewError('Error running setup command')
33-
}
34-
}
28+
//const filteredMessages = Object.keys(commandErrorMessageFilter[language])
29+
//for (const message of filteredMessages) {
30+
//if (stderr.match(message)) {
31+
//// ignored error
32+
//throw new Error('Error running setup command')
33+
//}
34+
//}
3535
}
3636
console.log(`run command:${command}`,stdout)
3737
}
@@ -45,7 +45,8 @@ const disposeWatcher = (listener: string) => {
4545
deletewatchers[listener]
4646
}
4747

48-
constsetupActions=async(workspaceRoot:vscode.WorkspaceFolder,{commands, commits, files, listeners}:G.StepActions):Promise<void>=>{
48+
constsetupActions=async(workspaceRoot:vscode.WorkspaceFolder,actions:G.StepActions):Promise<void>=>{
49+
const{commands, commits, files, listeners}=actions
4950
// run commits
5051
if(commits){
5152
for(constcommitofcommits){
@@ -54,31 +55,50 @@ const setupActions = async (workspaceRoot: vscode.WorkspaceFolder, {commands, co
5455
}
5556

5657
// run file watchers (listeners)
57-
if(listeners){
58-
for(constlisteneroflisteners){
59-
if(!watchers[listener]){
60-
constpattern=newvscode.RelativePattern(
61-
vscode.workspace.getWorkspaceFolder(workspaceRoot.uri)!,
62-
listener
63-
)
64-
watchers[listener]=vscode.workspace.createFileSystemWatcher(
65-
pattern
66-
)
67-
watchers[listener].onDidChange(()=>{
68-
// trigger save
69-
vscode.commands.executeCommand('coderoad.run_test',null,()=>{
70-
// cleanup watcher on success
71-
disposeWatcher(listener)
72-
})
73-
})
74-
}
75-
}
76-
}else{
77-
// remove all watchers
78-
for(constlistenerofObject.keys(watchers)){
79-
disposeWatcher(listener)
80-
}
81-
}
58+
// if (listeners) {
59+
// console.log('listeners')
60+
// for (const listener of listeners) {
61+
// if (!watchers[listener]) {
62+
// const pattern = new vscode.RelativePattern(
63+
// vscode.workspace.getWorkspaceFolder(workspaceRoot.uri)!,
64+
// listener
65+
// )
66+
// console.log(pattern)
67+
// watchers[listener] = vscode.workspace.createFileSystemWatcher(
68+
// pattern
69+
// )
70+
// watchers[listener].onDidChange(() => {
71+
// console.log('onDidChange')
72+
// // trigger save
73+
// vscode.commands.executeCommand('coderoad.run_test', null, () => {
74+
// // cleanup watcher on success
75+
// disposeWatcher(listener)
76+
// })
77+
// })
78+
// watchers[listener].onDidCreate(() => {
79+
// console.log('onDidCreate')
80+
// // trigger save
81+
// vscode.commands.executeCommand('coderoad.run_test', null, () => {
82+
// // cleanup watcher on success
83+
// disposeWatcher(listener)
84+
// })
85+
// })
86+
// watchers[listener].onDidDelete(() => {
87+
// console.log('onDidDelete')
88+
// // trigger save
89+
// vscode.commands.executeCommand('coderoad.run_test', null, () => {
90+
// // cleanup watcher on success
91+
// disposeWatcher(listener)
92+
// })
93+
// })
94+
// }
95+
// }
96+
// } else {
97+
// // remove all watchers
98+
// for (const listener of Object.keys(watchers)) {
99+
// disposeWatcher(listener)
100+
// }
101+
// }
82102

83103
// run command
84104
if(commands){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp