ionide-vscode-fsharp icon indicating copy to clipboard operation
ionide-vscode-fsharp copied to clipboard

Provide default settings for VSCode Explorer File Nesting feature

Open baronfel opened this issue 2 years ago • 4 comments

VSCode 1.67 provides a new File Nesting feature: docs

We should provide default explorer.fileNesting.patterns for F# files, so that when users turn the feature on via explorer.fileNesting.enabled F# just works.

Proposed mappings:

{
  "contributes": {
    "configurationDefaults": {
      "[fsharp]": {
        "explorer.fileNesting.patterns": {
          "*.fs": "${basename}.fsi, ${basename}.fs.js, ${basename}.fs.js.map",
          "*.fsl": "${basename}.fsi, ${basename}.fs",
          "*.fsy": "${basename}.fsi, ${basename}.fs"
        }
      }
    }
  }
}

baronfel avatar Jun 15 '22 12:06 baronfel

I think this is a very good idea

jasiozet avatar Jun 15 '22 12:06 jasiozet

@jasiozet would you be interested in contributing the feature? it would involve adding the above to release/package.json in the existing contributes section, then testing that the folding works as expected.

baronfel avatar Jun 15 '22 12:06 baronfel

Yes I can try to take a crack at it, but probably next week, as I have my wedding coming on Saturday :)

jasiozet avatar Jun 15 '22 13:06 jasiozet

image I think it needs to be in the main scope (not the language scope) But the problem is if it is in multiple file types it doesn't work properly: image

"explorer.fileNesting.patterns": {
    "*.xy": "${basename}.xy, ${basename}.xy.z, ${basename}.xy.j",
  }

Produces this: image and this: image From my testing the last section is properly evaluated. I am not sure how to test this with contributes, maybe this will behave correctly and they would be evaluated into 1 section?

Also worth considering:

"explorer.fileNesting.enabled": true,

This also need to be enabled on global level, not language level.

jasiozet avatar Jul 03 '22 10:07 jasiozet