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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link to file lines #7960

Open
Ana06 opened this issue Jul 23, 2019 · 8 comments
Open

Add link to file lines #7960

Ana06 opened this issue Jul 23, 2019 · 8 comments
Labels
Feature Frontend Things related to the OBS RoR app

Comments

@Ana06
Copy link
Member

Ana06 commented Jul 23, 2019

I would like to be able to link a file line as I can for example do in Github. 馃檹 It is for example helpful when reporting problems related to a line of a spec file.

Example in GiHub: https://github.com/openSUSE/open-build-service/blob/master/src/api/app/models/user.rb#L689

@Ana06 Ana06 added Feature Frontend Things related to the OBS RoR app PR welcome 馃挄 labels Jul 23, 2019
@hennevogel
Copy link
Member

Works since we switched away from codemirror -> https://build.opensuse.org/request/show/670596#n4

@hennevogel
Copy link
Member

Ah this is about files...

@hennevogel hennevogel reopened this Sep 23, 2019
@danidoni
Copy link
Contributor

danidoni commented Oct 3, 2019

Just to be sure of the scope of the change. We're talking about linking to a file line in the CodeMirror code editor that pops up when opening a file, right?

For example, this one

@Ana06
Copy link
Member Author

Ana06 commented Oct 3, 2019

@danidoni

Just to be sure of the scope of the change. We're talking about linking to a file line in the CodeMirror code editor that pops up when opening a file, right?

Yes 馃槈

@danidoni
Copy link
Contributor

danidoni commented Oct 4, 2019

Ok, this is what I found out so far:

We use CodeMirror via the codemirror-rails gem. It does not implement line anchoring by default, and by looking at the code and past issues looks like its not doable unless we start forking it to apply our modifications.

So, what we can do from here?

  1. As I said, fork the CodeMirror js component, apply our changes on it, then fork also codemirror-rails to vendor our modified editor and use it in OBS. The downsides are that we have to maintain the fork, but given the last update of the codemirror-rails gem is from 3 years ago, I guess its no big deal...
  2. Try to address the problem in the CodeMirror editor. I have no idea how to come up with an implementation performant enough to make it into upstream given already stated concerns from CodeMirror's devs.
  3. Use some other editor. We have Ace that is actively developed and maintained by Mozilla. The downsides are that homehow I need to gather all the requirements for the file code editor and see if Ace meets them.

What do you think?

@danidoni
Copy link
Contributor

danidoni commented Oct 4, 2019

3. Use some other editor. We have [Ace](https://ace.c9.io/) that is actively developed and maintained by Mozilla. The downsides are that homehow I need to gather all the requirements for the file code editor and see if Ace meets them.

Well, I talked too much. Ace's way of accomplishing the line anchoring is probably doable with CodeMirror. I think I'll dig a bit more into this...

@danidoni
Copy link
Contributor

danidoni commented Oct 8, 2019

3. Use some other editor. We have [Ace](https://ace.c9.io/) that is actively developed and maintained by Mozilla. The downsides are that homehow I need to gather all the requirements for the file code editor and see if Ace meets them.

Well, I talked too much. Ace's way of accomplishing the line anchoring is probably doable with CodeMirror. I think I'll dig a bit more into this...

I've been looking into how Ace does the line anchoring.
In theory, its doable. Via editors[0].setCode({line: y, ch: x}).

But, it does not work for me. I guess the problem is that the code editor does not have a vertical scrollbar and I doubt very much that CodeMirror will scroll the whole browser page, that I guess its the point here.

@danidoni danidoni closed this as completed Oct 9, 2019
@danidoni danidoni reopened this Oct 9, 2019
@danidoni
Copy link
Contributor

danidoni commented Oct 9, 2019

Sorry, closed by mistake.

@hennevogel hennevogel added good first issue Easy task, perfect for a first contribution and removed PR welcome 馃挄 labels Jun 23, 2020
@hennevogel hennevogel removed the good first issue Easy task, perfect for a first contribution label Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Frontend Things related to the OBS RoR app
Projects
None yet
Development

No branches or pull requests

3 participants