diff --git a/guides/windows.md b/guides/windows.md index 622939f3..0874e205 100644 --- a/guides/windows.md +++ b/guides/windows.md @@ -56,8 +56,7 @@ cmd /k "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxili ## Visual Studio Code users using ElixirLS -> Assuming you have _latest_ version of Build Tools, aligned with Visual Studio **2022**, -installed in its default installation path. +> Assuming you have _latest_ version of Build Tools, aligned with Visual Studio **2022**. Start Visual Studio Code from a PowerShell prompt within your project folder. @@ -76,10 +75,45 @@ Within your global `settings.json` or your workspace `.vscode\settings.json` add ```json { - "terminal.integrated.shell.windows": "cmd.exe", - "terminal.integrated.shellArgs.windows": [ - "/k", - "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat" - ] + "terminal.integrated.defaultProfile.windows": "PowerShell for VS2022", + // You can select one you like. + "terminal.integrated.profiles.windows": { + "Command Prompt for VS2022": { + "path": [ + "${env:windir}\\Sysnative\\cmd.exe", + "${env:windir}\\System32\\cmd.exe" + ], + "args": [ + // Please note that you need to change the directory to YOURS and translate the backslashes(`\` => `\\`). + "/k","D:\\VisualStudio\\VS2022\\Community\\Common7\\Tools\\VsDevCmd.bat", + "-startdir=none", + "-arch=x64", + "-host_arch=x64" + // In you have not installed whole VisualStudio, only use + // "D:\\VisualStudio\\VS2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat" + // or some directory you installed is better. + ], + "icon": "terminal-cmd" + }, + "PowerShell for VS2022": { + "source": "PowerShell", + "args": [ + "-NoExit", + "-Command", + // Don't forget let `"""` into `\"` in module part during copy. + "&{Import-Module \"D:\\VisualStudio\\VS2022\\Community\\Common7\\Tools\\Microsoft.VisualStudio.DevShell.dll\"; Enter-VsDevShell e182031c -SkipAutomaticLocation -DevCmdArguments \"-arch=x64 -host_arch=x64\"}" + ], + "icon": "terminal-powershell", + "env": {} + } + } } ``` + +> **How arguments come?** +> +> If you have Windows Terminal, after VS2022 installed, your Windows Terminal app should include `Developer Command Prompt for VS2022` and `Developer PowerShell for VS2022`. +> +> Next you just need to switch to "Configuration" and scroll down to "Profiles" and choose the one you prefer. +> +> After copy and paste, simply do like `~w()` sigil does in `args` part above, replacing the paths with your actual Visual Studio installation directory.