Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 11, 2025

This PR implements support for the new --follow-symlinks flag in VSCE to eliminate the unnecessary copying of PowerShell Editor Services (PSES) modules during builds, as requested in #5169.

What Changed

Package.json Scripts:

  • Added --follow-symlinks flag to the vsce package command only (not publish)
  • This allows VSCE to handle symbolic links natively instead of requiring file copies

Build Script Simplification:

  • Unified symlink handling logic for both Debug and Release configurations
  • Removed complex switch statement and conditional copying logic
  • Simplified PSES building to always call Invoke-Build for consistency
  • Added proper assertion to verify PowerShell Editor Services is built under modules
  • Net reduction of 21+ lines of build script code

Benefits

  • Faster builds - No more file copying during packaging
  • Simplified logic - Unified symlink handling and consistent PSES building across all configurations
  • Reduced complexity - Eliminated conditional build logic and complex switch statements
  • Better maintainability - VSCE now handles symlinks natively with proper assertions

Before/After Comparison

Before: Build script had separate logic for Debug (symlinks + always build) and Release (copies + conditional build):

switch ($Configuration) {
    "Debug" { /* symlink + always build logic */ }
    "Release" { /* copy + conditional build logic */ }
}

After: Unified logic with native VSCE symlink support:

# Consistent symlink creation and building for both configurations
if ((Get-Item ./modules -ErrorAction SilentlyContinue).LinkType -ne "SymbolicLink") {
    New-Item -ItemType SymbolicLink -Path ./modules -Target "$(Split-Path (Get-EditorServicesPath))/module"
}
Write-Build DarkGreen "Building PSES"
Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration

This change leverages the symlink following support added to VSCE in October 2024 (microsoft/vscode-vsce@51e122a).

Fixes #5169.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Build: Use --follow-symlinks in VSCE Build: Use --follow-symlinks in VSCE Jun 11, 2025
@Copilot Copilot AI requested a review from andyleejordan June 11, 2025 19:48
Copilot finished work on behalf of andyleejordan June 11, 2025 19:48
Copy link
Member

@andyleejordan andyleejordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kinda close but not ready.

@andyleejordan
Copy link
Member

Hey @copilot iterate based on my review.

Copy link
Contributor Author

Copilot AI commented Jun 11, 2025

Hey @copilot iterate based on my review.

I don't have access to the specific review comments. Could you please provide details on what aspects you'd like me to iterate on? The current implementation adds --follow-symlinks to both package and publish commands and simplifies the build logic to use symlinks consistently.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 0t3vsblobprodcus362.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 11vvsblobprodcus336.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 1javsblobprodcus364.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 1k9vsblobprodcus379.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 1oavsblobprodcus350.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 1p7vsblobprodcus324.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 1s1vsblobprodcus386.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 2kmvsblobprodcus39.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 2zrvsblobprodcus388.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 37bvsblobprodcus311.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 37cvsblobprodcus359.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 4myvsblobprodcus32.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 4vyvsblobprodcus361.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 51yvsblobprodcus36.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 5rqvsblobprodcus385.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 7devsblobprodcus323.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 7k6vsblobprodcus337.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 80zvsblobprodcus35.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 8xbvsblobprodcus382.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • 96bvsblobprodcus338.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • ajhvsblobprodcus363.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • bcnvsblobprodcus378.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • c50vsblobprodcus330.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • cflvsblobprodcus383.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • d0svsblobprodcus381.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • e7bvsblobprodcus348.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • frdvsblobprodcus327.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • gbsvsblobprodcus365.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • gervsblobprodcus329.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • h6tvsblobprodcus346.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • i1qvsblobprodcus353.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • imzvsblobprodcus368.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • jd4vsblobprodcus366.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • josvsblobprodcus372.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • jrqvsblobprodcus343.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • k0ivsblobprodcus356.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • k4kvsblobprodcus344.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • kgfvsblobprodcus314.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • kh4vsblobprodcus325.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • kijvsblobprodcus387.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • kmuvsblobprodcus389.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • kxqvsblobprodcus376.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • l49vsblobprodcus358.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • l7avsblobprodcus319.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • ljcvsblobprodcus317.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • lylvsblobprodcus31.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • m6xvsblobprodcus342.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • m8dvsblobprodcus37.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • mfjvsblobprodcus373.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • nn8vsblobprodcus340.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • o3svsblobprodcus318.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • ofvvsblobprodcus315.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • pc2vsblobprodcus360.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • pdfvsblobprodcus380.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • pe4vsblobprodcus351.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • pkvvsblobprodcus321.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • rcxvsblobprodcus328.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • s4uvsblobprodcus326.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • s8mvsblobprodcus38.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • sc4vsblobprodcus331.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • se1vsblobprodcus349.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • sqdvsblobprodcus333.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • st8vsblobprodcus339.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • tphvsblobprodcus375.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • u3hvsblobprodcus371.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • u6ovsblobprodcus377.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • ukkvsblobprodcus352.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • uy6vsblobprodcus34.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • v53vsblobprodcus320.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • vb4vsblobprodcus33.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • vwvvsblobprodcus334.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • x3yvsblobprodcus370.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • yluvsblobprodcus367.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • yttvsblobprodcus357.vsblob.vsassets.io
    • Triggering command: npm install (dns block)
  • ytvvsblobprodcus310.vsblob.vsassets.io
    • Triggering command: npm install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of andyleejordan June 11, 2025 20:54
@andyleejordan
Copy link
Member

Hey @copilot iterate based on my review again please.

…ify build logic, add assertion

Co-authored-by: andyleejordan <[email protected]>
Copy link
Contributor Author

Copilot AI commented Sep 4, 2025

Hey @copilot iterate based on my review again please.

I've addressed your review feedback in commit 9962d48:

  1. Removed --follow-symlinks from the publish command (only needed for package)
  2. Simplified the build script to use consistent symlink logic for both Debug and Release configurations, eliminating the switch statement
  3. Replaced the orphaned comment with an assertion that checks PowerShell Editor Services is built under modules

The changes reduce the build script by 17 lines while maintaining the same functionality with better assertions.

@Copilot Copilot AI changed the title Build: Use --follow-symlinks in VSCE Build: Use --follow-symlinks in VSCE package command Sep 4, 2025
@Copilot Copilot AI requested a review from andyleejordan September 4, 2025 20:30
Copilot finished work on behalf of andyleejordan September 4, 2025 20:30
@andyleejordan andyleejordan changed the title Build: Use --follow-symlinks in VSCE package command Use --follow-symlinks in VSCE package command Sep 4, 2025
@Copilot Copilot AI changed the title Use --follow-symlinks in VSCE package command Build: Use --follow-symlinks in VSCE package command and simplify build logic Sep 4, 2025
@Copilot Copilot AI requested a review from andyleejordan September 4, 2025 20:40
Copilot finished work on behalf of andyleejordan September 4, 2025 20:40
Copy link
Member

@andyleejordan andyleejordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of patience went a little ways. As of today, Copilot is responding again and able to collaborate. Growing pains, eh?

@andyleejordan andyleejordan changed the title Build: Use --follow-symlinks in VSCE package command and simplify build logic Use --follow-symlinks in VSCE package command and simplify build logic Sep 4, 2025
@andyleejordan andyleejordan marked this pull request as ready for review September 4, 2025 21:25
@Copilot Copilot AI review requested due to automatic review settings September 4, 2025 21:25
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements support for the --follow-symlinks flag in VSCE to eliminate unnecessary file copying during builds and significantly simplifies the build logic for PowerShell Editor Services (PSES) modules.

  • Added --follow-symlinks flag to the VSCE package command to handle symbolic links natively
  • Unified symlink handling logic for both Debug and Release configurations
  • Simplified PSES building to consistently use Invoke-Build and removed conditional copying logic

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
package.json Added --follow-symlinks flag to the VSCE package command
vscode-powershell.build.ps1 Simplified build logic by removing Debug/Release switch statement and file copying operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@andyleejordan andyleejordan enabled auto-merge (squash) September 4, 2025 21:26
@andyleejordan andyleejordan merged commit 0dc8035 into main Sep 4, 2025
11 checks passed
@andyleejordan andyleejordan deleted the copilot/fix-5169 branch September 4, 2025 22:06
@andyleejordan
Copy link
Member

Even having opted out of the broken enterprise ruleset I still couldn't get this to merge without a bypass 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build: Use --follow-symlinks in VSCE
3 participants