11import { pathExists } from "fs-extra" ;
2- import {
3- env ,
4- ExtensionContext ,
5- ExtensionMode ,
6- QuickPickItem ,
7- Uri ,
8- window ,
9- } from "vscode" ;
2+ import { env , QuickPickItem , Uri , window } from "vscode" ;
103
114import {
125 getMockGitHubApiServerScenariosPath ,
@@ -15,7 +8,8 @@ import {
158import { DisposableObject } from "../pure/disposable-object" ;
169import { MockGitHubApiServer } from "./mock-gh-api-server" ;
1710import { MockGitHubApiServerCommands } from "../common/commands" ;
18- import { App } from "../common/app" ;
11+ import { App , AppMode } from "../common/app" ;
12+ import path from "path" ;
1913
2014/**
2115 * "Interface" to the mock GitHub API server which implements VSCode interactions, such as
@@ -27,10 +21,7 @@ export class VSCodeMockGitHubApiServer extends DisposableObject {
2721 private readonly server : MockGitHubApiServer ;
2822 private readonly config : MockGitHubApiConfigListener ;
2923
30- constructor (
31- private readonly ctx : ExtensionContext ,
32- private readonly app : App ,
33- ) {
24+ constructor ( private readonly app : App ) {
3425 super ( ) ;
3526 this . server = new MockGitHubApiServer ( ) ;
3627 this . config = new MockGitHubApiConfigListener ( ) ;
@@ -228,11 +219,11 @@ export class VSCodeMockGitHubApiServer extends DisposableObject {
228219 return scenariosPath ;
229220 }
230221
231- if ( this . ctx . extensionMode === ExtensionMode . Development ) {
232- const developmentScenariosPath = Uri . joinPath (
233- this . ctx . extensionUri ,
222+ if ( this . app . mode === AppMode . Development ) {
223+ const developmentScenariosPath = path . join (
224+ this . app . extensionPath ,
234225 "src/mocks/scenarios" ,
235- ) . fsPath . toString ( ) ;
226+ ) ;
236227 if ( await pathExists ( developmentScenariosPath ) ) {
237228 return developmentScenariosPath ;
238229 }
0 commit comments