Skip to content

Add @ApiStatus.Internal annotation on non-API code #380

Open

Description

@fbricon

This is will make it easier to understand what is considered API or not.

Activity

  1. angelozerr commented on Jun 21, 2024

    @angelozerr
    Contributor

    @CppCXY @InSyncWithFoo @seachicken @KUGDev @AlexWeinstein92 @aparnamichael @MituuZ @turkeylurkey @mrglavas @koxudaxi @FalsePattern please follow this issue.

    We wanted to do that in 0.0.2, but as you have reported so many issues (thanks for that!) we had no time to specifiy proper API. For the moment the clean API is only https://github.com/redhat-developer/lsp4ij/blob/main/src/main/java/com/redhat/devtools/lsp4ij/LanguageServerManager.java

    For the other classes, please try to avoid using it (except perhaps LSP4IJUtils) because we will mark as @ApiStatus.Internal a lot of classes.

    If you need to use some classes, please report that in this issue to discuss together and provide the best API. The main goal of this issue is to provide a clean and robust API in 0.0.3 to avoid breaking something in the future.

    Hope you will understand that.

  2. InSyncWithFoo commented on Jun 21, 2024

    @InSyncWithFoo
    Contributor

    I'm not sure what to think of this.

    LSP4IJ is now at a very low version number of 0.0.2. Unless you are not using SemVer, that obviously should mean "anything may change at anytime". You are taking your time designing a good API structure, and I'm taking my time experimenting with what you have to offer. You are providing me with code I could reuse, and I'm providing you my feedbacks as I use it. This benefits both of us.

    Personally, I would prefer it if I could just use whatever I want for my code to work. If your API were to suddenly change and break my existing code, I'll accept it: it's a part of our implicit contract from the very start anyway.

  3. KUGDev commented on Jun 21, 2024

    @KUGDev
    Contributor

    +1 for @InSyncWithFoo
    We are totally ok with the annotation. But I suppose it to mean that the other available parts should be properly documented for the correct usage or modification to avoid the situation where it is impossible to introduce necessary changes without changing the things marked with the annotation. Of course, it is not a mandatory for the non-GA version, from my perspective

  4. angelozerr commented on Jun 21, 2024

    @angelozerr
    Contributor

    @InSyncWithFoo don't be afraid with the API described in https://github.com/redhat-developer/lsp4ij/blob/main/docs/DeveloperGuide.md it will not change.

    The API which could change is for instance when you want to collect language server from a given file with

    * This class is considered internal and should not be used in other plugins.

    We would like providing high user level API instead of providing a lot of methods hosted in LanguageServiceAccessor that we could refactor because this class comes from https://github.com/eclipse/lsp4e/blob/main/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServiceAccessor.java which was adapted for IJ. I don't master the code of this class and I spend my time to clean up to have a better base code.

  5. InSyncWithFoo commented on Jun 21, 2024

    @InSyncWithFoo
    Contributor

    don't be afraid with the API described in main/docs/DeveloperGuide.md it will not change.

    I was referring to the classes that implement LSP features: diagnostics, completion, inlay hints, signature help, etc.

    For comparison, the native LSP APIs provides a default class/interface for each feature that can be inherited from to override default behaviours. For instance, I added support for WSL just by overriding LSPDiagnosticsSupport's .getFileUri() and .findFileByUri(), which I had initially expected to have been much, much harder. I would love to see a similarly well-designed model.

  6. angelozerr commented on Jun 21, 2024

    @angelozerr
    Contributor

    It is this kind of feedback that I love, thanks @InSyncWithFoo !

    We need to think about providing this similar API.

  7. mrglavas commented on Jun 21, 2024

    @mrglavas
    Contributor

    @angelozerr @fbricon This is going to be extremely helpful. Thank you for doing this.

    So far we've been borrowing LSP4MP4iJ from Quarkus Tools to support MicroProfile and then applying patterns that we've seen in Quarkus Tools to our other LSP clients in Liberty Tools. Our assumption has been that if you're using it in Quarkus Tools you must have considered it to be an API (at least at that moment in time) otherwise you wouldn't have been using it yourselves.

  8. angelozerr commented on Jun 21, 2024

    @angelozerr
    Contributor

    Our assumption has been that if you're using it in Quarkus Tools you must have considered it to be an API (at least at that moment in time) otherwise you wouldn't have been using it yourselves.

    Indeed, but it is not true today, it was hard to provide the best LSP support and take care of API both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions