-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Integrate base/ platform from VS Code and adopt scroll bar #5096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 38 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
190e1f0
Add git ignore for vs
Tyriar c30bffc
Set up vs project
Tyriar 4789c24
Get esbuild working and adopt vs scrollbar
Tyriar 99db197
.
Tyriar 86c875f
Helper script for finding unused files
Tyriar c33ed46
Delete unused files
Tyriar 381200b
Fix fit addon to get the scroll bar working in the demo
Tyriar b401865
More clean up, doc updating vs/base
Tyriar 27195b0
Patch out unsafe usage of navigator and window in node envs
Tyriar d904f2f
Generate source maps so errors report ts files
Tyriar 1dada9f
Fix scroll lines API
Tyriar c3c787e
Resolve vs imports in webpacked bundle
Tyriar 345b690
Remove unused demo webpack config
Tyriar 1b0078a
Exclude vs project from coverage
Tyriar 522b39b
Hide more folders from explorer
Tyriar 8b83f44
Tidy up esbuild bundle configs
Tyriar c2b90c6
Remove missing demo webpack npm script
Tyriar 416f12f
Remove ScrollSource
Tyriar 75bf192
Have scroll bar bg react to theme change
Tyriar 9b26bb4
Support theming of overview ruler border
Tyriar c7f8098
Inline some functions
Tyriar 884141c
Support theming of scroll bar slider
Tyriar eca0800
Fix api lint
Tyriar ade5591
Const enum over magic number
Tyriar d1d25a5
Polish all files (excl. CoreBrowserTerminal/Viewport)
Tyriar 2b8ccb5
Deprecate fast scroll modifier as it's no longer possible
Tyriar 55c6275
Support smooth scroll
Tyriar d6f7133
Fix api lint
Tyriar 1096b7f
Create shared file for viewport constants
Tyriar 59a8f0c
_getMutableOptions -> _getChangeOptions
Tyriar f155d67
Replace monaco- with xterm- in the update script
Tyriar 444c07f
Replace monaco- with xterm- in code/css files
Tyriar 31e0af7
Fix out-esbuild build
Tyriar d532a15
Include all files, not just entry root folder
Tyriar a644b5d
Clean up dealing with animation frame
Tyriar 2da5eca
Fix mouse events
Tyriar 721d483
Implement zero scrollback+no mouse event wheel handling
Tyriar 0f37351
Fix ICoreMouseService injecting
Tyriar 73ee951
Resolve more todos
Tyriar 90a1da2
Scroll immediately to bottom when scrollOnUserInput is enabled
Tyriar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,41 @@ | ||
| // @ts-check | ||
|
|
||
| const { dirname } = require("path"); | ||
| const ts = require("typescript"); | ||
| const fs = require("fs"); | ||
|
|
||
| function findUnusedSymbols( | ||
| /** @type string */ tsconfigPath | ||
| ) { | ||
| // Initialize a program using the project's tsconfig.json | ||
| const configFile = ts.readConfigFile(tsconfigPath, ts.sys.readFile); | ||
| const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys, dirname(tsconfigPath)); | ||
|
|
||
| // Initialize a program with the parsed configuration | ||
| const program = ts.createProgram(parsedConfig.fileNames, { | ||
| ...parsedConfig.options, | ||
| noUnusedLocals: true | ||
| }); | ||
| const sourceFiles = program.getSourceFiles(); | ||
| const usedBaseSourceFiles = sourceFiles.filter(e => e.fileName.includes('src/vs/base/')); | ||
| const usedFilesInBase = usedBaseSourceFiles.map(e => e.fileName.replace(/^.+\/src\//, 'src/')).sort((a, b) => a.localeCompare(b)); | ||
| // console.log('Source files used in src/vs/base/:', used); | ||
|
|
||
| // Get an array of all files that exist in src/vs/base/ | ||
| const allFilesInBase = ( | ||
| fs.readdirSync('src/vs/base', { recursive: true, withFileTypes: true }) | ||
| .filter(e => e.isFile()) | ||
| // @ts-ignore HACK: This is only available in Node 20 | ||
| .map(e => `${e.parentPath}/${e.name}`.replace(/\\/g, '/')) | ||
| ); | ||
| const unusedFilesInBase = allFilesInBase.filter(e => !usedFilesInBase.includes(e)); | ||
|
|
||
| console.log({ | ||
| allFilesInBase, | ||
| usedFilesInBase, | ||
| unusedFilesInBase | ||
| }); | ||
| } | ||
|
|
||
| // Example usage | ||
| findUnusedSymbols("./src/browser/tsconfig.json"); | ||
This file contains hidden or 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,61 @@ | ||
| # Get latest vscode repo | ||
| if (Test-Path -Path "src/vs/temp") { | ||
| Write-Host "`e[32m> Fetching latest`e[0m" | ||
| git -C src/vs/temp checkout | ||
| git -C src/vs/temp pull | ||
| } else { | ||
| Write-Host "`e[32m> Cloning microsoft/vscode`e[0m" | ||
| $null = New-Item -ItemType Directory -Path "src/vs/temp" -Force | ||
| git clone https://github.com/microsoft/vscode src/vs/temp | ||
| } | ||
|
|
||
| # Delete old base | ||
| Write-Host "`e[32m> Deleting old base`e[0m" | ||
| $null = Remove-Item -Recurse -Force "src/vs/base" | ||
|
|
||
| # Copy base | ||
| Write-Host "`e[32m> Copying base`e[0m" | ||
| Copy-Item -Path "src/vs/temp/src/vs/base" -Destination "src/vs/base" -Recurse | ||
|
|
||
| # Comment out any CSS imports | ||
| Write-Host "`e[32m> Commenting out CSS imports" -NoNewline | ||
| $baseFiles = Get-ChildItem -Path "src/vs/base" -Recurse -File | ||
| $count = 0 | ||
| foreach ($file in $baseFiles) { | ||
| $content = Get-Content -Path $file.FullName | ||
| $updatedContent = $content | ForEach-Object { | ||
| if ($_ -match "^import 'vs/css!") { | ||
| Write-Host "`e[32m." -NoNewline | ||
| $count++ | ||
| "// $_" | ||
| } else { | ||
| $_ | ||
| } | ||
| } | ||
| $updatedContent | Set-Content -Path $file.FullName | ||
| } | ||
| Write-Host " $count files patched`e[0m" | ||
|
|
||
| # Replace `monaco-*` with `xterm-*`, this will help avoid any styling conflicts when monaco and | ||
| # xterm.js are used in the same project. | ||
| Write-Host "`e[32m> Replacing monaco-* class names with xterm-* `e[0m" -NoNewline | ||
| $baseFiles = Get-ChildItem -Path "src/vs/base" -Recurse -File | ||
| $count = 0 | ||
| foreach ($file in $baseFiles) { | ||
| $content = Get-Content -Path $file.FullName | ||
| if ($content -match "monaco-([a-zA-Z\-]+)") { | ||
| $updatedContent = $content -replace "monaco-([a-zA-Z\-]+)", 'xterm-$1' | ||
| Write-Host "`e[32m." -NoNewline | ||
| $count++ | ||
| $updatedContent | Set-Content -Path $file.FullName | ||
| } | ||
| } | ||
| Write-Host " $count files patched`e[0m" | ||
|
|
||
| # Copy typings | ||
| Write-Host "`e[32m> Copying typings`e[0m" | ||
| Copy-Item -Path "src/vs/temp/src/typings" -Destination "src/vs" -Recurse -Force | ||
|
|
||
| # Deleting unwanted typings | ||
| Write-Host "`e[32m> Deleting unwanted typings`e[0m" | ||
| $null = Remove-Item -Path "src/vs/typings/vscode-globals-modules.d.ts" -Force | ||
|
Tyriar marked this conversation as resolved.
|
||
This file contains hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.