Skip to content
Snippets Groups Projects

feat(extension): user can choose mission workdir

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
1 import { Memento, window } from 'vscode';
2
3
4 export type GlobalStorageType = Memento & { setKeysForSync(keys: readonly string[]): void; };
5
6 export default class ExtensionStore {
7 private static instance: ExtensionStore;
8
9 private storage: GlobalStorageType;
10
11 private constructor(storage: GlobalStorageType) {
  • Author Contributor

    passer directement le context au lieu de context.globalState peut permettre à la classe ExtensionStore de stocker d'autres choses, tel que le secretStore

    Je l'ai fait dans ma branche, ça arrivera avec ma MR

    By Christian Zheng on 2022-04-08T12:56:02 (imported from GitLab)

  • Author Contributor

    C'est modifié

    By Lansana DIOMANDE on 2022-04-08T14:00:11 (imported from GitLab)

  • Alexandra changed this line in version 6 of the diff

    changed this line in version 6 of the diff

    By Lansana DIOMANDE on 2022-04-08T14:11:00 (imported from GitLab)

  • Please register or sign in to reply
  • 24
    25 if (ExtensionStore.instance) {
    26 return ExtensionStore.instance;
    27 }
    28
    29 ExtensionStore.instance = new ExtensionStore(storage);
    30 console.log('Extension store existe');
    31 }
    32
    33
    34
    35 getMissionWorkdir(): string | undefined {
    36 return this.storage.get<string>(StoreKey.MissionWorkDirKey);
    37 }
    38
    39 setMissionWorkdir(path: string): Thenable<void> {
  • 21 await window.showOpenDialog({
    22 defaultUri: actualMissionWorkDir ? Uri.file(actualMissionWorkDir) : undefined,
    23 canSelectFolders: true,
    24 canSelectFiles: false,
    25 title: 'Choississez le dossier qui contiendra vos missions'
    26 }).then((folderUri) => {
    27
    28 if (!folderUri) {
    29 if (this.extensionStore.getMissionWorkdir()) {
    30 return;
    31 }
    32 this.chooseMissionWorkdir();
    33 } else {
    34 this.extensionStore.setMissionWorkdir(folderUri[0].path);
    35 }
    36 });
    • Comment on lines +20 to +36
      Author Contributor
      Suggested change
      20
      21 await window.showOpenDialog({
      22 defaultUri: actualMissionWorkDir ? Uri.file(actualMissionWorkDir) : undefined,
      23 canSelectFolders: true,
      24 canSelectFiles: false,
      25 title: 'Choississez le dossier qui contiendra vos missions'
      26 }).then((folderUri) => {
      27
      28 if (!folderUri) {
      29 if (this.extensionStore.getMissionWorkdir()) {
      30 return;
      31 }
      32 this.chooseMissionWorkdir();
      33 } else {
      34 this.extensionStore.setMissionWorkdir(folderUri[0].path);
      35 }
      36 });
      20
      21 const folderUri = await window.showOpenDialog({
      22 defaultUri: actualMissionWorkDir ? Uri.file(actualMissionWorkDir) : undefined,
      23 canSelectFolders: true,
      24 canSelectFiles: false,
      25 title: 'Choississez le dossier qui contiendra vos missions'
      26 });
      27 if (!folderUri) {
      28 if (this.extensionStore.getMissionWorkdir()) {
      29 return;
      30 }
      31 this.chooseMissionWorkdir();
      32 } else {
      33 this.extensionStore.setMissionWorkdir(folderUri[0].path);
      34 }
      35

      By Christian Zheng on 2022-04-08T13:01:55 (imported from GitLab)

    • Alexandra changed this line in version 6 of the diff

      changed this line in version 6 of the diff

      By Lansana DIOMANDE on 2022-04-08T14:11:00 (imported from GitLab)

    • Author Contributor

      c'est modifié

      By Lansana DIOMANDE on 2022-04-08T14:11:14 (imported from GitLab)

    • Please register or sign in to reply
  • 22 render(): string {
    23 return (
    24 `
    25 <head>
    26 ${this.renderHearderHtml()}
    27 </head>
    28 <body>
    29 ${this.renderHtmlBody()}
    30 </body>
    31 `
    32 );
    33 }
    34
    35 renderHtmlBody() {
    36
    37 const hasMissionWorkdir = this.extensionStore.getMissionWorkdir() !== undefined;
    • Author Contributor
      Suggested change
      37 const hasMissionWorkdir = this.extensionStore.getMissionWorkdir() !== undefined;
      37 const hasMissionWorkdir = () => { return this.extensionStore.getMissionWorkdir() !== undefined};
      38 // ou
      39 const hadMissionWorkdir = this.extensionStore.getMissionWorkdir() !== undefined;

      By Christian Zheng on 2022-04-08T13:10:22 (imported from GitLab)

    • Alexandra changed this line in version 6 of the diff

      changed this line in version 6 of the diff

      By Lansana DIOMANDE on 2022-04-08T14:11:00 (imported from GitLab)

    • Author Contributor

      Corrigé merci

      By Lansana DIOMANDE on 2022-04-08T14:11:14 (imported from GitLab)

    • Please register or sign in to reply
  • Alexandra added 1 commit

    added 1 commit

    • 48baf5f2 - feat(extension): user can choose mission workdir

    Compare with previous version

    By Lansana DIOMANDE on 2022-04-08T14:11:01 (imported from GitLab)

  • 1 {
    2 "tabWidth": 4,
    • Author Contributor

      plutôt 2 que 4

      By Alexandra on 2022-04-08T14:39:16 (imported from GitLab)

    • Alexandra changed this line in version 7 of the diff

      changed this line in version 7 of the diff

      By Lansana DIOMANDE on 2022-04-08T14:44:36 (imported from GitLab)

    • Author Contributor

      C'est corrigé

      By Lansana DIOMANDE on 2022-04-08T14:44:54 (imported from GitLab)

    • Author Contributor

      du coup format tes fichiers.

      De même si tu peux ajouter husky ça serait cool !

      By Alexandra on 2022-04-08T15:01:09 (imported from GitLab)

    • Author Contributor

      Ah zut je viens de me rend compte que je le faisais mal. jdois mettre eslint et prettier à la racine du répo deadlock-theia si je veux que ca fonctionne. C'est pas génant?

      By Lansana DIOMANDE on 2022-04-08T15:17:02 (imported from GitLab)

    • Author Contributor

      J'ai mis prettier sur le projet entier et un git hook pour appeler prettier en cas de git commit.

      By Lansana DIOMANDE on 2022-04-11T08:52:47 (imported from GitLab)

    • Please register or sign in to reply
  • Alexandra added 1 commit

    added 1 commit

    • a600be32 - feat(extension): user can choose mission workdir

    Compare with previous version

    By Lansana DIOMANDE on 2022-04-08T14:44:36 (imported from GitLab)

  • Alexandra added 1 commit

    added 1 commit

    • 8a852309 - refactor: add prettier and git hook on deadlock-theia project

    Compare with previous version

    By Lansana DIOMANDE on 2022-04-11T08:43:10 (imported from GitLab)

  • Alexandra added 1 commit

    added 1 commit

    • 80d11445 - refactor: add prettier and git hook on deadlock-theia project

    Compare with previous version

    By Lansana DIOMANDE on 2022-04-11T08:49:32 (imported from GitLab)

  • Alexandra added 1 commit

    added 1 commit

    • a4fd5b66 - refactor: add prettier and git hook on deadlock-theia project

    Compare with previous version

    By Lansana DIOMANDE on 2022-04-11T13:49:12 (imported from GitLab)

  • Please register or sign in to reply
    Loading