Skip to content

Commit 15de452

Browse files
authored
Support for symlinks for dart and flutter (#180)
* Add symlink support for flutter & dart * Windows support & tidy * Fix lint
1 parent 5ad341b commit 15de452

2 files changed

Lines changed: 26 additions & 12 deletions

File tree

docs/src/content/docs/reference/Supported-extensions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ List of extensions that can be automatically configured to use tools from
2929
| [php](https://marketplace.visualstudio.com/items?itemName=xdebug.php-debug), php built-in | `php.validate.executablePath`, `php.debug.executablePath` | Does not work with symlinks |
3030
| [julia](https://marketplace.visualstudio.com/items?itemName=julialang.language-julia) | `julia.executablePath` | Does not work with shims |
3131
| [erlang](https://marketplace.visualstudio.com/items?itemName=pgourlain.erlang) | `erlang.erlangPath` | Does not work with shims |
32-
| [dart](https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code) | `dart.sdkPath` | Does not work with shims or symlinks |
33-
| [flutter](https://marketplace.visualstudio.com/items?itemName=dart-code.flutter) | `dart.flutterSdkPath` | Does not work with shims or symlinks |
32+
| [dart](https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code) | `dart.sdkPath` | Does not work with shims |
33+
| [flutter](https://marketplace.visualstudio.com/items?itemName=dart-code.flutter) | `dart.flutterSdkPath` | Does not work with shims |
3434
| [zig](https://marketplace.visualstudio.com/items?itemName=ziglang.vscode-zig) | `zig.path`, `zig.zls.path` (install [zls](https://mise.jdx.dev/lang/zig.html#zig-language-server) with `mise`) | Does not work with shims or symlinks |
3535
| [sops](https://marketplace.visualstudio.com/items?itemName=signageos.signageos-vscode-sops) | `sops.binPath` | |
3636
| [ginkgo test explorer](https://marketplace.visualstudio.com/items?itemName=joselitofilho.ginkgotestexplorer) | `ginkgotestexplorer.ginkgoPath` | |

src/utils/supportedExtensions.ts

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -351,21 +351,35 @@ export const SUPPORTED_EXTENSIONS: Array<ConfigurableExtension> = [
351351
},
352352
},
353353
{
354-
toolNames: ["dart", "vfox:version-fox/vfox-dart"],
354+
toolNames: [
355+
"dart",
356+
"http:dart",
357+
"asdf:mise-plugins/mise-dart",
358+
"vfox:version-fox/vfox-dart",
359+
],
355360
extensionId: "Dart-Code.dart-code",
356-
generateConfiguration: async ({ tool }) => {
357-
return {
358-
"dart.sdkPath": tool.install_path,
359-
};
361+
generateConfiguration: async ({ miseService, tool, useSymLinks }) => {
362+
var folderPath = useSymLinks
363+
? await miseService.createMiseToolSymlink("dart", tool.install_path)
364+
: tool.install_path;
365+
366+
return { "dart.sdkPath": removeUnsupportedWorkspace(folderPath) };
360367
},
361368
},
362369
{
363-
toolNames: ["flutter", "vfox:version-fox/vfox-flutter"],
370+
toolNames: [
371+
"flutter",
372+
"http:flutter",
373+
"asdf:mise-plugins/mise-flutter",
374+
"vfox:version-fox/vfox-flutter",
375+
],
364376
extensionId: "dart-code.flutter",
365-
generateConfiguration: async ({ tool }) => {
366-
return {
367-
"dart.flutterSdkPath": tool.install_path,
368-
};
377+
generateConfiguration: async ({ miseService, tool, useSymLinks }) => {
378+
var folderPath = useSymLinks
379+
? await miseService.createMiseToolSymlink("flutter", tool.install_path)
380+
: tool.install_path;
381+
382+
return { "dart.flutterSdkPath": removeUnsupportedWorkspace(folderPath) };
369383
},
370384
},
371385
{

0 commit comments

Comments
 (0)