Skip to content

Conversation

MischaPanch
Copy link
Contributor

@MischaPanch MischaPanch commented Aug 23, 2025

Made use of in csharp and intelephense LS

@opcode81 : it would probably have been better to configure ls_specifics in serena_config instead of the project config, but that would have required a refactoring and I didn't want to do that (not important enough IMO)

Made use of in csharp and intelephense LS
@MischaPanch
Copy link
Contributor Author

@johngambleubind took a bit longer, but here it is: the possibility to configure the download path through adjusting project settings.

If some setting is missing, you can build on top of this and add it in a PR

@opcode81
Copy link
Contributor

opcode81 commented Aug 24, 2025

@opcode81 : it would probably have been better to configure ls_specifics in serena_config instead of the project config, but that would have required a refactoring and I didn't want to do that (not important enough IMO)

We discussed that it should be in serena_config.
Why would a refactoring be required? Project.create_language_server can be passed the dictionary from SerenaConfig, just like it is passed trace_lsp_communication from there, too. We could even just pass the SerenaConfig instance.

initialize_params["initializationOptions"] = {"licenceKey": license_key}
initialization_options["licenceKey"] = license_key

custom_intelephense_settings = self._solidlsp_settings.ls_specifics.get(self.__class__.__name__, {})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We originally discussed that we would use the enum item's value that is associated with the language server.
Do you think the class name is a better option?
Right now, the Language enum is actually a LanguageServer enum - and perhaps we should rename it accordingly - and use it accordingly.

Copy link
Contributor

@opcode81 opcode81 Aug 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the enum value would be preferable, because the user is already familiar with the respective values.
And we should probably document the possible options in serena_config.yml to make this accessible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@opcode81 opcode81 Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation in serena_config.template..yml is not updated to describe the new usage and does not list the possible options. Still says this:

Maps the language server class name to the options. Have a look at the docstring of the constructors of the LS implementations ...

…ation

Use this as key for ls_specifics.
Also moved ls_specifics to SerenaConfig instead of ProjectConfig
# Conflicts:
#	src/serena/config/serena_config.py
#	src/solidlsp/ls.py
@MischaPanch
Copy link
Contributor Author

@opcode81 Since I did not want to repeat the code connecting the enum to the class, I have "simplified" the SolidLanguagServer.create method and clearly commented on the unusual pattern used there. Not super nice, but IMO better than copy-pasting the whole logic and with the comment it's rather clear. Later on we can generally improve the create/init separation

@@ -266,6 +267,7 @@ def create_language_server(
log_level: int = logging.INFO,
ls_timeout: float | None = DEFAULT_TOOL_TIMEOUT - 5,
trace_lsp_communication: bool = False,
ls_specifics: dict[Language, Any] | None = None,
Copy link
Contributor

@opcode81 opcode81 Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we just add SerenaConfig as an argument? What do you think?
(I am not sure what I prefer)

@@ -33,6 +33,12 @@ trace_lsp_communication: False
# whether to trace the communication between Serena and the language servers.
# This is useful for debugging language server issues.

ls_specifics: {}
Copy link
Contributor

@opcode81 opcode81 Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you like the name "ls_specifics"? I think it's a bit vague.
How about "ls_specific_settings" or "ls_advanced_settings"?

@opcode81
Copy link
Contributor

@opcode81 Since I did not want to repeat the code connecting the enum to the class, I have "simplified" the SolidLanguagServer.create method and clearly commented on the unusual pattern used there. Not super nice, but IMO better than copy-pasting the whole logic and with the comment it's rather clear. Later on we can generally improve the create/init separation

Agreed. Not super nice, but good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants