Skip to content
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

.winget files being labeled as YAML not being persisted between sessions #229877

Closed
claudiaregio opened this issue Sep 26, 2024 · 4 comments · May be fixed by #232218
Closed

.winget files being labeled as YAML not being persisted between sessions #229877

claudiaregio opened this issue Sep 26, 2024 · 4 comments · May be fixed by #232218
Assignees
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@claudiaregio
Copy link

  • VS Code Version: 1.93.1
  • OS Version: Windows 11

Steps to Reproduce:

  1. Open VS Code
  2. Create x.winget file
  3. Add YAML code
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
  resources:
    - resource: Microsoft.WinGet.DSC/WinGetPackage
      id: install-dotnet8-SDK
      directives:
        description: Install .NET 8 SDK
        allowPrerelease: true
      settings:
        id: Microsoft.DotNet.SDK.8
        source: winget
    - resource: Microsoft.WinGet.DSC/WinGetPackage
      id: install-vs-code
      directives:
        description: Install Visual Studio Code
        allowPrerelease: true
      settings:
        id: Microsoft.VisualStudioCode
        source: winget
    - resource: Microsoft.VSCode.DSC/VSCodeExtension
      id: install-csharp-dev-kit
      dependsOn:
        - install-vs-code
      directives:
        description: Install C# Dev Kit
        allowPrerelease: true
      settings:
        name: ms-dotnettools.csdevkit
        exist: true
  configurationVersion: 0.2.0
  1. Click "Set Language Mode" in bottom right of Status Bar and switch to YAML
  2. Save file
  3. Close VS Code
  4. Reopen same file in VS Code
  5. File is back to plain text and I have to switch the language back to YAML every time
@aeschli aeschli assigned bpasero and unassigned aeschli Sep 27, 2024
@bpasero bpasero added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Sep 27, 2024
Copy link

We closed this issue because it is a question about using VS Code rather than an issue or feature request. Please search for help on StackOverflow, where the community has already answered thousands of similar questions. You may find their guide on asking a new question helpful if your question has not already been asked. See also our issue reporting guidelines.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2024
@RedCMD
Copy link
Contributor

RedCMD commented Oct 2, 2024

@claudiaregio would you like .winget added to the list of yaml file extensions?

@denelon
Copy link

denelon commented Oct 22, 2024

@RedCMD, that would be fantastic!

WinGet Configuration files are YAML, and the .winget file extension has an association with App Installer and Dev Home for "running" the configuration. It would be lovely if users could gain the benefit of the JSON schema to help validate these YAML configuration files. It's a hassle renaming the file extension or switching the language for every file across every session in the IDE.

@RedCMD
Copy link
Contributor

RedCMD commented Oct 25, 2024

https://learn.microsoft.com/en-us/windows/package-manager/configuration/create#file-naming-convention

pr: #232218

"files.associations": {
	"*.winget": "yaml"
}

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Nov 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants