2.Visual Studio 2017 15.7 منتشر شد
These are the customer-reported issues addressed in 15.7.2:
- With 15.7, users installing an extension on the command line with a nested extension may see an error installing. This has been addressed in the 15.7.2 servicing release.
- Anaconda fails to uninstall during upgrade and issues warning (Error 87).
- The SSDT 15.6.0 Installer configuration registry key could not be opened..
- Editor performance Issues when editing JavaScript.
- The Code Coverage functionality in Visual Studio 2017 ignores async methods.
- Missing
atls.lib
inarm/arm64
after update. - Test Explorer no longer greys out the previously run unit tests.
- Version 15.7.1 debugs .aspx App in a new Chrome instance even if JavaScript debugging is disabled.
- 15.7 compiler fails with Folly.
- ASP project keeps running after closing the web page.
- Chrome Debugger not working and shows an error message, however, the debugger buttons stay active. .
- Rename Python from Rename on the Refactor menu no longer works.
- Visual Studio Installer doesn't work correctly in low disk space conditions.
- Debugger links to browser when previously not set.
- Problems with template argument deduction for class templates.
- C++ constexpr string_view == fails to compile.
- A regression in Type Providers which use native resources (e.g., FSharp.Data.TypeProviders) has been fixed.
- You can now add files to F# ASP.NET Core projects from the UI.
- Listening to Microsoft-Extensions-Logging causes VS diagnostic events window to disconnect with an error message has been fixed in Service Fabric Tools.
انتشار هندبوک جدید TypeScript
انواع روشهای خلاقانه تولید رشتههای تصادفی
برای تولید چنین نموداری از میتوانیم Mermaid استفاده کنیم. یکی از انواع دیاگرامهایی را که پشتیبانی میکند، Gitgraph میباشد. دیاگرامها در Mermaid با کمک یک DSL ساخته میشوند. سینکس آن نیز خیلی ساده است؛ ابتدا نوع دیاگرامی را که میخواهیم ترسیم کنیم، تعیین میکنیم و سپس محتویات را براساس نوع دیاگرام، تعیین میکنیم. به عنوان مثال برای Gitgraph سینتکس آن به این صورت است:
gitGraph commit commit branch develop checkout develop commit commit checkout main merge develop commit commit
در ساختار فوق ابتدا دو کامیت بر روی برنچ اصلی (main) انجام شدهاست؛ سپس یک برنچ جدید را با نام develop، ایجاده کردهایم و بلافاصله به آن checkout کردهایم. در ادامه تعدادی کامیت را بر روی این برنچ انجام داده و در نهایت برنچ موردنظر را بر روی main، مرج کردهایم. در نهایت نیز دو کامیت دیگر را بر روی main ایجاد کردهایم. تعریف فوق، منجر به ساخت چنین نموداری خواهد شد:
از ادیتور آنلاین Mermaid نیز میتوانید برای تست سینکس استفاده کنید. در ادامه میخواهیم با کمک PowerShell، از روی یک پروژهی گیت، DSL موردنیاز برای ساخت دیاگرام را ایجاد کنیم. برای اینکار ابتدا توسط تابع زیر یک پروژهی گیت را با تعدادی فایل نمونه ایجاد خواهیم کرد:
Function New-RandomRepo { Function RandomFiles($branch = "main") { 1..3 | ForEach-Object { New-Item -ItemType File -Name "file_$($_).txt" Set-Content -Path "file_$($_).txt" -Value "This is file $($_) on branch $branch" git add . git commit -m "Commit $($_) on branch $branch" } } Set-Location ~/Desktop New-Item -ItemType Directory "random_git_repo" Set-Location "random_git_repo" git init -b main Write-Output "This is the main branch" | Set-Content -Path "main.txt" git add . git commit -m "Initial commit" 1..3 | ForEach-Object { git checkout -b "branch_$($_)" RandomFiles "branch_$($_)" git checkout main } }
در ادامه تابع New-GitRepoDiagram را برای تولید ساختار مورد نیاز نوشتهایم:
Function New-GitRepoDiagram { $commitIds = @() $branches = git branch | ForEach-Object { $default = $false $activeBranch = git symbolic-ref --short HEAD $currentBranch = ($_.Replace("* ", " ")).Trim() if ($currentBranch -eq $activeBranch) { $default = $true } @{ name = $currentBranch isMainBranch = $default } | ConvertTo-Json } | ConvertFrom-Json $defaultBranch = $branches | Where-Object { $_.isMainBranch -eq $true } | Select-Object -ExpandProperty name $mermaidFile = "%%{init: { 'gitGraph': {'mainBranchName': '$defaultBranch' } } }%%" + [Environment]::NewLine $mermaidFile += 'gitGraph' + [Environment]::NewLine foreach ($branch in ($branches | Sort-Object -Property isMainBranch -Descending)) { $name = $branch.name $notIncludeTheMainCommits = $name -ne $defaultBranch ? "--not $(git merge-base $defaultBranch $name)" : "" $notIncludeTheMainCommits $logs = git log --pretty=format:'{"commit": "%h", "author": "%an", "message": "%s"}' --reverse $name | ConvertFrom-Json if ($name -ne $defaultBranch) { $mermaidFile += ' branch "$name"'.Replace('$name', $name) + [Environment]::NewLine } foreach ($log in $logs) { $commit = $log.commit if ($commitIds -contains $commit) { continue } $commitToAdd = ' commit id: "$commit"'.Replace('$commit', $commit) + [Environment]::NewLine $mermaidFile += $commitToAdd $commitIds += $commit } if ($name -ne $defaultBranch) { $mermaidFile += ' checkout main' + [Environment]::NewLine } } Write-Host $mermaidFile }
توضیحات:
- در تابع فوق، ابتدا یک آرایهی خالی برای ذخیرهی کامیت آیدیها، اضافه شده؛ از این آرایه برای جلوگیری از اضافه شدن کامیت تکراری در هر برنچ استفاده شدهاست.
- سپس با کمک دستور git branch، لیست تمام برنچها، دریافت شدهاست (همانطور که در قسمت قبل بررسی شد +).
- برای هر برنچ، تابع تعیین میکند که آیا برنچ جاری است یا خیر. اینکار با کمک دستور git symbolic-ref انجام شدهاست.
- در ادامه متغیر mermaidFile$ برای ایجاد یک گراف جدید Git مقداردهی میشود. در اینجا نام برنچ اصلی برابر با نام برنچ پیشفرض، تنظیم میشود.
- سپس لیست کامیتهای هر برنچ را با کمک دستور git log (همان سینتکسی که در قسمتهای قبل بررسی شد +) استخراج میکنیم.
- و در نهایت به ازای هر کامیت، یک commit id تولید کردهایم.
با فراخوانی تابع فوق، اینچنین ساختاری برایمان تولید خواهد شد:
%%{init: { 'gitGraph': {'mainBranchName': 'main' } } }%% gitGraph commit id: "765100f" branch "branch_1" commit id: "c88c441" commit id: "44149d9" commit id: "a660fe3" checkout main branch "branch_2" commit id: "2dcb572" commit id: "b043ad1" commit id: "92cafc0" checkout main branch "branch_3" commit id: "559e381" commit id: "f72957f" commit id: "c066e72" checkout main
خروجی فوق دقیقاً دیاگرامی است که در ابتدای مطلب نشان داده شد: