Skip to content

Commit edf93fe

Browse files
author
Loïc Mangeonjean
committed
feat: provide open file model in initOptions
1 parent 326bffa commit edf93fe

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/infrastructure.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,17 @@ export abstract class CodinGameInfrastructure implements Infrastructure {
135135
throw new Error('Unable to connect to server')
136136
}
137137
}
138+
139+
public getInitializationOptions (): LSPAny {
140+
const files = monaco.editor
141+
.getModels()
142+
.filter((model) => model.uri.scheme === 'file')
143+
.reduce((map, model) => {
144+
map[model.uri.toString(true)] = model.getValue()
145+
return map
146+
}, {} as Record<string, string>)
147+
return {
148+
files
149+
}
150+
}
138151
}

0 commit comments

Comments
 (0)