Visitar URL original
Unable to edit document because the file was not previously opened · Issue #6088 · Dart-Code/Dart-Code · GitHub
Skip to content

Unable to edit document because the file was not previously opened #6088

Description

@FMorschel

Describe the bug
I tried running Fix all in workspace but I got the message above.

To Reproduce
Steps to reproduce the behavior:
Working on it. I've not had success reproducing it yet.

Expected behavior
For the command to work as if I ran dart fix --apply.

Screenshots

Image

Logs
I've shortened the log to when I got the error messages.

analyzer_redacted.log

Please complete the following information:

Workspace Environment
Dart Code extension: 3.137.20260611
Flutter extension: 3.137.20260601 (activated)

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

Workspace type: Flutter (LSP)
Workspace name: REDACTED

Dart (3.11.5): C:\Users\felipe-m\.puro\shared\caches\42d3d75a56efe1a2e9902f52dc8006099c45d937\dart-sdk
Flutter (3.41.9): C:\Users\felipe-m\.puro\envs\3.41.9\flutter (No device)

Output from 'dart info'

C:\Users\felipe-m\.puro\shared\caches\42d3d75a56efe1a2e9902f52dc8006099c45d937\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.11.5 (stable) (Wed Apr 15 00:36:32 2026 -0700) on "windows_x64"
  • on windows / "Windows 11 Pro" 10.0 (Build 26200)
  • locale is pt-BR

Project info

  • sdk constraint: '^3.11.0'
  • dependencies: android_id, app_links, app_settings, archive, badges, camera, carousel_slider, collection, connectivity_plus, cupertino_icons, device_info_plus, disk_space_plus, firebase_core, firebase_messaging, fl_chart, flutter, flutter_dotenv, flutter_email_sender, flutter_foreground_task, flutter_html, flutter_local_notifications, flutter_localizations, flutter_logs, flutter_map, flutter_native_splash, flutter_secure_storage, flutter_slidable, flutter_svg, flutter_zxing, geolocator, get_it, google_fonts, http, http_interceptor, image_picker, intl, json_table, latlong2, mocktail, network_info_plus, open_file, package_info_plus, path, path_provider, pdfrx, permission_handler, provider, retry, share_plus, shared_preferences, signature, sleek_circular_slider, sqflite, sqflite_common_ffi, table_calendar, upgrader, url_launcher, wakelock_plus
  • dev_dependencies: flutter_launcher_icons, flutter_test, integration_test, lint, test
  • elided dependencies: 2

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
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dart.exe
0 MB -- dartvm.exe
0 MB -- dartvm.exe
0 MB -- dartvm.exe
0 MB -- dartvm.exe
0 MB -- dartvm.exe
Output from 'flutter doctor'

C:\Users\felipe-m\.puro\envs\3.41.9\flutter\bin\flutter.bat doctor -v

[√] Flutter (Channel stable, 3.41.9, on Microsoft Windows [Version 10.0.26200.8457], locale pt-BR) [1.012ms]
    • Flutter version 3.41.9 on channel stable at C:\Users\felipe-m\.puro\envs\3.41.9\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 00b0c91f06 (7 weeks ago), 2026-04-29 10:03:19 -0700
    • Engine revision 42d3d75a56
    • Dart version 3.11.5
    • DevTools version 2.54.2
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[√] Windows Version (Windows 11 or higher, 25H2, 2009) [3,6s]

[√] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [3,9s]
    • Android SDK at C:\AndroidStudioSdk
    • Emulator version 36.5.11.0 (build_id 15261927) (CL:N/A)
    • Platform android-36.1, build-tools 36.1.0
    • ANDROID_HOME = C:\AndroidStudioSdk
    • Java binary at: C:\RECH\zulu17.0.18\x64\bin\java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment Zulu17.64+17-CA (build 17.0.18+8-LTS)
    • All Android licenses accepted.

[√] Chrome - develop for the web [214ms]
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2026 18.5.2) [212ms]
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\18\Community
    • Visual Studio Community 2026 version 18.5.11723.231
    • Windows 10 SDK version 10.0.26100.0

[√] Connected device (4 available) [607ms]
    • sdk gphone64 x86 64 (mobile) • emulator-5556 • android-x64    • Android 16 (API 36) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.26200.8457]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 148.0.7778.179
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 148.0.3967.96

[√] Network resources [765ms]
    • All expected network resources are available.

• No issues found!

Activity

  1. self-assigned this
    on Jun 17, 2026
  2. DanTup commented on Jun 17, 2026

    @DanTup
    Member

    I see this in the logs:

    [10:03:54] [Analyzer] [Info] ==> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///[repoRoot]/[path74]","version":2},"contentChanges":[{"range":{"start":{"line":10,"character":6},"end":{"line":10,"character":31}},"rangeLength":25,"text":"[redacted]"},{"range":{"start":{"line":9,"character":48},"end":{"line":9,"character":48}},"rangeLength":0,"text":"[redacted]"}]},"clientRequestTime":1781528634671}
    [10:03:54] [Analyzer] [Info] ==> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///[repoRoot]/[path74]","languageId":"dart","version":1,"text":"[redacted]"}},"clientRequestTime":1781528634713}
    [10:03:54] [Analyzer] [Info] <== {"jsonrpc":"2.0","method":"window/showMessage","params":{"message":"Unable to edit document because the file was not previously opened: [repoRoot]/[path74]","type":1}}
    

    It does appear that a didChange went to the server before the didOpen. I'm pretty sure this is going to be related to delayOpenNotifications, though scanning through the code I don't see an obvious problem.

    I'll do some more digging later this week. If you do find a way to repro, please let me know. If we can't find anything, then I may revert that flag (I'm starting to wonder if it's worth the effort!).

  3. added this to the v3.138.0 milestone on Jun 17, 2026
  4. added
    in editorRelates to code editing or language features
    on Jun 17, 2026
  5. DanTup commented on Jun 29, 2026

    @DanTup
    Member

    I'm disabling delayOpenNotifications for now until we've tracked this down. It could be unrelated, but I suspect it's related and I haven't been able to repro yet.

  6. modified the milestones: v3.138.0, v3.140.0 on Jun 29, 2026
  7. modified the milestones: v3.140.0, v3.142.0 on Jul 28, 2026
  8. modified the milestones: v3.142.0, v3.144.0 on Aug 26, 2026
  9. modified the milestones: v3.144.0, v3.146.0 on Sep 21, 2026
  10. modified the milestones: v3.146.0, On Deck on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in editorRelates to code editing or language featuresis bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions