Skip to content

Vscode workspace and relative path to dart sdk not working as expected #5401

@FMorschel

Description

@FMorschel

Describe the bug
When using the workspace feature for vscode and the sdkPath for some reason the relative path is not from the workspace file as everything else.

To Reproduce
Steps to reproduce the behavior:

  1. I placed a .code-workspace two folders up the directory tree on my machine than the Dart SDK
  2. server.code-workspace.txt (GitHub doesn't accept the extension so I had to add .txt)
  3. I had my sdk path on line 35 set to ~/dart
  4. Commented that line and duplicated it
  5. I built the SDK and now I pointed it to a folder inside the SDK one where the output happened
  6. See that the message for not finding a valid sdk folder has the relative folder twice:

The SDK configured in dart.sdkPath is not a valid SDK folder: C:\Users\felip_0vh5fa6\Documents\Projects\clones\dart-sdk2\sdk\pkg\analysis_server\dart-sdk2\sdk\out\ReleaseX64\dart-sdk

Expected behavior
I expected the path to be relative to the workspace file on my machine and not one of the folders it opens.

Screenshots

Image

Please complete the following information:

Workspace Environment
Dart Code extension: 3.103.20250121
Flutter extension: 3.103.20241202 (activated)

App: Visual Studio Code
App Host: desktop
Version: win 1.96.4

Workspace type: Dart (LSP) (Multiroot)
Workspace name: server2 (Workspace)

Dart (3.6.1): C:\Users\felip_0vh5fa6\.puro\shared\caches\e672b006cb34c921db85b8e2f482ed3144a4574b\dart-sdk
Flutter (3.27.3): C:\Users\felip_0vh5fa6\.puro\envs\stable\flutter (No device)

Output from 'dart info'

C:\Users\felip_0vh5fa6\.puro\shared\caches\e672b006cb34c921db85b8e2f482ed3144a4574b\dart-sdk\bin\dart.exe info

If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.

General info

  • Dart 3.6.1 (stable) (Tue Jan 7 09:50:00 2025 -0800) on "windows_x64"
  • on windows / "Windows 10 Pro" 10.0 (Build 22631)
  • locale is pt-BR

Project info

  • sdk constraint: '>=3.7.0-edge <4.0.0'
  • dependencies: _fe_analyzer_shared, analysis_server_plugin, analyzer, analyzer_plugin, args, collection, convert, crypto, dart_style, dtd, http, json_rpc_2, language_server_protocol, linter, memory_usage, meta, path, pub_semver, stream_channel, telemetry, unified_analytics, vm_service, watcher, yaml, yaml_edit
  • dev_dependencies: analyzer_utilities, cli_util, lints, logging, matcher, test, test_descriptor, test_reflective_loader, web_socket_channel

Process info

Memory CPU Elapsed time Command line
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions