Gert-dev / php-ide-serenata

Atom IDE package that integrates the Serenata server to provide PHP code assistance
https://serenata.gitlab.io/
Other
275 stars 22 forks source link

Code lens display #491

Open jeremyFreeAgent opened 4 years ago

jeremyFreeAgent commented 4 years ago

Is it possible to have an option to display Code lens in the gutter bar as before?

Plus having it to appear suddenly in the editor (and moving lines) is a weird experience when selecting or moving cursor.

nelson6e65 commented 4 years ago

I agree; I dislike the addition of extra lines (spaces) in the code just for info.

In addition, I "fixed" (hacked) :sweat_smile: a console error , but I get this weird behavior with 'Override' text:

Captura de pantalla -2019-10-18 09-22-10

Well, I think it is because of the DocBlock methods documentation; with the linked error appearing there is not 'Override' text at all in my code with this files with this DocBlocks.

Gert-dev commented 4 years ago

Damn, and I was just happy that I could finally drop the legacy annotations behavior :smile: . I chose this approach because this is also the approach taken by other editors such as Visual Studio Code.

I'm trying to not introduce too much additional logic for this in this package for these kinds of things, as I'm hoping atom-languageclient and atom-ide-ui (now atom-ide-community) will pick up support for code lenses at some point. Currently this package uses a homebaked implementation because they don't have any yet.

The problem with the original annotations was also that they could basically only display one thing, i.e. there were no menus of any kind (not that they can't be added, of course).

Hopefully we can have a atom-ide-code-lens-annotations and atom-ide-code-lens-markers or something similar in the future to allow users to choose.

That said, with annotations I had some logic that didn't just remove and readd them constantly on every response. Instead, it tried to only prune those that no longer apply. Doing the same for this would ensure that the movement only happens the first time they are loaded.

@nelson6e65 Is it possible that the magic methods or properties in your docblock are actually overriding existing methods from the base class? In that way, they actually are an override (Serenata isn't smart enough yet to actually place them inside your docblock), but I agree that it doesn't look great in your screenshot :smile:. I had to do some tinkering with the markers, because Atom apparently has trouble displaying multiple of them on the same line.

nelson6e65 commented 4 years ago

Yes, They take me to the method when I click on them. They are functional; just have a wrong display. :sweat_smile:

jeremyFreeAgent commented 4 years ago

My current workaround is:

.php-ide-serenata-code-lens {
    display: block;
    position: fixed;
    right: 20px
}

It is not perfect, but it is avoiding the selection weird issue.

nelson6e65 commented 4 years ago

My current workaround is:

.php-ide-serenata-code-lens {
    display: block;
    position: fixed;
    right: 20px
}

It is not perfect, but it is avoiding the selection weird issue.

Thanks, @jeremyFreeAgent. I'll use this in the meantime.