-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial Notebook UI Mode in VS Code Insiders (#2789)
* initial changes * add activation event * add block comment support * add saveMarkdownCellsAs setting * set metadata in new cells on save * actually work across files * updated API with metadata * refactor based on option and new Kernel type * add github action and proposed * add pwsh * remove old * trigger PR * add log * force cron to trigger * time * time * time * better titles * powershell comments * remove not needed comments * use githubrunnumber * use run_id * Update Notebook dts (#3) Co-authored-by: TylerLeonhardt <[email protected]> * better check for registering * Update Notebook dts (#4) Co-authored-by: TylerLeonhardt <[email protected]> * rob's feedback * Add a few tests * added save test * move to utils.sleep * fix regex * add logger * Codacy part 1 * Codacy part 2 * Update Notebook dts (#5) Co-authored-by: TylerLeonhardt <[email protected]> * move GitHub Action to use master Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: TylerLeonhardt <[email protected]> Co-authored-by: Tyler Leonhardt (POWERSHELL) <[email protected]>
- Loading branch information
1 parent
56800c0
commit 93243a9
Showing
23 changed files
with
1,355 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
name: "Update Notebook API" | ||
|
||
on: | ||
push: | ||
pull_request: | ||
schedule: | ||
- cron: 0 22 * * * | ||
|
||
jobs: | ||
Update-Notebook-Api: | ||
|
||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/[email protected] | ||
|
||
- name: Rename proposed dts to old | ||
run: Move-Item ./vscode.proposed.d.ts ./old.vscode.proposed.d.ts | ||
|
||
- name: npm install | ||
run: npm install | ||
|
||
- name: Get latest proposed dts | ||
run: npm run download-api | ||
|
||
- name: Generate new dts and compare it with the old one | ||
run: | | ||
# This will contain the content of our new file | ||
$fullFile = [System.Collections.Generic.List[string]]@() | ||
$dts = Get-Content ./vscode.proposed.d.ts | ||
# First add everything up to the declare statement | ||
$index = 0 | ||
while ($dts[$index] -notmatch "declare module 'vscode' {") { | ||
$fullFile += $dts[$index] | ||
$index++ | ||
} | ||
# Add the declare statement | ||
$fullFile += $dts[$index] | ||
# Find the Notebook region start index | ||
for ( $i = $index; $i -lt $dts.Length; $i++) { | ||
if($dts[$i] -match '//#region @rebornix: Notebook') { | ||
$index = $i | ||
break | ||
} | ||
} | ||
# Add everything until the endregion to the new file | ||
while ($dts[$index] -notmatch "//#endregion") { | ||
$fullFile += $dts[$index] | ||
$index++ | ||
} | ||
# Add the endregion line and ending brace line | ||
$fullFile += $dts[$index] | ||
$fullFile += '}' | ||
# Overwrite the file with the new content | ||
$fullFile | Set-Content ./vscode.proposed.d.ts | ||
# Get the old and new files' raw text | ||
$oldFile = Get-Content ./old.vscode.proposed.d.ts -Raw | ||
$newFile = Get-Content ./vscode.proposed.d.ts -Raw | ||
# Compare them and log if they are different | ||
if($oldFile -ne $newFile) { | ||
Write-Host "New changes detected!" | ||
} | ||
# Remove the old file so it doesn't get picked up by tsc | ||
Remove-Item ./old.vscode.proposed.d.ts -Force | ||
- name: Compile the TypeScript to check for errors | ||
run: npm run compile | ||
|
||
- name: Create Pull Request | ||
if: github.event_name == 'schedule' | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v2 | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
with: | ||
commit-message: "Update Notebook dts" | ||
committer: GitHub <[email protected]> | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
title: "Update Notebook dts" | ||
assignees: TylerLeonhardt | ||
reviewers: TylerLeonhardt | ||
base: master | ||
draft: false | ||
branch: powershell-notebook-patch-${{ github.run_id }} | ||
labels: Created_by_Action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ npm-debug.log | |
.vscode-test/ | ||
*.DS_Store | ||
test-results.xml | ||
vscode.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.