github robotcodedev/robotcode v2.4.0

6 hours ago

Bug Fixes

  • dependencies: Update click version to 8.2.0 in requirements files (6e1220e)

  • vscode: Fix invalid glob pattern in selectConfigurationProfiles (58b5a8f)

    Remove extra closing brace in the file extension glob pattern that
    caused workspace folder detection to fail when selecting configuration
    profiles.

Features

  • plugin: Add fast exit option to Application.exit method (acfa7e9)

Performance

  • diagnostics: Skip full AST model parsing when no robotcode: markers present (7b3999e)

  • robot: Cache LibraryDoc for robot and resource files on disk (9b89623)

    Resource and robot files are now cached on disk between sessions.
    On subsequent opens, imports, keywords, and variables from these
    files are loaded from cache instead of being re-parsed, resulting
    in faster startup and quicker response times when navigating
    projects with many resource files.

    The cache is automatically invalidated when a file is modified
    on disk. Files that are currently open in the editor always use
    the live content and bypass the disk cache.

  • robot: Remove unnecessary token list caching from document cache (5f8591d)

    Token lists were cached separately in document._cache, but only used
    as intermediate input for AST model building. No external caller ever
    accessed the cached token lists directly.

    Move token generation into model builder methods so tokens are only
    produced on cache miss. On cache hit, neither tokenization nor model
    building occurs.

    • Eliminates up to 6 cached token lists per document in Language Server
    • No behavior change for CLI (tokens were already uncached for version=None)
    • Remove ~80 lines of redundant caching infrastructure
  • robot: Use file_id tuples instead of os.path.samefile for path comparison (3f3bd84)

    Replace repeated os.path.samefile() calls (2x stat per call) in namespace
    import loops with pre-computed (st_dev, st_ino) tuple comparisons.

    • Add FileId type, file_id() and same_file_id() to core utils
    • Add lazy source_id property to LibraryDoc (excluded from pickle)
    • Pre-compute source_id on Namespace init
    • Compute file_id once per find_resource result instead of per-iteration

Refactor

  • imports_manager: Cleanup and fix correctness issues (25ef49c)

  • robot: Remove unnecessary finalizers and dispose chain (eaa7e14)

    Remove redundant _release_watchers_finalizer from _ImportEntry — file
    watcher cleanup is already handled explicitly by _remove_file_watcher()
    during invalidation and by server_shutdown() at LS shutdown.

    Remove the _dispose_finalizer/dispose() chain through ImportsManager,
    DocumentsCacheHelper, RobotFrameworkLanguageProvider, CodeAnalyzer, and
    CLI. With the per-entry finalizers gone, these only cleared dicts that
    Python already cleans up at process exit.

    Fix broken finalizer in Workspace.add_file_watchers() where the closure
    captured the entry object, preventing it from ever being garbage
    collected.

    Set atexit=False on sentinel finalizers so they only fire during normal
    GC (needed for LS live cleanup), not at interpreter shutdown.

  • robot: Replace del with weakref.finalize in imports_manager (e0e8d81)

    Replace fragile __del__ methods with weakref.finalize in both
    _ImportEntry and ImportsManager for reliable cleanup:

    • _ImportEntry: register finalizer in init with file_watchers list
      and file_watcher_manager as strong refs (no self access needed);
      change _remove_file_watcher to use .clear() instead of = []
    • ImportsManager: register finalizer lazily in executor property when
      ProcessPoolExecutor is created; add static _shutdown_executor callback

    weakref.finalize is guaranteed to run even with circular references
    and does not prevent garbage collection of reference cycles.

Testing

  • Add library folder to test project (45c410f)

Don't miss a new robotcode release

NewReleases is sending notifications on new releases.