Compare commits
	
		
			11 Commits
		
	
	
		
			24e700065e
			...
			d649b52345
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d649b52345 | |||
| ab334f91dc | |||
| baa3c222f3 | |||
| ca9375d25d | |||
| 5269b0db43 | |||
| 8ca13ac88a | |||
| 4ad075088a | |||
| e64c2a988c | |||
| 44d1dd172a | |||
| 847eef1a84 | |||
| 1afd11d693 | 
							
								
								
									
										6
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							@ -3,9 +3,13 @@
 | 
			
		||||
    "editor.wordWrap": "off"
 | 
			
		||||
  },
 | 
			
		||||
  "cSpell.words": [
 | 
			
		||||
    "Infineon",
 | 
			
		||||
    "initialise",
 | 
			
		||||
    "Kanban",
 | 
			
		||||
    "VSIX"
 | 
			
		||||
    "Phares",
 | 
			
		||||
    "VSIX",
 | 
			
		||||
    "Weightest",
 | 
			
		||||
    "WSJF"
 | 
			
		||||
  ],
 | 
			
		||||
  "files.eol": "\n",
 | 
			
		||||
  "files.exclude": {
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										8
									
								
								type-script-helper/.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								type-script-helper/.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							@ -3,9 +3,14 @@
 | 
			
		||||
    "editor.wordWrap": "off"
 | 
			
		||||
  },
 | 
			
		||||
  "cSpell.words": [
 | 
			
		||||
    "Infineon",
 | 
			
		||||
    "initialise",
 | 
			
		||||
    "Kanban",
 | 
			
		||||
    "VSIX"
 | 
			
		||||
    "Phares",
 | 
			
		||||
    "signalr",
 | 
			
		||||
    "VSIX",
 | 
			
		||||
    "Weightest",
 | 
			
		||||
    "WSJF"
 | 
			
		||||
  ],
 | 
			
		||||
  "files.eol": "\n",
 | 
			
		||||
  "files.exclude": {
 | 
			
		||||
@ -16,6 +21,7 @@
 | 
			
		||||
  "files.watcherExclude": {
 | 
			
		||||
    "**/node_modules": true
 | 
			
		||||
  },
 | 
			
		||||
  "explorer.sortOrder": "default",
 | 
			
		||||
  "search.exclude": {
 | 
			
		||||
    "**/dist": true,
 | 
			
		||||
    "**/out": true
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										63
									
								
								type-script-helper/.vscode/tasks.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										63
									
								
								type-script-helper/.vscode/tasks.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,63 @@
 | 
			
		||||
{
 | 
			
		||||
    "tasks": [
 | 
			
		||||
        {
 | 
			
		||||
            "type": "npm",
 | 
			
		||||
            "script": "tsc-build",
 | 
			
		||||
            "group": "build",
 | 
			
		||||
            "problemMatcher": [],
 | 
			
		||||
            "label": "npm: tsc-build",
 | 
			
		||||
            "detail": "tsc"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "type": "npm",
 | 
			
		||||
            "script": "tsc-clean",
 | 
			
		||||
            "problemMatcher": [],
 | 
			
		||||
            "label": "npm: tsc-clean",
 | 
			
		||||
            "detail": "tsc --build --clean"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "type": "npm",
 | 
			
		||||
            "script": "vscode:package",
 | 
			
		||||
            "problemMatcher": [],
 | 
			
		||||
            "label": "npm: vscode:package",
 | 
			
		||||
            "detail": "node node_modules/@vscode/vsce/vsce package"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "type": "npm",
 | 
			
		||||
            "script": "vscode:login",
 | 
			
		||||
            "problemMatcher": [],
 | 
			
		||||
            "label": "npm: vscode:login",
 | 
			
		||||
            "detail": "node node_modules/@vscode/vsce/vsce login Infineon-Technologies-AG-Mesa-FI"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "type": "npm",
 | 
			
		||||
            "script": "vscode:ls-publishers",
 | 
			
		||||
            "problemMatcher": [],
 | 
			
		||||
            "label": "npm: vscode:ls-publishers",
 | 
			
		||||
            "detail": "node node_modules/@vscode/vsce/vsce ls-publishers"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "type": "npm",
 | 
			
		||||
            "script": "vscode:publish",
 | 
			
		||||
            "problemMatcher": [],
 | 
			
		||||
            "label": "npm: vscode:publish",
 | 
			
		||||
            "detail": "node node_modules/@vscode/vsce/vsce publish"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "type": "npm",
 | 
			
		||||
            "script": "watch",
 | 
			
		||||
            "group": "build",
 | 
			
		||||
            "problemMatcher": [],
 | 
			
		||||
            "label": "npm: watch",
 | 
			
		||||
            "detail": "concurrently \"rollup -c -w\" \"webpack --watch --config ./build/node-extension.webpack.config.js\""
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "type": "npm",
 | 
			
		||||
            "script": "webpack",
 | 
			
		||||
            "problemMatcher": [],
 | 
			
		||||
            "label": "npm: webpack",
 | 
			
		||||
            "detail": "webpack --config ./build/node-extension.webpack.config.js"
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "version": "2.0.0"
 | 
			
		||||
}
 | 
			
		||||
@ -156,3 +156,67 @@ None
 | 
			
		||||
 | 
			
		||||
- Copy Syntax In Light Theme
 | 
			
		||||
- [Copy-Syntax-in-Light](https://github.com/Ahmed-Adel-Morsi/Copy-Syntax-in-Light)
 | 
			
		||||
 | 
			
		||||
## 1.8.0 Wed Nov 06 2024 06:03:59 GMT-0700 (Mountain Standard Time)
 | 
			
		||||
-----------------------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- Change insert date to include epoch seconds and ticks *
 | 
			
		||||
 | 
			
		||||
## 1.9.0 1735586943373 = 638711837433730000 = Mon Dec 30 2024 12:29:02 GMT-0700 (Mountain Standard Time)
 | 
			
		||||
-----------------------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- Insert All Extensions (Not Disabled)
 | 
			
		||||
 | 
			
		||||
## 1.110.0 1735689397890 = 638712861978900000 = Tue Dec 31 2024 16:56:37 GMT-0700 (Mountain Standard Time)
 | 
			
		||||
-----------------------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- Open Sub-Kanban in New Window
 | 
			
		||||
 | 
			
		||||
## 1.111.0 1736196204601 = 638717930046010000 = 2025-0.Winter = Mon Jan 06 2025 13:43:24 GMT-0700 (Mountain Standard Time)
 | 
			
		||||
-----------------------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- Added season to insert date
 | 
			
		||||
- Removed
 | 
			
		||||
    - kanban.refreshBoth
 | 
			
		||||
    - kanban.refreshSidebar
 | 
			
		||||
    - kanban.refreshWebview
 | 
			
		||||
    - kanban.debugReload
 | 
			
		||||
    - columns-to-cards-webview-view-provider-view
 | 
			
		||||
 | 
			
		||||
- Open Sub-Kanban in New Window
 | 
			
		||||
 | 
			
		||||
## 1.111.1 1738206291411 = 638738030914110000 = 2025-0.Winter = Wed Jan 29 2025 20:04:50 GMT-0700 (Mountain Standard Time)
 | 
			
		||||
-----------------------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- Changed trigger for code-insiders
 | 
			
		||||
 | 
			
		||||
## 1.112.0 1738349146299 = 638739459462990000 = 2025-0.Winter = Fri Jan 31 2025 11:45:45 GMT-0700 (Mountain Standard Time)
 | 
			
		||||
-----------------------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- Added Cost of Delay (CoD)
 | 
			
		||||
 | 
			
		||||
## 1.113.0 1739287994496 = 638748847944960000 = 2025-0.Winter = Tue Feb 11 2025 08:33:14 GMT-0700 (Mountain Standard Time)
 | 
			
		||||
-----------------------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- Add Code Insiders lines when not present
 | 
			
		||||
 | 
			
		||||
## 1.114.0 1739295723637 = 638748925236370000 = 2025-0.Winter = Tue Feb 11 2025 10:42:03 GMT-0700 (Mountain Standard Time)
 | 
			
		||||
-----------------------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- infineon-mes-mike-phares
 | 
			
		||||
 | 
			
		||||
## 1.115.0 1739295727065 = 638748925270650000 = 2025-0.Winter = Tue Feb 11 2025 10:42:06 GMT-0700 (Mountain Standard Time)
 | 
			
		||||
-----------------------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- Infineon-Technologies-AG-Mesa-FI
 | 
			
		||||
 | 
			
		||||
## 1.116.0 1740441381597 = 638760381815970000 = 2025-0.Winter = Mon Feb 24 2025 16:56:21 GMT-0700 (Mountain Standard Time)
 | 
			
		||||
-----------------------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- Calculator
 | 
			
		||||
- Explorer Sort Order
 | 
			
		||||
 | 
			
		||||
## 1.117.0 1740671831803 = 638762686318030000 = 2025-0.Winter = Thu Feb 27 2025 08:57:11 GMT-0700 (Mountain Standard Time)
 | 
			
		||||
-----------------------------------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
- Close active after opening Sub-Kanban when directory found
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										20
									
								
								type-script-helper/media/bootstrap.min.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								type-script-helper/media/bootstrap.min.css
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										37
									
								
								type-script-helper/media/cod.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								type-script-helper/media/cod.css
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,37 @@
 | 
			
		||||
#HeaderGridDiv,
 | 
			
		||||
#DetailsGridDiv {
 | 
			
		||||
    font-size: 12px;
 | 
			
		||||
    min-width: 1200px;
 | 
			
		||||
    max-width: 1200px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#HeaderGrid {
 | 
			
		||||
    font-family: monospace;
 | 
			
		||||
    margin-top: 60px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#HeaderGrid tr td {
 | 
			
		||||
    max-width: 200px;
 | 
			
		||||
    padding: 5px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#AllGrid {
 | 
			
		||||
    font-family: monospace;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.navbar-brand {
 | 
			
		||||
    min-width: 1200px;
 | 
			
		||||
    background-color: whitesmoke;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
tr:nth-of-type(odd) {
 | 
			
		||||
    background-color: #eee;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#AllTextarea {
 | 
			
		||||
    font-family: monospace;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#th-span {
 | 
			
		||||
    margin-right: 500px;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										50
									
								
								type-script-helper/media/cost-of-delay.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								type-script-helper/media/cost-of-delay.js
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,50 @@
 | 
			
		||||
$(document).ready(function () {
 | 
			
		||||
    const fromHtml = true;
 | 
			
		||||
    const username = _webviewUsername;
 | 
			
		||||
    const machineId = _webviewMachineId;
 | 
			
		||||
    const windowLocationHRef = window.location.href + '?site=' + _webviewSite + 'view=' + _webviewView;
 | 
			
		||||
    const baseUri = 'https://eaf-dev.mes.infineon.com';
 | 
			
		||||
    const apiUrl = 'https://oi-metrology-viewer-prod.mes.infineon.com:4438/api/v1/ado/';
 | 
			
		||||
    const signalRUrl = baseUri + '/signalr';
 | 
			
		||||
    const workItems = {
 | 
			
		||||
        a: baseUri + '/markdown/bugs-features-with-parents.json?v=2025-01-22-10-49',
 | 
			
		||||
        b: baseUri + '/markdown/{[]}.json?v=2025-01-22-10-49'
 | 
			
		||||
    };
 | 
			
		||||
    const b = {
 | 
			
		||||
        page: 'business',
 | 
			
		||||
        description: 'Value',
 | 
			
		||||
        th: 'Business Value',
 | 
			
		||||
        span: 'What is the relative value to the Customer or business?<br>• Do our users prefer this over that?<br>• What is the revenue impact on our business?<br>• Is there a potential penalty or other negative effects if we delay?'
 | 
			
		||||
    };
 | 
			
		||||
    const r = {
 | 
			
		||||
        page: 'risk',
 | 
			
		||||
        description: 'Risk',
 | 
			
		||||
        th: 'Risk Reduction and/or Opportunity Enablement',
 | 
			
		||||
        span: 'What else does this do for our business?<br>• Reduce the risk of this or future delivery?<br>• Is there value in the information we will receive?<br>• Enable new business opportunities?'
 | 
			
		||||
    };
 | 
			
		||||
    const t = {
 | 
			
		||||
        page: 'time',
 | 
			
		||||
        description: 'Critical',
 | 
			
		||||
        th: 'Time Criticality',
 | 
			
		||||
        span: 'How does user/business value decay over time?<br>• Is there a fixed deadline?<br>• Will they wait for us or move to another Solution?<br>• What is the current effect on Customer satisfaction?'
 | 
			
		||||
    };
 | 
			
		||||
    const c = {
 | 
			
		||||
        page: 'cod',
 | 
			
		||||
        description: 'CoD',
 | 
			
		||||
        th: 'Cost of Delay (CoD)',
 | 
			
		||||
        span: "Cost of Delay (CoD) is the money lost by delaying or not doing a job for a specific time. It's a measure of the economic value of a job over time."
 | 
			
		||||
    };
 | 
			
		||||
    const e = {
 | 
			
		||||
        page: 'effort',
 | 
			
		||||
        description: 'Effort',
 | 
			
		||||
        th: 'Effort',
 | 
			
		||||
        span: 'Effort'
 | 
			
		||||
    };
 | 
			
		||||
    const w = {
 | 
			
		||||
        page: 'wsjf',
 | 
			
		||||
        description: 'WSJF',
 | 
			
		||||
        th: 'Weightest Shortest Job First calculation (WSJF)',
 | 
			
		||||
        span: 'Weightest Shortest Job First calculation (see @SCALE formula)'
 | 
			
		||||
    };
 | 
			
		||||
    initIndex(fromHtml, username, machineId, windowLocationHRef, workItems, b, r, t, c, e, w, apiUrl, signalRUrl);
 | 
			
		||||
});
 | 
			
		||||
							
								
								
									
										4
									
								
								type-script-helper/media/jquery-1.6.4.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								type-script-helper/media/jquery-1.6.4.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										9
									
								
								type-script-helper/media/jquery.signalR-2.4.3.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								type-script-helper/media/jquery.signalR-2.4.3.min.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										15143
									
								
								type-script-helper/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										15143
									
								
								type-script-helper/package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -1,32 +1,42 @@
 | 
			
		||||
{
 | 
			
		||||
  "activationEvents": [],
 | 
			
		||||
  "activationEvents": [
 | 
			
		||||
    "onLanguage:csharp",
 | 
			
		||||
    "onLanguage:markdown",
 | 
			
		||||
    "onLanguage:javascript",
 | 
			
		||||
    "onLanguage:json",
 | 
			
		||||
    "onLanguage:typescript",
 | 
			
		||||
    "onLanguage:yaml"
 | 
			
		||||
  ],
 | 
			
		||||
  "categories": [
 | 
			
		||||
    "Other"
 | 
			
		||||
  ],
 | 
			
		||||
  "contributes": {
 | 
			
		||||
    "configuration": {
 | 
			
		||||
      "type": "object",
 | 
			
		||||
      "title": "Type Script Helper Configuration",
 | 
			
		||||
      "properties": {
 | 
			
		||||
        "fileTemplates.author": {
 | 
			
		||||
          "type": [
 | 
			
		||||
            "string",
 | 
			
		||||
            "null"
 | 
			
		||||
          ],
 | 
			
		||||
          "default": null,
 | 
			
		||||
          "description": "Value to use to replace #{author} variable."
 | 
			
		||||
        },
 | 
			
		||||
        "fileTemplates.company": {
 | 
			
		||||
          "type": [
 | 
			
		||||
            "string",
 | 
			
		||||
            "null"
 | 
			
		||||
          ],
 | 
			
		||||
          "default": null,
 | 
			
		||||
          "description": "Value to use to replace #{company} variable."
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "commands": [
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Calculate",
 | 
			
		||||
        "command": "extension.calcAppendWithCursor",
 | 
			
		||||
        "title": "Calculate and append in front of cursor"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Calculate",
 | 
			
		||||
        "command": "extension.calcAppend",
 | 
			
		||||
        "title": "Calculate and append"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Calculate",
 | 
			
		||||
        "command": "extension.calcReplaceWithCursor",
 | 
			
		||||
        "title": "Calculate and replace in front of cursor"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Explorer", 
 | 
			
		||||
        "command": "extension.rotateExplorerSortOrder",
 | 
			
		||||
        "title": "Rotate Explorer Sort Order"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Calculate",
 | 
			
		||||
        "command": "extension.calcReplace",
 | 
			
		||||
        "title": "Calculate and replace"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Helper",
 | 
			
		||||
        "command": "copyHelper.copySyntaxInLight",
 | 
			
		||||
@ -47,6 +57,11 @@
 | 
			
		||||
        "command": "promiseLinesHelper.insertDateTime",
 | 
			
		||||
        "title": "Insert DateTime"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Helper",
 | 
			
		||||
        "command": "promiseLinesHelper.insertAllExtensions",
 | 
			
		||||
        "title": "Insert All Extensions (Not Disabled)"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Helper",
 | 
			
		||||
        "command": "promiseLinesHelper.transformToParamCase",
 | 
			
		||||
@ -64,34 +79,59 @@
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Kanban",
 | 
			
		||||
        "command": "kanban.refreshBoth",
 | 
			
		||||
        "title": "Refresh Kanban Both"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Kanban",
 | 
			
		||||
        "command": "kanban.refreshSidebar",
 | 
			
		||||
        "title": "Refresh Kanban Sidebar"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Kanban",
 | 
			
		||||
        "command": "kanban.refreshWebView",
 | 
			
		||||
        "title": "Refresh Kanban WebView"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Kanban",
 | 
			
		||||
        "command": "kanban.debugReload",
 | 
			
		||||
        "title": "Debug Reload Kanban"
 | 
			
		||||
        "command": "kanban.openInNewWindow",
 | 
			
		||||
        "title": "Open Sub-Kanban in New Window"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Kanban",
 | 
			
		||||
        "command": "kanban.openWithTextEditor",
 | 
			
		||||
        "title": "Open with Text Editor Kanban"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Leominster",
 | 
			
		||||
        "command": "webview.costOfDelayLeominster",
 | 
			
		||||
        "title": "Cost of Delay (CoD)"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Leominster",
 | 
			
		||||
        "command": "webview.costOfDelayLiveLeominster",
 | 
			
		||||
        "title": "Cost of Delay (CoD) - Live Update"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Leominster",
 | 
			
		||||
        "command": "webview.costOfDelayEffortLeominster",
 | 
			
		||||
        "title": "Effort"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Leominster",
 | 
			
		||||
        "command": "webview.costOfDelayWSJFLeominster",
 | 
			
		||||
        "title": "Weightest Shortest Job First calculation (WSJF)"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Markdown",
 | 
			
		||||
        "command": "markdown.newMarkdownFile",
 | 
			
		||||
        "title": "New Markdown File"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Mesa",
 | 
			
		||||
        "command": "webview.costOfDelayMesa",
 | 
			
		||||
        "title": "Cost of Delay (CoD)"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Mesa",
 | 
			
		||||
        "command": "webview.costOfDelayLiveMesa",
 | 
			
		||||
        "title": "Cost of Delay (CoD) - Live Update"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Mesa",
 | 
			
		||||
        "command": "webview.costOfDelayEffortMesa",
 | 
			
		||||
        "title": "Effort"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Mesa",
 | 
			
		||||
        "command": "webview.costOfDelayWSJFMesa",
 | 
			
		||||
        "title": "Weightest Shortest Job First calculation (WSJF)"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "Quick Fix",
 | 
			
		||||
        "command": "replaceLinesHelper.quickFixCamelCaseProperties",
 | 
			
		||||
@ -198,37 +238,39 @@
 | 
			
		||||
        "title": "Wrap Sql for VB"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "category": "WebView",
 | 
			
		||||
        "command": "webView.webView",
 | 
			
		||||
        "title": "Web View"
 | 
			
		||||
        "category": "Webview",
 | 
			
		||||
        "command": "webview.example",
 | 
			
		||||
        "title": "Webview Example"
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
    "views": {
 | 
			
		||||
      "columns-to-cards-webview-view-provider-view": [
 | 
			
		||||
        {
 | 
			
		||||
          "contextualTitle": "Kanban",
 | 
			
		||||
          "icon": "media/checklist.svg",
 | 
			
		||||
          "id": "columns-to-cards-webview-view-provider",
 | 
			
		||||
          "name": "Kanban",
 | 
			
		||||
          "type": "webview"
 | 
			
		||||
    "configuration": {
 | 
			
		||||
      "properties": {
 | 
			
		||||
        "fileTemplates.author": {
 | 
			
		||||
          "default": null,
 | 
			
		||||
          "description": "Value to use to replace #{author} variable.",
 | 
			
		||||
          "type": [
 | 
			
		||||
            "string",
 | 
			
		||||
            "Mike Phares"
 | 
			
		||||
          ]
 | 
			
		||||
        },
 | 
			
		||||
        "fileTemplates.company": {
 | 
			
		||||
          "default": null,
 | 
			
		||||
          "description": "Value to use to replace #{company} variable.",
 | 
			
		||||
          "type": [
 | 
			
		||||
            "string",
 | 
			
		||||
            "Infineon Technologies Americas Corp."
 | 
			
		||||
          ]
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
    },
 | 
			
		||||
    "viewsContainers": {
 | 
			
		||||
      "activitybar": [
 | 
			
		||||
        {
 | 
			
		||||
          "icon": "media/checklist.svg",
 | 
			
		||||
          "id": "columns-to-cards-webview-view-provider-view",
 | 
			
		||||
          "title": "Kanban"
 | 
			
		||||
        }
 | 
			
		||||
      ]
 | 
			
		||||
      },
 | 
			
		||||
      "title": "Cost of Delay Helper Configuration",
 | 
			
		||||
      "type": "object"
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@vscode/vsce": "^2.19.0",
 | 
			
		||||
    "@vscode/vsce": "^3.2.1",
 | 
			
		||||
    "polka": "^0.5.2"
 | 
			
		||||
  },
 | 
			
		||||
  "description": "Helper for VS Code in TypeScript",
 | 
			
		||||
  "description": "Cost of Delay Helper",
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@nodelib/fs.stat": "^3.0.0",
 | 
			
		||||
    "@types/mocha": "^10.0.6",
 | 
			
		||||
@ -239,6 +281,7 @@
 | 
			
		||||
    "@vscode/test-electron": "^2.4.0",
 | 
			
		||||
    "@vscode/test-web": "*",
 | 
			
		||||
    "concurrently": "^8.2.2",
 | 
			
		||||
    "editor-calc": "^2.1.0",
 | 
			
		||||
    "eslint": "^8.25.0",
 | 
			
		||||
    "eslint-config-prettier": "^8.5.0",
 | 
			
		||||
    "eslint-plugin-prettier": "^4.2.1",
 | 
			
		||||
@ -250,19 +293,35 @@
 | 
			
		||||
    "webpack": "^5.74.0",
 | 
			
		||||
    "webpack-cli": "^4.10.0"
 | 
			
		||||
  },
 | 
			
		||||
  "displayName": "Type Script Helper",
 | 
			
		||||
  "displayName": "Cost of Delay Helper",
 | 
			
		||||
  "engines": {
 | 
			
		||||
    "vscode": "^1.79.0"
 | 
			
		||||
  },
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "Backlog",
 | 
			
		||||
    "CoD",
 | 
			
		||||
    "Cost of Delay (CoD)",
 | 
			
		||||
    "FI",
 | 
			
		||||
    "Infineon",
 | 
			
		||||
    "Leominster",
 | 
			
		||||
    "Mesa",
 | 
			
		||||
    "Phares",
 | 
			
		||||
    "Weightest Shortest Job First calculation (WSJF)",
 | 
			
		||||
    "WSJF"
 | 
			
		||||
  ],
 | 
			
		||||
  "main": "./dist/extension.js",
 | 
			
		||||
  "name": "type-script-helper",
 | 
			
		||||
  "publisher": "IFX",
 | 
			
		||||
  "repository": "https://github.com/mikepharesjr/YO-VSCode/tree/master/type-script-helper",
 | 
			
		||||
  "name": "infineon-technologies-ag-mesa-fi-cost-of-delay-helper",
 | 
			
		||||
  "publisher": "Infineon-Technologies-AG-Mesa-FI",
 | 
			
		||||
  "repository": "https://gitea.phares.duckdns.org/phares3757/yo-vscode.git",
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "tsc-build": "tsc",
 | 
			
		||||
    "vscode:publish": "node node_modules/@vscode/vsce/vsce package",
 | 
			
		||||
    "webpack": "webpack --config ./build/node-extension.webpack.config.js",
 | 
			
		||||
    "watch": "concurrently \"rollup -c -w\" \"webpack --watch --config ./build/node-extension.webpack.config.js\""
 | 
			
		||||
    "tsc-clean": "tsc --build --clean",
 | 
			
		||||
    "vscode:package": "node node_modules/@vscode/vsce/vsce package",
 | 
			
		||||
    "vscode:login": "node node_modules/@vscode/vsce/vsce login Infineon-Technologies-AG-Mesa-FI",
 | 
			
		||||
    "vscode:ls-publishers": "node node_modules/@vscode/vsce/vsce ls-publishers",
 | 
			
		||||
    "vscode:publish": "node node_modules/@vscode/vsce/vsce publish",
 | 
			
		||||
    "watch": "concurrently \"rollup -c -w\" \"webpack --watch --config ./build/node-extension.webpack.config.js\"",
 | 
			
		||||
    "webpack": "webpack --config ./build/node-extension.webpack.config.js"
 | 
			
		||||
  },
 | 
			
		||||
  "version": "1.7.0"
 | 
			
		||||
}
 | 
			
		||||
  "version": "1.117.0"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										217
									
								
								type-script-helper/src/WebviewPanelCostOfDelay.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										217
									
								
								type-script-helper/src/WebviewPanelCostOfDelay.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,217 @@
 | 
			
		||||
import * as vscode from "vscode";
 | 
			
		||||
import { getNonce } from "./getNonce";
 | 
			
		||||
import { apiBaseUrl } from "./constants";
 | 
			
		||||
import { PostMessage } from "./PostMessage";
 | 
			
		||||
import { title } from "process";
 | 
			
		||||
 | 
			
		||||
export class WebviewPanelCostOfDelay {
 | 
			
		||||
  /**
 | 
			
		||||
   * Track the currently panel. Only allow a single panel to exist at a time.
 | 
			
		||||
   */
 | 
			
		||||
  public static _site: string;
 | 
			
		||||
  public static _view: string;
 | 
			
		||||
  public static currentPanel: WebviewPanelCostOfDelay | undefined;
 | 
			
		||||
 | 
			
		||||
  public static readonly viewType = "web-view-panel";
 | 
			
		||||
 | 
			
		||||
  private _disposables: vscode.Disposable[] = [];
 | 
			
		||||
 | 
			
		||||
  public static createOrShow(extensionContext: vscode.ExtensionContext, site: string, view: string) {
 | 
			
		||||
    this._site = site;
 | 
			
		||||
    this._view = view;
 | 
			
		||||
 | 
			
		||||
    const column = vscode.window.activeTextEditor
 | 
			
		||||
      ? vscode.window.activeTextEditor.viewColumn
 | 
			
		||||
      : undefined;
 | 
			
		||||
 | 
			
		||||
    // If we already have a panel, show it.
 | 
			
		||||
    if (WebviewPanelCostOfDelay.currentPanel) {
 | 
			
		||||
      WebviewPanelCostOfDelay.currentPanel._panel.reveal(column);
 | 
			
		||||
      WebviewPanelCostOfDelay.currentPanel._update(site, view);
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const title = view === '' ? 'Cost of Delay (CoD)' :
 | 
			
		||||
      view === 'EFFORT' ? 'Effort' :
 | 
			
		||||
        view === 'LIVE' ? 'Cost of Delay (CoD) - Live Update' :
 | 
			
		||||
          view === 'WSJF' ? 'Weightest Shortest Job First calculation (WSJF)' :
 | 
			
		||||
            'CoD';
 | 
			
		||||
 | 
			
		||||
    // Otherwise, create a new panel.
 | 
			
		||||
    const panel = vscode.window.createWebviewPanel(
 | 
			
		||||
      WebviewPanelCostOfDelay.viewType,
 | 
			
		||||
      title,
 | 
			
		||||
      column || vscode.ViewColumn.One,
 | 
			
		||||
      {
 | 
			
		||||
        // Enable javascript in the webview
 | 
			
		||||
        enableScripts: true,
 | 
			
		||||
 | 
			
		||||
        // And restrict the webview to only loading content from our extension's `media` directory.
 | 
			
		||||
        localResourceRoots: [
 | 
			
		||||
          vscode.Uri.joinPath(extensionContext.extensionUri, "media"),
 | 
			
		||||
          vscode.Uri.joinPath(extensionContext.extensionUri, "out/compiled"),
 | 
			
		||||
        ],
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    WebviewPanelCostOfDelay.currentPanel = new WebviewPanelCostOfDelay(panel, extensionContext, site, view);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public static kill() {
 | 
			
		||||
    WebviewPanelCostOfDelay.currentPanel?.dispose();
 | 
			
		||||
    WebviewPanelCostOfDelay.currentPanel = undefined;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public static revive(panel: vscode.WebviewPanel, extensionContext: vscode.ExtensionContext) {
 | 
			
		||||
    WebviewPanelCostOfDelay.currentPanel = new WebviewPanelCostOfDelay(panel, extensionContext, this._site, this._view);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private constructor(private readonly _panel: vscode.WebviewPanel, private readonly _extensionContext: vscode.ExtensionContext, site: string, view: string) {
 | 
			
		||||
 | 
			
		||||
    // Set the webview's initial html content
 | 
			
		||||
    this._update(site, view);
 | 
			
		||||
 | 
			
		||||
    // Listen for when the panel is disposed
 | 
			
		||||
    // This happens when the user closes the panel or when the panel is closed programmatically
 | 
			
		||||
    this._panel.onDidDispose(() => this.dispose(), null, this._disposables);
 | 
			
		||||
 | 
			
		||||
    // // Handle messages from the webview
 | 
			
		||||
    // this._panel.webview.onDidReceiveMessage(
 | 
			
		||||
    //   (message) => {
 | 
			
		||||
    //     switch (message.command) {
 | 
			
		||||
    //       case "alert":
 | 
			
		||||
    //         vscode.window.showErrorMessage(message.text);
 | 
			
		||||
    //         return;
 | 
			
		||||
    //     }
 | 
			
		||||
    //   },
 | 
			
		||||
    //   null,
 | 
			
		||||
    //   this._disposables
 | 
			
		||||
    // );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public dispose() {
 | 
			
		||||
    WebviewPanelCostOfDelay.currentPanel = undefined;
 | 
			
		||||
 | 
			
		||||
    // Clean up our resources
 | 
			
		||||
    this._panel.dispose();
 | 
			
		||||
 | 
			
		||||
    while (this._disposables.length) {
 | 
			
		||||
      const x = this._disposables.pop();
 | 
			
		||||
      if (x) {
 | 
			
		||||
        x.dispose();
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private async _update(site: string, view: string) {
 | 
			
		||||
    const webview = this._panel.webview;
 | 
			
		||||
 | 
			
		||||
    this._panel.webview.html = this._getHtmlForWebview(site, view, webview);
 | 
			
		||||
    webview.onDidReceiveMessage(async (postMessage: PostMessage) => {
 | 
			
		||||
      switch (postMessage.type) {
 | 
			
		||||
        case "on-info":
 | 
			
		||||
          if (!postMessage.value)
 | 
			
		||||
            return;
 | 
			
		||||
          vscode.window.showInformationMessage(postMessage.value);
 | 
			
		||||
          break;
 | 
			
		||||
        case "on-error":
 | 
			
		||||
          if (!postMessage.value)
 | 
			
		||||
            return;
 | 
			
		||||
          vscode.window.showErrorMessage(postMessage.value);
 | 
			
		||||
          break;
 | 
			
		||||
        default:
 | 
			
		||||
          vscode.window.showErrorMessage(postMessage.type);
 | 
			
		||||
          break;
 | 
			
		||||
      }
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private _getHtmlForWebview(site: string, view: string, webview: vscode.Webview) {
 | 
			
		||||
    const baseUri = 'https://eaf-dev.mes.infineon.com';
 | 
			
		||||
 | 
			
		||||
    const styleBootstrapUri = webview.asWebviewUri(
 | 
			
		||||
      vscode.Uri.joinPath(this._extensionContext.extensionUri, "media", "bootstrap.min.css")
 | 
			
		||||
    );
 | 
			
		||||
    const styleCostOfDelayUri = webview.asWebviewUri(
 | 
			
		||||
      vscode.Uri.joinPath(this._extensionContext.extensionUri, "media", "cod.css")
 | 
			
		||||
    );
 | 
			
		||||
    const scriptJQueryUri = webview.asWebviewUri(
 | 
			
		||||
      vscode.Uri.joinPath(this._extensionContext.extensionUri, "media", "jquery-1.6.4.min.js")
 | 
			
		||||
    );
 | 
			
		||||
    const scriptSignalRUri = webview.asWebviewUri(
 | 
			
		||||
      vscode.Uri.joinPath(this._extensionContext.extensionUri, "media", "jquery.signalR-2.4.3.min.js")
 | 
			
		||||
    );
 | 
			
		||||
    const scriptCostOfDelayUri = webview.asWebviewUri(
 | 
			
		||||
      vscode.Uri.joinPath(this._extensionContext.extensionUri, "media", "cost-of-delay.js")
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    // Use a nonce to only allow a specific script to be run.
 | 
			
		||||
    const nonce = getNonce();
 | 
			
		||||
 | 
			
		||||
    return `<!DOCTYPE html>
 | 
			
		||||
      <html lang="en">
 | 
			
		||||
 | 
			
		||||
      <head>
 | 
			
		||||
          <meta charset="UTF-8">
 | 
			
		||||
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
			
		||||
          <title>Infineon - Cost of Delay (CoD) (see @SCALE formula)</title>
 | 
			
		||||
          <link href="${styleBootstrapUri}" rel="stylesheet" />
 | 
			
		||||
          <link href="${styleCostOfDelayUri}" rel="stylesheet" />
 | 
			
		||||
          <script nonce="${nonce}" src="${scriptJQueryUri}"></script>
 | 
			
		||||
          <script nonce="${nonce}" src="${scriptSignalRUri}"></script>
 | 
			
		||||
          <script nonce="${nonce}" src="${baseUri}/signalr/hubs"></script>
 | 
			
		||||
          <script nonce="${nonce}" src="${baseUri}/js/cod-b.js?v=2025-01-22-10-49" type="text/javascript"></script>
 | 
			
		||||
          <script nonce="${nonce}">
 | 
			
		||||
            const _webviewSite = '${site}';
 | 
			
		||||
            const _webviewView = '${view}';
 | 
			
		||||
            const acquiredVsCodeApi = acquireVsCodeApi();
 | 
			
		||||
            const apiBaseUrl = ${JSON.stringify(apiBaseUrl)}
 | 
			
		||||
            const _webviewUsername = '${process.env.USERNAME}';
 | 
			
		||||
            const _webviewMachineId = '${vscode.env.machineId}';
 | 
			
		||||
          </script>
 | 
			
		||||
      </head>
 | 
			
		||||
 | 
			
		||||
      <body>
 | 
			
		||||
          <div class="navbar navbar-fixed-top">
 | 
			
		||||
              <div class="container-fluid">
 | 
			
		||||
                  <div class="navbar-header">
 | 
			
		||||
                      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
 | 
			
		||||
                          <span class="icon-bar"></span>
 | 
			
		||||
                          <span class="icon-bar"></span>
 | 
			
		||||
                          <span class="icon-bar"></span>
 | 
			
		||||
                      </button>
 | 
			
		||||
                      <div class="navbar-brand">
 | 
			
		||||
                          <span id="siteHeader"> </span> -
 | 
			
		||||
                          <span id="th-span"> </span>
 | 
			
		||||
                          <button id="toggle">Toggle</button>
 | 
			
		||||
                      </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                  <div class="navbar-collapse collapse">
 | 
			
		||||
                      <ul class="nav navbar-nav">
 | 
			
		||||
                      </ul>
 | 
			
		||||
                      <p class="navbar-text navbar-right">
 | 
			
		||||
                           
 | 
			
		||||
                      </p>
 | 
			
		||||
                  </div>
 | 
			
		||||
              </div>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="container-fluid body-content" style="margin-top: 40px; margin-left: 15px;">
 | 
			
		||||
              <div id="HeaderGridDiv">
 | 
			
		||||
                  <table id="HeaderGrid" border="1"></table>
 | 
			
		||||
              </div>
 | 
			
		||||
 | 
			
		||||
              <br /> 
 | 
			
		||||
 | 
			
		||||
              <div id="AllGridDiv">
 | 
			
		||||
                  <table id="AllGrid"></table>
 | 
			
		||||
              </div>
 | 
			
		||||
 | 
			
		||||
              <textarea id="AllTextarea" rows="20" cols="147"></textarea>
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
				<script nonce="${nonce}" src="${scriptCostOfDelayUri}"></script>
 | 
			
		||||
      </body>
 | 
			
		||||
 | 
			
		||||
      </html>`;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -3,16 +3,16 @@ import { getNonce } from "./getNonce";
 | 
			
		||||
import { apiBaseUrl } from "./constants";
 | 
			
		||||
import { PostMessage } from "./PostMessage";
 | 
			
		||||
 | 
			
		||||
export function refreshWebView(extensionContext: vscode.ExtensionContext): any {
 | 
			
		||||
  WebViewPanel.kill();
 | 
			
		||||
  WebViewPanel.createOrShow(extensionContext);
 | 
			
		||||
export function refreshWebviewPanelExample(extensionContext: vscode.ExtensionContext): any {
 | 
			
		||||
  WebviewPanelExample.kill();
 | 
			
		||||
  WebviewPanelExample.createOrShow(extensionContext);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export class WebViewPanel {
 | 
			
		||||
export class WebviewPanelExample {
 | 
			
		||||
  /**
 | 
			
		||||
   * Track the currently panel. Only allow a single panel to exist at a time.
 | 
			
		||||
   */
 | 
			
		||||
  public static currentPanel: WebViewPanel | undefined;
 | 
			
		||||
  public static currentPanel: WebviewPanelExample | undefined;
 | 
			
		||||
 | 
			
		||||
  public static readonly viewType = "web-view-panel";
 | 
			
		||||
 | 
			
		||||
@ -24,15 +24,15 @@ export class WebViewPanel {
 | 
			
		||||
      : undefined;
 | 
			
		||||
 | 
			
		||||
    // If we already have a panel, show it.
 | 
			
		||||
    if (WebViewPanel.currentPanel) {
 | 
			
		||||
      WebViewPanel.currentPanel._panel.reveal(column);
 | 
			
		||||
      WebViewPanel.currentPanel._update();
 | 
			
		||||
    if (WebviewPanelExample.currentPanel) {
 | 
			
		||||
      WebviewPanelExample.currentPanel._panel.reveal(column);
 | 
			
		||||
      WebviewPanelExample.currentPanel._update();
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Otherwise, create a new panel.
 | 
			
		||||
    const panel = vscode.window.createWebviewPanel(
 | 
			
		||||
      WebViewPanel.viewType,
 | 
			
		||||
      WebviewPanelExample.viewType,
 | 
			
		||||
      "Web-View-Panel",
 | 
			
		||||
      column || vscode.ViewColumn.One,
 | 
			
		||||
      {
 | 
			
		||||
@ -47,16 +47,16 @@ export class WebViewPanel {
 | 
			
		||||
      }
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    WebViewPanel.currentPanel = new WebViewPanel(panel, extensionContext);
 | 
			
		||||
    WebviewPanelExample.currentPanel = new WebviewPanelExample(panel, extensionContext);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public static kill() {
 | 
			
		||||
    WebViewPanel.currentPanel?.dispose();
 | 
			
		||||
    WebViewPanel.currentPanel = undefined;
 | 
			
		||||
    WebviewPanelExample.currentPanel?.dispose();
 | 
			
		||||
    WebviewPanelExample.currentPanel = undefined;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public static revive(panel: vscode.WebviewPanel, extensionContext: vscode.ExtensionContext) {
 | 
			
		||||
    WebViewPanel.currentPanel = new WebViewPanel(panel, extensionContext);
 | 
			
		||||
    WebviewPanelExample.currentPanel = new WebviewPanelExample(panel, extensionContext);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private constructor(private readonly _panel: vscode.WebviewPanel, private readonly _extensionContext: vscode.ExtensionContext) {
 | 
			
		||||
@ -83,7 +83,7 @@ export class WebViewPanel {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public dispose() {
 | 
			
		||||
    WebViewPanel.currentPanel = undefined;
 | 
			
		||||
    WebviewPanelExample.currentPanel = undefined;
 | 
			
		||||
 | 
			
		||||
    // Clean up our resources
 | 
			
		||||
    this._panel.dispose();
 | 
			
		||||
							
								
								
									
										193
									
								
								type-script-helper/src/calculator.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										193
									
								
								type-script-helper/src/calculator.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,193 @@
 | 
			
		||||
import * as vscode from 'vscode';
 | 
			
		||||
import * as editorCalc from 'editor-calc';
 | 
			
		||||
 | 
			
		||||
export class CalcProvider implements vscode.CompletionItemProvider {
 | 
			
		||||
  public enableActive: boolean;
 | 
			
		||||
 | 
			
		||||
  private decorationType: vscode.TextEditorDecorationType;
 | 
			
		||||
 | 
			
		||||
  constructor(
 | 
			
		||||
    public config: vscode.WorkspaceConfiguration,
 | 
			
		||||
    private onError: (error: unknown) => any,
 | 
			
		||||
  ) {
 | 
			
		||||
    this.enableActive = false;
 | 
			
		||||
    this.decorationType = vscode.window.createTextEditorDecorationType({
 | 
			
		||||
      dark: {
 | 
			
		||||
        border: '1px dashed gray',
 | 
			
		||||
      },
 | 
			
		||||
      light: {
 | 
			
		||||
        border: '1px dashed black',
 | 
			
		||||
      },
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public async highlight(range: vscode.Range) {
 | 
			
		||||
    const editor = vscode.window.activeTextEditor;
 | 
			
		||||
    if (editor) {
 | 
			
		||||
      editor.setDecorations(this.decorationType, [range]);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public async clearHighlight() {
 | 
			
		||||
    const editor = vscode.window.activeTextEditor;
 | 
			
		||||
    if (editor) {
 | 
			
		||||
      editor.setDecorations(this.decorationType, []);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public calculateLine(
 | 
			
		||||
    position: vscode.Position,
 | 
			
		||||
    exprLine: string,
 | 
			
		||||
  ): {
 | 
			
		||||
    skip: number;
 | 
			
		||||
    result: string;
 | 
			
		||||
    insertText: string;
 | 
			
		||||
    expressionRange: vscode.Range;
 | 
			
		||||
    expressionWithEqualSignRange: vscode.Range;
 | 
			
		||||
    expressionEndRange: vscode.Range;
 | 
			
		||||
  } | null {
 | 
			
		||||
    let skip, result;
 | 
			
		||||
    try {
 | 
			
		||||
      ({ skip, result } = editorCalc.calculate(exprLine));
 | 
			
		||||
    } catch (error) {
 | 
			
		||||
      this.onError(error);
 | 
			
		||||
      return null;
 | 
			
		||||
    }
 | 
			
		||||
    const formulaRaw = exprLine.slice(skip);
 | 
			
		||||
    const leftMatches = formulaRaw.match(/^\s+/);
 | 
			
		||||
    const leftEmpty = leftMatches ? leftMatches[0].length : 0;
 | 
			
		||||
    const rightMatches = formulaRaw.match(/[\s=]+$/);
 | 
			
		||||
    const rightEmpty = rightMatches ? rightMatches[0].length : 0;
 | 
			
		||||
 | 
			
		||||
    const insertText = exprLine.endsWith(' =') ? ` ${result}` : result;
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
      skip,
 | 
			
		||||
      result,
 | 
			
		||||
      insertText,
 | 
			
		||||
      expressionRange: new vscode.Range(
 | 
			
		||||
        position.line,
 | 
			
		||||
        skip + leftEmpty,
 | 
			
		||||
        position.line,
 | 
			
		||||
        position.character - rightEmpty,
 | 
			
		||||
      ),
 | 
			
		||||
      expressionWithEqualSignRange: new vscode.Range(
 | 
			
		||||
        position.line,
 | 
			
		||||
        skip + leftEmpty,
 | 
			
		||||
        position.line,
 | 
			
		||||
        position.character,
 | 
			
		||||
      ),
 | 
			
		||||
      expressionEndRange: new vscode.Range(
 | 
			
		||||
        position.line,
 | 
			
		||||
        position.character,
 | 
			
		||||
        position.line,
 | 
			
		||||
        position.character,
 | 
			
		||||
      ),
 | 
			
		||||
    };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private getCompletionResultsFromExtraCursors(document: vscode.TextDocument): {
 | 
			
		||||
    additionalReplacements: vscode.Range[];
 | 
			
		||||
    additionalTextInserts: string[];
 | 
			
		||||
    additionalResults: string[];
 | 
			
		||||
  } {
 | 
			
		||||
    const additionalReplacements = [];
 | 
			
		||||
    const additionalTextInserts = [];
 | 
			
		||||
    const additionalResults = [];
 | 
			
		||||
 | 
			
		||||
    const editor = vscode.window.activeTextEditor;
 | 
			
		||||
    if (editor) {
 | 
			
		||||
      for (const selection of editor.selections.slice(1)) {
 | 
			
		||||
        const position = selection.active;
 | 
			
		||||
        const exprLine = document.getText(
 | 
			
		||||
          new vscode.Range(new vscode.Position(position.line, 0), position),
 | 
			
		||||
        );
 | 
			
		||||
        const lineCalcResult = this.calculateLine(position, exprLine);
 | 
			
		||||
        if (lineCalcResult == null) {
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
        const { expressionWithEqualSignRange, insertText, result } =
 | 
			
		||||
          lineCalcResult;
 | 
			
		||||
        additionalReplacements.push(expressionWithEqualSignRange);
 | 
			
		||||
        additionalTextInserts.push(insertText);
 | 
			
		||||
        additionalResults.push(result);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return { additionalReplacements, additionalTextInserts, additionalResults };
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public async provideCompletionItems(
 | 
			
		||||
    document: vscode.TextDocument,
 | 
			
		||||
    position: vscode.Position,
 | 
			
		||||
    _token: vscode.CancellationToken,
 | 
			
		||||
    _context: vscode.CompletionContext,
 | 
			
		||||
  ): Promise<vscode.CompletionItem[]> {
 | 
			
		||||
    const exprLine = document.getText(
 | 
			
		||||
      new vscode.Range(new vscode.Position(position.line, 0), position),
 | 
			
		||||
    );
 | 
			
		||||
    if (!this.enableActive && !exprLine.trimRight().endsWith('=')) {
 | 
			
		||||
      return [];
 | 
			
		||||
    }
 | 
			
		||||
    const lineCalcResult = this.calculateLine(position, exprLine);
 | 
			
		||||
    if (lineCalcResult == null) {
 | 
			
		||||
      return [];
 | 
			
		||||
    }
 | 
			
		||||
    const {
 | 
			
		||||
      skip,
 | 
			
		||||
      result,
 | 
			
		||||
      expressionRange,
 | 
			
		||||
      expressionWithEqualSignRange,
 | 
			
		||||
      expressionEndRange,
 | 
			
		||||
      insertText,
 | 
			
		||||
    } = lineCalcResult;
 | 
			
		||||
 | 
			
		||||
    this.clearHighlight().catch(this.onError);
 | 
			
		||||
 | 
			
		||||
    this.highlight(expressionRange).catch(this.onError);
 | 
			
		||||
 | 
			
		||||
    const { additionalReplacements, additionalTextInserts, additionalResults } =
 | 
			
		||||
      this.getCompletionResultsFromExtraCursors(document);
 | 
			
		||||
    const documentationPostfix =
 | 
			
		||||
      additionalResults.length > 0 ? ' (multiple)' : '';
 | 
			
		||||
 | 
			
		||||
    return [
 | 
			
		||||
      {
 | 
			
		||||
        label: result,
 | 
			
		||||
        kind: vscode.CompletionItemKind.Constant,
 | 
			
		||||
        detail: `calc append${documentationPostfix}`,
 | 
			
		||||
        documentation: `\`${exprLine
 | 
			
		||||
          .slice(skip)
 | 
			
		||||
          .trimStart()}${insertText}\`${documentationPostfix}`,
 | 
			
		||||
        range: expressionEndRange,
 | 
			
		||||
        additionalTextEdits: [
 | 
			
		||||
          vscode.TextEdit.insert(expressionWithEqualSignRange.end, insertText),
 | 
			
		||||
          ...additionalReplacements.map((replacementRange, i) =>
 | 
			
		||||
            vscode.TextEdit.insert(replacementRange.end, additionalTextInserts[i]),
 | 
			
		||||
          ),
 | 
			
		||||
        ],
 | 
			
		||||
        insertText: '', // text specified here will be inserted on every line
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        label: result,
 | 
			
		||||
        kind: vscode.CompletionItemKind.Constant,
 | 
			
		||||
        detail: `calc replace${documentationPostfix}`,
 | 
			
		||||
        documentation: `\`${result}\`${documentationPostfix}`,
 | 
			
		||||
        additionalTextEdits: [
 | 
			
		||||
          vscode.TextEdit.replace(expressionWithEqualSignRange, result),
 | 
			
		||||
          ...additionalReplacements.map((replacementRange, i) =>
 | 
			
		||||
            vscode.TextEdit.replace(replacementRange, additionalResults[i]),
 | 
			
		||||
          ),
 | 
			
		||||
        ],
 | 
			
		||||
        insertText: '',
 | 
			
		||||
      },
 | 
			
		||||
    ];
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  async resolveCompletionItem(
 | 
			
		||||
    item: vscode.CompletionItem,
 | 
			
		||||
    _token: vscode.CancellationToken,
 | 
			
		||||
  ): Promise<vscode.CompletionItem> {
 | 
			
		||||
    return item;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,20 +1,23 @@
 | 
			
		||||
// The module 'vscode' contains the VS Code extensibility API
 | 
			
		||||
// Import the module and reference it with the alias vscode in your code below
 | 
			
		||||
import * as vscode from 'vscode';
 | 
			
		||||
import * as Calculator from './calculator';
 | 
			
		||||
import * as copyHelper from './copyHelper';
 | 
			
		||||
import * as kanbanHelper from './kanbanHelper';
 | 
			
		||||
import * as markdownHelper from './markdownHelper';
 | 
			
		||||
import * as settingsHelper from './settingsHelper';
 | 
			
		||||
import * as promiseLinesHelper from './promiseLinesHelper';
 | 
			
		||||
import * as replaceLinesHelper from './replaceLinesHelper';
 | 
			
		||||
import * as readOnlyLinesHelper from './readOnlyLinesHelper';
 | 
			
		||||
import { WebViewPanel, refreshWebView } from "./WebViewPanel";
 | 
			
		||||
import { ColumnsToCardsWebviewViewProvider, refreshSidebar } from "./ColumnsToCardsWebviewViewProvider";
 | 
			
		||||
import * as WebviewPanelExample from './WebviewPanelExample';
 | 
			
		||||
import * as WebviewPanelCostOfDelay from './WebviewPanelCostOfDelay';
 | 
			
		||||
import * as ColumnsToCardsWebviewViewProvider from './ColumnsToCardsWebviewViewProvider';
 | 
			
		||||
 | 
			
		||||
// This method is called when your extension is activated
 | 
			
		||||
// Your extension is activated the very first time the command is executed
 | 
			
		||||
export async function activate(extensionContext: vscode.ExtensionContext) {
 | 
			
		||||
 | 
			
		||||
	const columnsToCardsWebviewViewProvider = new ColumnsToCardsWebviewViewProvider(extensionContext);
 | 
			
		||||
	const columnsToCardsWebviewViewProvider = new ColumnsToCardsWebviewViewProvider.ColumnsToCardsWebviewViewProvider(extensionContext);
 | 
			
		||||
 | 
			
		||||
	const item = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right);
 | 
			
		||||
	item.text = "$(beaker) Show Kanban";
 | 
			
		||||
@ -22,30 +25,119 @@ export async function activate(extensionContext: vscode.ExtensionContext) {
 | 
			
		||||
	item.show();
 | 
			
		||||
	extensionContext.subscriptions.push(vscode.window.registerWebviewViewProvider("columns-to-cards-webview-view-provider", columnsToCardsWebviewViewProvider));
 | 
			
		||||
 | 
			
		||||
	// Use the console to output diagnostic information (console.log) and errors (console.error)
 | 
			
		||||
	// This line of code will only be executed once when your extension is activated
 | 
			
		||||
	console.log('Congratulations, your extension "type-script-helper":1.6.2 is now active!');
 | 
			
		||||
	const config = vscode.workspace.getConfiguration('calc');
 | 
			
		||||
	const outputChannel = vscode.window.createOutputChannel('calc');
 | 
			
		||||
 | 
			
		||||
	// // The command has been defined in the package.json file
 | 
			
		||||
	// // Now provide the implementation of the command with registerCommand
 | 
			
		||||
	// // The commandId parameter must match the command field in package.json
 | 
			
		||||
	// let disposable = vscode.commands.registerCommand('type-script-helper.helloWorld', () => {
 | 
			
		||||
	// 	// The code you place here will be executed every time your command is executed
 | 
			
		||||
	// 	// Display a message box to the user
 | 
			
		||||
	// 	vscode.window.showInformationMessage('Hello World from type-script-helper!');
 | 
			
		||||
	// });
 | 
			
		||||
	const onError = (error: unknown) => {
 | 
			
		||||
		if (error instanceof Error) {
 | 
			
		||||
			outputChannel.appendLine(error.message);
 | 
			
		||||
			if (error.stack) outputChannel.appendLine(error.stack);
 | 
			
		||||
		} else {
 | 
			
		||||
			outputChannel.appendLine((error as any).toString().message);
 | 
			
		||||
		}
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	// context.subscriptions.push(disposable);
 | 
			
		||||
	const calcProvider = new Calculator.CalcProvider(config, onError);
 | 
			
		||||
 | 
			
		||||
	extensionContext.subscriptions.push(
 | 
			
		||||
		vscode.languages.registerCompletionItemProvider('*', calcProvider, '=', ' '),
 | 
			
		||||
		vscode.workspace.onDidOpenTextDocument(() => {
 | 
			
		||||
			calcProvider.clearHighlight().catch(onError);
 | 
			
		||||
		}),
 | 
			
		||||
		vscode.window.onDidChangeTextEditorSelection(() => {
 | 
			
		||||
			calcProvider.clearHighlight().catch(onError);
 | 
			
		||||
		}),
 | 
			
		||||
	);
 | 
			
		||||
 | 
			
		||||
	async function replaceResultsWithPositions(
 | 
			
		||||
		editor: vscode.TextEditor,
 | 
			
		||||
		positionsAndExpressions: [vscode.Position, string][],
 | 
			
		||||
		mode: 'append' | 'replace',
 | 
			
		||||
	) {
 | 
			
		||||
		await editor.edit((editBuilder) => {
 | 
			
		||||
			for (const [position, expression] of positionsAndExpressions) {
 | 
			
		||||
				const lineCalcResult = calcProvider.calculateLine(position, expression);
 | 
			
		||||
				if (lineCalcResult == null) {
 | 
			
		||||
					continue;
 | 
			
		||||
				}
 | 
			
		||||
				const { insertText, expressionWithEqualSignRange, expressionEndRange } =
 | 
			
		||||
					lineCalcResult;
 | 
			
		||||
 | 
			
		||||
				if (mode === 'append') {
 | 
			
		||||
					const endWithEqual = expression.trimEnd().endsWith('=');
 | 
			
		||||
					editBuilder.replace(
 | 
			
		||||
						expressionEndRange,
 | 
			
		||||
						endWithEqual ? insertText : ` = ${insertText}`,
 | 
			
		||||
					);
 | 
			
		||||
				} else if (mode === 'replace') {
 | 
			
		||||
					editBuilder.replace(expressionWithEqualSignRange, insertText);
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		});
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	async function replaceResult(
 | 
			
		||||
		mode: 'append' | 'replace',
 | 
			
		||||
		withCursor: boolean,
 | 
			
		||||
	) {
 | 
			
		||||
		const editor = vscode.window.activeTextEditor;
 | 
			
		||||
		if (!editor || !editor.selection.isEmpty) {
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
		const doc = editor.document;
 | 
			
		||||
 | 
			
		||||
		let positionsAndExpressions;
 | 
			
		||||
		if (withCursor) {
 | 
			
		||||
			positionsAndExpressions = editor.selections.map(
 | 
			
		||||
				(selection) =>
 | 
			
		||||
					<[vscode.Position, string]>[
 | 
			
		||||
						selection.active,
 | 
			
		||||
						doc
 | 
			
		||||
							.lineAt(selection.active.line)
 | 
			
		||||
							.text.slice(0, selection.active.character),
 | 
			
		||||
					],
 | 
			
		||||
			);
 | 
			
		||||
		} else {
 | 
			
		||||
			const uniqueLineNumbers = [
 | 
			
		||||
				...new Set(editor.selections.map((selection) => selection.active.line)),
 | 
			
		||||
			];
 | 
			
		||||
			positionsAndExpressions = uniqueLineNumbers.map((number) => {
 | 
			
		||||
				const line = doc.lineAt(number);
 | 
			
		||||
				return <[vscode.Position, string]>[line.range.end, line.text];
 | 
			
		||||
			});
 | 
			
		||||
		}
 | 
			
		||||
		await replaceResultsWithPositions(editor, positionsAndExpressions, mode);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	extensionContext.subscriptions.push(
 | 
			
		||||
		vscode.commands.registerTextEditorCommand('extension.calcAppendWithCursor', () => {
 | 
			
		||||
			replaceResult('append', true).catch(onError);
 | 
			
		||||
		}),
 | 
			
		||||
		vscode.commands.registerTextEditorCommand('extension.calcAppend', () => {
 | 
			
		||||
			replaceResult('append', false).catch(onError);
 | 
			
		||||
		}),
 | 
			
		||||
		vscode.commands.registerTextEditorCommand(
 | 
			
		||||
			'extension.calcReplaceWithCursor',
 | 
			
		||||
			() => {
 | 
			
		||||
				replaceResult('replace', true).catch(onError);
 | 
			
		||||
			},
 | 
			
		||||
		),
 | 
			
		||||
		vscode.commands.registerTextEditorCommand('extension.calcReplace', () => {
 | 
			
		||||
			replaceResult('replace', false).catch(onError);
 | 
			
		||||
		}),
 | 
			
		||||
	);
 | 
			
		||||
 | 
			
		||||
	const commands = [
 | 
			
		||||
		vscode.commands.registerCommand("copyHelper.copySyntaxInLight", copyHelper.copySyntaxInLight),
 | 
			
		||||
		vscode.commands.registerCommand("extension.rotateExplorerSortOrder", settingsHelper.rotateExplorerSortOrder),
 | 
			
		||||
		vscode.commands.registerCommand("kanban.refreshBoth", () => { kanbanHelper.refreshBoth(extensionContext); }),
 | 
			
		||||
		vscode.commands.registerCommand("kanban.refreshSidebar", refreshSidebar),
 | 
			
		||||
		vscode.commands.registerCommand("kanban.refreshWebView", () => { refreshWebView(extensionContext); }),
 | 
			
		||||
		vscode.commands.registerCommand("kanban.refreshSidebar", ColumnsToCardsWebviewViewProvider.refreshSidebar),
 | 
			
		||||
		vscode.commands.registerCommand("kanban.openWithTextEditor", kanbanHelper.openWithTextEditor),
 | 
			
		||||
		vscode.commands.registerCommand("kanban.openInNewWindow", kanbanHelper.openInNewWindow),
 | 
			
		||||
		vscode.commands.registerCommand("markdown.newMarkdownFile", markdownHelper.newMarkdownFile),
 | 
			
		||||
		vscode.commands.registerCommand('promiseLinesHelper.codeGeneratorQuickPick', promiseLinesHelper.codeGeneratorQuickPick),
 | 
			
		||||
		vscode.commands.registerCommand('promiseLinesHelper.insertDateTime', promiseLinesHelper.insertDateTime),
 | 
			
		||||
		vscode.commands.registerCommand("promiseLinesHelper.insertAllExtensions", promiseLinesHelper.insertAllExtensions),
 | 
			
		||||
		vscode.commands.registerCommand('promiseLinesHelper.transformToPopperCase', promiseLinesHelper.transformToPopperCase),
 | 
			
		||||
		vscode.commands.registerCommand('promiseLinesHelper.transformToParamCase', promiseLinesHelper.transformToParamCase),
 | 
			
		||||
		vscode.commands.registerCommand('readOnlyLinesHelper.searchGoogle', readOnlyLinesHelper.searchGoogle),
 | 
			
		||||
@ -70,7 +162,15 @@ export async function activate(extensionContext: vscode.ExtensionContext) {
 | 
			
		||||
		vscode.commands.registerCommand('replaceLinesHelper.unwrapSql', replaceLinesHelper.unwrapSql),
 | 
			
		||||
		vscode.commands.registerCommand('replaceLinesHelper.wrapSqlCSharp', replaceLinesHelper.wrapSqlCSharp),
 | 
			
		||||
		vscode.commands.registerCommand('replaceLinesHelper.wrapSqlVB', replaceLinesHelper.wrapSqlVB),
 | 
			
		||||
		vscode.commands.registerCommand("webView.webView", () => { WebViewPanel.createOrShow(extensionContext); })
 | 
			
		||||
		vscode.commands.registerCommand("webview.costOfDelayMesa", () => { WebviewPanelCostOfDelay.WebviewPanelCostOfDelay.createOrShow(extensionContext, 'MES', ''); }),
 | 
			
		||||
		vscode.commands.registerCommand("webview.costOfDelayEffortMesa", () => { WebviewPanelCostOfDelay.WebviewPanelCostOfDelay.createOrShow(extensionContext, 'MES', 'EFFORT'); }),
 | 
			
		||||
		vscode.commands.registerCommand("webview.costOfDelayLiveMesa", () => { WebviewPanelCostOfDelay.WebviewPanelCostOfDelay.createOrShow(extensionContext, 'MES', 'LIVE'); }),
 | 
			
		||||
		vscode.commands.registerCommand("webview.costOfDelayWSJFMesa", () => { WebviewPanelCostOfDelay.WebviewPanelCostOfDelay.createOrShow(extensionContext, 'MES', 'WSJF'); }),
 | 
			
		||||
		vscode.commands.registerCommand("webview.costOfDelayLeominster", () => { WebviewPanelCostOfDelay.WebviewPanelCostOfDelay.createOrShow(extensionContext, 'LEO', ''); }),
 | 
			
		||||
		vscode.commands.registerCommand("webview.costOfDelayEffortLeominster", () => { WebviewPanelCostOfDelay.WebviewPanelCostOfDelay.createOrShow(extensionContext, 'LEO', 'EFFORT'); }),
 | 
			
		||||
		vscode.commands.registerCommand("webview.costOfDelayLiveLeominster", () => { WebviewPanelCostOfDelay.WebviewPanelCostOfDelay.createOrShow(extensionContext, 'LEO', 'LIVE'); }),
 | 
			
		||||
		vscode.commands.registerCommand("webview.costOfDelayWSJFLeominster", () => { WebviewPanelCostOfDelay.WebviewPanelCostOfDelay.createOrShow(extensionContext, 'LEO', 'WSJF'); }),
 | 
			
		||||
		vscode.commands.registerCommand("webview.example", () => { WebviewPanelExample.WebviewPanelExample.createOrShow(extensionContext); })
 | 
			
		||||
	];
 | 
			
		||||
 | 
			
		||||
	commands.forEach(command => extensionContext.subscriptions.push(command));
 | 
			
		||||
 | 
			
		||||
@ -1,14 +1,110 @@
 | 
			
		||||
import * as vscode from 'vscode';
 | 
			
		||||
import { refreshWebView } from './WebViewPanel';
 | 
			
		||||
import { paramCase } from './promiseLinesHelper';
 | 
			
		||||
import { refreshSidebar } from './ColumnsToCardsWebviewViewProvider';
 | 
			
		||||
 | 
			
		||||
export function refreshBoth(extensionContext: vscode.ExtensionContext): any {
 | 
			
		||||
    refreshSidebar();
 | 
			
		||||
    refreshWebView(extensionContext);
 | 
			
		||||
    setTimeout(() => { vscode.commands.executeCommand("workbench.action.webview.openDeveloperTools"); }, 500);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function updateWithLogic(textDocument: vscode.TextDocument) {
 | 
			
		||||
    await vscode.window.showTextDocument(textDocument);
 | 
			
		||||
    const textEditor = vscode.window.activeTextEditor;
 | 
			
		||||
    if (!textEditor) {
 | 
			
		||||
        return undefined;
 | 
			
		||||
    }
 | 
			
		||||
    const now: Date = new Date();
 | 
			
		||||
    const time: number = now.getTime();
 | 
			
		||||
    const year: number = now.getFullYear();
 | 
			
		||||
    const start: Date = new Date(year, 0, 0);
 | 
			
		||||
    const oneDay: number = 1000 * 60 * 60 * 24;
 | 
			
		||||
    const timezoneOffset: number = now.getTimezoneOffset();
 | 
			
		||||
    let segments: string[] = textDocument.fileName.split('\\');
 | 
			
		||||
    const diff: number = (time - start.getTime()) + ((start.getTimezoneOffset() - timezoneOffset) * 60 * 1000);
 | 
			
		||||
    const day: number = Math.floor(diff / oneDay);
 | 
			
		||||
    const seconds: number = time.valueOf() + timezoneOffset;
 | 
			
		||||
    let notLastThree: string[] = segments.slice(0, -3);
 | 
			
		||||
    let season: string = year + "-";
 | 
			
		||||
    if (day < 78) {
 | 
			
		||||
        season += "0.Winter";
 | 
			
		||||
    } else if (day < 124) {
 | 
			
		||||
        season += "1.Spring";
 | 
			
		||||
    } else if (day < 171) {
 | 
			
		||||
        season += "2.Spring";
 | 
			
		||||
    } else if (day < 217) {
 | 
			
		||||
        season += "3.Summer";
 | 
			
		||||
    } else if (day < 264) {
 | 
			
		||||
        season += "4.Summer";
 | 
			
		||||
    } else if (day < 309) {
 | 
			
		||||
        season += "5.Fall";
 | 
			
		||||
    } else if (day < 354) {
 | 
			
		||||
        season += "6.Fall";
 | 
			
		||||
    } else {
 | 
			
		||||
        season += "7.Winter";
 | 
			
		||||
    }
 | 
			
		||||
    let path: string = notLastThree.join('\\') + `\\${year}\\${season}\\${seconds}`;
 | 
			
		||||
    const uri = vscode.Uri.parse(path);
 | 
			
		||||
    textEditor.edit(editBuilder => {
 | 
			
		||||
        let text: string = `\r\n## Code Insiders\r\n\r\n- [code-insiders](${path})\r\n\r\n## Sub-tasks\r\n\r\n- [ ] To do`;
 | 
			
		||||
        let position: vscode.Position = new vscode.Position(textDocument.lineCount, 0);
 | 
			
		||||
        editBuilder.insert(position, text);
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function openInNewWindowLogic(): Promise<any> {
 | 
			
		||||
    if (vscode.workspace.workspaceFolders === undefined) {
 | 
			
		||||
        vscode.window.showInformationMessage("Open workspace first!");
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    if (vscode.window.tabGroups.activeTabGroup.activeTab === undefined) {
 | 
			
		||||
        vscode.window.showInformationMessage("Open a tab first!");
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    const activeTab = vscode.window.tabGroups.activeTabGroup.activeTab;
 | 
			
		||||
    const tabs: vscode.Tab[] = vscode.window.tabGroups.all.map(tagGroup => tagGroup.tabs).flat();
 | 
			
		||||
    const index = tabs.findIndex(tab => tab.label === activeTab.label);
 | 
			
		||||
    const paramCaseActiveTabLabel: string = paramCase(activeTab.label);
 | 
			
		||||
    vscode.window.showInformationMessage(`Searching for <${paramCaseActiveTabLabel}>`);
 | 
			
		||||
    const fileUris: vscode.Uri[] = await vscode.workspace.findFiles(`**/${paramCaseActiveTabLabel}*`);
 | 
			
		||||
    if (fileUris.length === 0) {
 | 
			
		||||
        vscode.window.showInformationMessage(`Didn't find a file matching <${paramCaseActiveTabLabel}>!`);
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    for (let i = 0; i < fileUris.length; ++i) {
 | 
			
		||||
        let found: boolean = false;
 | 
			
		||||
        const textDocument: vscode.TextDocument = await vscode.workspace.openTextDocument(fileUris[i]);
 | 
			
		||||
        for (let j = 0; j < textDocument.lineCount; ++j) {
 | 
			
		||||
            const text = textDocument.lineAt(j).text;
 | 
			
		||||
            if (text.endsWith(')')) {
 | 
			
		||||
                if (text.startsWith("- [code](")) {
 | 
			
		||||
                    found = true;
 | 
			
		||||
                    const uri = vscode.Uri.parse("file:" + text.substring(9, text.length - 1));
 | 
			
		||||
                    await vscode.commands.executeCommand('vscode.openFolder', uri, true);
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
                if (text.startsWith("- [codium](")) {
 | 
			
		||||
                    found = true;
 | 
			
		||||
                    const uri = vscode.Uri.parse("file:" + text.substring(11, text.length - 1));
 | 
			
		||||
                    await vscode.commands.executeCommand('vscode.openFolder', uri, true);
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
                if (text.startsWith("- [code-insiders](")) {
 | 
			
		||||
                    found = true;
 | 
			
		||||
                    const uri = vscode.Uri.parse("file:" + text.substring(18, text.length - 1));
 | 
			
		||||
                    await vscode.commands.executeCommand('vscode.openFolder', uri, true);
 | 
			
		||||
                    break;
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if (!found) {
 | 
			
		||||
            updateWithLogic(textDocument);
 | 
			
		||||
        }
 | 
			
		||||
        else if (index !== -1) {
 | 
			
		||||
            await vscode.window.tabGroups.close(tabs[index]);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
async function openWithTextEditorLogic(): Promise<any> {
 | 
			
		||||
    if (vscode.workspace.workspaceFolders === undefined) {
 | 
			
		||||
        vscode.window.showInformationMessage("Open workspace first!");
 | 
			
		||||
@ -32,4 +128,5 @@ async function openWithTextEditorLogic(): Promise<any> {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export const openInNewWindow = () => openInNewWindowLogic();
 | 
			
		||||
export const openWithTextEditor = () => openWithTextEditorLogic();
 | 
			
		||||
@ -133,16 +133,66 @@ function insertDateTimeLogic(): undefined {
 | 
			
		||||
    if (!textEditor) {
 | 
			
		||||
        return undefined;
 | 
			
		||||
    }
 | 
			
		||||
    const date = new Date();
 | 
			
		||||
    const selection = textEditor.selection;
 | 
			
		||||
    textEditor.edit(editBuilder => {
 | 
			
		||||
        var range;
 | 
			
		||||
        const now: Date = new Date();
 | 
			
		||||
        const time: number = now.getTime();
 | 
			
		||||
        const year: number = now.getFullYear();
 | 
			
		||||
        const start: Date = new Date(year, 0, 0);
 | 
			
		||||
        const oneDay: number = 1000 * 60 * 60 * 24;
 | 
			
		||||
        const timezoneOffset: number = now.getTimezoneOffset();
 | 
			
		||||
        const diff: number = (time - start.getTime()) + ((start.getTimezoneOffset() - timezoneOffset) * 60 * 1000);
 | 
			
		||||
        const seconds: number = time.valueOf() + timezoneOffset;
 | 
			
		||||
        const day: number = Math.floor(diff / oneDay);
 | 
			
		||||
        const epoch: number = seconds * 10000;
 | 
			
		||||
        const ticks: number = epoch + 621355968000000000;
 | 
			
		||||
        let season: string = year + "-";
 | 
			
		||||
        if (day < 78) {
 | 
			
		||||
            season += "0.Winter";
 | 
			
		||||
        } else if (day < 124) {
 | 
			
		||||
            season += "1.Spring";
 | 
			
		||||
        } else if (day < 171) {
 | 
			
		||||
            season += "2.Spring";
 | 
			
		||||
        } else if (day < 217) {
 | 
			
		||||
            season += "3.Summer";
 | 
			
		||||
        } else if (day < 264) {
 | 
			
		||||
            season += "4.Summer";
 | 
			
		||||
        } else if (day < 309) {
 | 
			
		||||
            season += "5.Fall";
 | 
			
		||||
        } else if (day < 354) {
 | 
			
		||||
            season += "6.Fall";
 | 
			
		||||
        } else {
 | 
			
		||||
            season += "7.Winter";
 | 
			
		||||
        }
 | 
			
		||||
        const dateText = seconds + " = " + ticks + " = " + season + " = " + now.toString();
 | 
			
		||||
        if (selection.isEmpty) {
 | 
			
		||||
            editBuilder.insert(selection.start, date.toString())
 | 
			
		||||
            editBuilder.insert(selection.start, dateText)
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            range = new vscode.Range(selection.start.line, selection.start.character, selection.end.line, selection.end.character);
 | 
			
		||||
            editBuilder.replace(range, date.toString());
 | 
			
		||||
            editBuilder.replace(range, dateText);
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
    return undefined;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function insertAllExtensionsLogic(): undefined {
 | 
			
		||||
    const textEditor = vscode.window.activeTextEditor;
 | 
			
		||||
    if (!textEditor) {
 | 
			
		||||
        return undefined;
 | 
			
		||||
    }
 | 
			
		||||
    const selection = textEditor.selection;
 | 
			
		||||
    textEditor.edit(editBuilder => {
 | 
			
		||||
        var range;
 | 
			
		||||
        let extensions = vscode.extensions.all;
 | 
			
		||||
        let text = extensions.map(extension => extension.id).join("\n");
 | 
			
		||||
        if (selection.isEmpty) {
 | 
			
		||||
            editBuilder.insert(selection.start, text)
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            range = new vscode.Range(selection.start.line, selection.start.character, selection.end.line, selection.end.character);
 | 
			
		||||
            editBuilder.replace(range, text);
 | 
			
		||||
        }
 | 
			
		||||
    });
 | 
			
		||||
    return undefined;
 | 
			
		||||
@ -211,5 +261,6 @@ function transformToParamCaseLogic(): undefined {
 | 
			
		||||
 | 
			
		||||
export const codeGeneratorQuickPick = () => codeGeneratorQuickPickLogic();
 | 
			
		||||
export const insertDateTime = () => insertDateTimeLogic();
 | 
			
		||||
export const insertAllExtensions = () => insertAllExtensionsLogic();
 | 
			
		||||
export const transformToPopperCase = () => transformToPopperCaseLogic();
 | 
			
		||||
export const transformToParamCase = () => transformToParamCaseLogic();
 | 
			
		||||
							
								
								
									
										29
									
								
								type-script-helper/src/settingsHelper.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								type-script-helper/src/settingsHelper.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,29 @@
 | 
			
		||||
import * as vscode from 'vscode';
 | 
			
		||||
 | 
			
		||||
async function rotateExplorerSortOrderLogic(): Promise<any> {
 | 
			
		||||
    const config = vscode.workspace.getConfiguration("explorer");
 | 
			
		||||
    const sortOrder = config.get("sortOrder");
 | 
			
		||||
    let sortOrderOptions = [
 | 
			
		||||
        "default",
 | 
			
		||||
        "modified",
 | 
			
		||||
        "type",
 | 
			
		||||
        "mixed",
 | 
			
		||||
        "filesFirst",
 | 
			
		||||
        "foldersNestsFiles",
 | 
			
		||||
    ];
 | 
			
		||||
    let index = sortOrderOptions.findIndex(l => l === sortOrder);
 | 
			
		||||
    if (index !== -1)
 | 
			
		||||
        index++;
 | 
			
		||||
    else
 | 
			
		||||
        index = 0;
 | 
			
		||||
    if (index >= sortOrderOptions.length)
 | 
			
		||||
        index = 0;
 | 
			
		||||
    let value = sortOrderOptions[index];
 | 
			
		||||
    await config.update("sortOrder", value);
 | 
			
		||||
    index++;    
 | 
			
		||||
    if (index >= sortOrderOptions.length)
 | 
			
		||||
        index = 0;
 | 
			
		||||
    vscode.window.showInformationMessage(`Explorer Sort Order set to: ${value}; next will be: ${sortOrderOptions[index]};`);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export const rotateExplorerSortOrder = () => rotateExplorerSortOrderLogic();
 | 
			
		||||
@ -1,5 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
	"compilerOptions": {
 | 
			
		||||
		"typeRoots": ["./node_modules/@types"],
 | 
			
		||||
		"allowSyntheticDefaultImports": true,
 | 
			
		||||
		"lib": [
 | 
			
		||||
			"ES2020"
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user