Repository: galaxyproject/galaxy-language-server (language: python)

Issue:
Suddenly tracebacks 
```
{'traceback': ['  File "/home/berntm/.vscode-oss/extensions/davelopez.galaxy-tools-0.10.0-universal/glsenv/lib/python3.10/site-packages/pygls/protocol.py", line 340, in _handle_request\n    self._execute_request(msg_id, handler, params)\n', '  File "/home/berntm/.vscode-oss/extensions/davelopez.galaxy-tools-0.10.0-universal/glsenv/lib/python3.10/site-packages/pygls/protocol.py", line 264, in _execute_request\n    self._send_response(msg_id, handler(params))\n', '  File "/home/berntm/.vscode-oss/extensions/davelopez.galaxy-tools-0.10.0-universal/glsenv/lib/python3.10/site-packages/galaxyls/server.py", line 114, in completions\n    if server.configuration.completion.mode == CompletionMode.DISABLED:\n']}
[Error - 12:24:31 PM] Request textDocument/completion failed.
  Message: AttributeError: 'dict' object has no attribute 'mode'
  Code: -32602 
```


Discussion / hints:
Thanks for reporting @bernt-matthias!

The latest version contains a major update of the underlying `pygls` library but I was hoping the tests would catch any breaking changes... 

I will investigate and try to fix it. In the meantime, if the extension is causing too much trouble, you can go back to the previous `0.9.0` version, there is no new functionality in 0.10.0 apart from all the updated dependencies and python 3.11 support.

On the other hand, if you keep using the latest version and detect any other traceback I will be very happy if you report them here :)

Fix patch:
diff --git a/server/galaxyls/config.py b/server/galaxyls/config.py
index 87de278..d7e50ac 100644
--- a/server/galaxyls/config.py
+++ b/server/galaxyls/config.py
@@ -39,7 +39,7 @@ class PlanemoConfig:
     """Planemo integration configuration."""
 
     enabled: bool = attrs.field(default=False)
-    binary_path: str = attrs.field(default="planemo", alias="binaryPath")
+    env_path: str = attrs.field(default="planemo", alias="envPath")
     galaxy_root: Optional[str] = attrs.field(default=None, alias="galaxyRoot")
     get_cwd: Optional[str] = attrs.field(default=None, alias="getCwd")
     testing: PlanemoTestingConfig = attrs.field(default=PlanemoTestingConfig())
@@ -52,3 +52,13 @@ class GalaxyToolsConfiguration:
     server: ServerConfig = attrs.field(default=ServerConfig())
     completion: CompletionConfig = attrs.field(default=CompletionConfig())
     planemo: PlanemoConfig = attrs.field(default=PlanemoConfig())
+
+    @classmethod
+    def from_config_dict(cls, config: dict):
+        result = GalaxyToolsConfiguration(
+            server=ServerConfig(**config["server"]),
+            completion=CompletionConfig(**config["completion"]),
+            planemo=PlanemoConfig(**config["planemo"]),
+        )
+        result.planemo.testing = PlanemoTestingConfig(**config["planemo"]["testing"])
+        return result
diff --git a/server/galaxyls/server.py b/server/galaxyls/server.py
index 9b69c2b..601ded4 100644
--- a/server/galaxyls/server.py
+++ b/server/galaxyls/server.py
@@ -88,7 +88,7 @@ async def _load_client_config_async(server: GalaxyToolsLanguageServer) -> None:
         config = await server.get_configuration_async(
             WorkspaceConfigurationParams(items=[ConfigurationItem(section="galaxyTools")])
         )
-        server.configuration = GalaxyToolsConfiguration(**config[0])
+        server.configuration = GalaxyToolsConfiguration.from_config_dict(config[0])
     except BaseException as err:
         server.show_message_log(f"Error loading configuration: {err}")
         server.show_message("Error loading configuration. Using default settings.", MessageType.Error)


Test patch:
diff --git a/server/galaxyls/tests/unit/test_config.py b/server/galaxyls/tests/unit/test_config.py
index 442fd8b..871c646 100644
--- a/server/galaxyls/tests/unit/test_config.py
+++ b/server/galaxyls/tests/unit/test_config.py
@@ -19,3 +19,27 @@ def test_init_sets_properties(self) -> None:
         assert config.server.silent_install is True
         assert config.completion.mode == CompletionMode.INVOKE
         assert config.completion.auto_close_tags is False
+
+    def test_init_configuration_from_dict(self):
+        config_dict = {
+            "server": {"silentInstall": False},
+            "completion": {"mode": "disabled", "autoCloseTags": True},
+            "planemo": {
+                "enabled": True,
+                "envPath": "/path/to/planemo",
+                "galaxyRoot": "/path/to/galaxy",
+                "testing": {"enabled": True, "autoTestDiscoverOnSaveEnabled": True, "extraParams": "--debug"},
+            },
+        }
+
+        config = GalaxyToolsConfiguration.from_config_dict(config_dict)
+
+        assert config.server.silent_install is False
+        assert config.completion.mode == CompletionMode.DISABLED
+        assert config.completion.auto_close_tags is True
+        assert config.planemo.enabled is True
+        assert config.planemo.env_path == "/path/to/planemo"
+        assert config.planemo.galaxy_root == "/path/to/galaxy"
+        assert config.planemo.testing.enabled is True
+        assert config.planemo.testing.auto_test_discover_on_save_enabled is True
+        assert config.planemo.testing.extra_params == "--debug"