Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Inline all decorations #20042

Closed
wants to merge 5 commits into from
Closed

[WIP] Inline all decorations #20042

wants to merge 5 commits into from

Conversation

Krzysztof-Cieslak
Copy link
Contributor

@mention-bot
Copy link

@Krzysztof-Cieslak, thanks for your PR! By analyzing the history of the files in this pull request, we identified @egamma and @jrieken to be potential reviewers.

@msftclas
Copy link

msftclas commented Feb 6, 2017

Hi @Krzysztof-Cieslak, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by Microsoft and real humans are currently evaluating your PR.

TTYL, MSBOT;

@jrieken
Copy link
Member

jrieken commented Feb 6, 2017

Yeah, this how I said not to do it ;-) There is basically two issue with it and one makes not being able to reuse the goto error controller/widget. So problem 1 is that the widget reveals the line, therefore always scrolling to the last error which is unwanted and problem 2 is that errors that are on the same line are not sharing the widget.

@Krzysztof-Cieslak
Copy link
Contributor Author

Yeah, this how I said not to do it ;-)

That just the version I have done earlier, just created this PR to discuss it here ;)

I'll try to fix it soon.

@Krzysztof-Cieslak Krzysztof-Cieslak changed the title Inline all decorations [WIP] Inline all decorations Feb 6, 2017
@Krzysztof-Cieslak
Copy link
Contributor Author

OK, I think I've fixed 1 - I've added optional parameter to ZoneWidget.show which controls if showing widget should also scroll to it and reveal it. It defaults to true [old behavior], so all other places using this method are not changed

To the 2 - I actually like that each error is in its own widget, not sure if we should change it. But your call in the end.

@jrieken
Copy link
Member

jrieken commented Feb 9, 2017

Sorry for delay and for me making this more complicated now. I am prepending I didn't see the scrollTip hack and proposing a different solution which doesn't use the ZoneWidget anymore. That is because the ZoneWidget is quite dated and needs a bigger overhaul. So, if you feel a little adventurous and if you want to make a long lasting contribution bear with me ;-)

Let me explain two concepts the editor supports and how the ZoneWidget fits into this:

  • on the one side there are editor widgets that overlay the text, like the suggestion or find widgets
  • then there are view zones which can be used make room in between two lines. Originally this was added for the diff editor and the green/red stocked areas that show additions/removals.

The ZoneWidget is a combination of the two above. There is a view zone in it that "makes space" and then there a widget which is "manually" positioned on top of that view zone. Because for the editor it's two different things the widget itself needs to self-manage it, like manually setting style.top on the widget when the zone scrolls etc. Nothing that runs fast and nothing we are particularly proud of 🙈

The good news is that for showing all diagnostics, it's enough to just use view zones. The bad news is that it makes this PR a little more involving. The abstract of this feature would then be

  • label the existing bits toxic and start fresh'ish
  • have a new controller, like the MarkerController that knows an editor and the services
  • in the controller use the changeViewZones-api and reuse/get inspired by the MessageWidget. Because view zones are fast, simply create new zones for all markers when they change while active.
  • have some actions that drive the above controller

I hope I didn't scare you with this - I know it's a little work but it will result an implementation which is better then what we have today and that's what we want. I also happily assist you with getting this done. Happy Coding.

@Krzysztof-Cieslak
Copy link
Contributor Author

Thanks for all explanations, I'll come back to this PR on the weekend / next week.

@jrieken jrieken closed this Apr 13, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants