Skip to content

[BUG] ConfigManager is imported from RoboCop but not available in RoboCop 8 #577

@karlascholz-hcom

Description

@karlascholz-hcom

When running the current latest version RobotCode 2.2.0 and RoboCop 8.2.2 in VS Code, the RoboCop formatter/linter does not work anymore. This seems to be because of an invalid import:

ERROR:robotcode.language_server.common.parts.diagnostics.DiagnosticsProtocolPart:ImportError: cannot import name 'ConfigManager' from 'robocop.config' (/home/hcomuser/projects/hoyailog/test/robot/.venv/lib/python3.12/site-packages/robocop/config/__init__.py)
Traceback (most recent call last):
  File "/home/hcomuser/.vscode/extensions/d-biehl.robotcode-2.2.0/bundled/libs/robotcode/core/event.py", line 85, in _notify
    yield method(*__args, **__kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hcomuser/.vscode/extensions/d-biehl.robotcode-2.2.0/bundled/libs/robotcode/language_server/robotframework/parts/robocop_diagnostics.py", line 60, in collect_diagnostics
    return DiagnosticsResult(self.collect_diagnostics, self.collect(document, workspace_folder))
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hcomuser/.vscode/extensions/d-biehl.robotcode-2.2.0/bundled/libs/robotcode/language_server/robotframework/parts/robocop_diagnostics.py", line 77, in collect
    config_manager = self.parent.robocop_helper.get_config_manager(workspace_folder)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hcomuser/.vscode/extensions/d-biehl.robotcode-2.2.0/bundled/libs/robotcode/language_server/robotframework/parts/robocop_helper.py", line 62, in get_config_manager
    from robocop.config import ConfigManager
ImportError: cannot import name 'ConfigManager' from 'robocop.config' (/home/hcomuser/projects/hoyailog/test/robot/.venv/lib/python3.12/site-packages/robocop/config/__init__.py)

Steps To Reproduce
Steps to reproduce the behavior:

  1. Have RobotCode 2.2.0 and RoboCop 8.0.0 or newer running in VSCode
  2. Check the output of RobotCode Language Server

Desktop (please complete the following information):

  • VS Code Version 1.109.4
  • RobotCode Version 2.2.0
  • OS: Linux
  • Python Version 3.12.3
  • RobotFramework Version 7.4.1
  • RoboCop Version 8.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions