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 core URI handlers #15935

Merged
merged 17 commits into from Nov 3, 2017

Conversation

Projects
None yet
5 participants
@BinaryMuse
Member

BinaryMuse commented Oct 18, 2017

Atom core should include URI handlers for extremely common tasks, like opening files. This PR implements any such handlers. 馃挱 s for other useful handlers are welcome.

  • Open file (with optional line and column numbers) 鈥斅atom://core/open/file?filename=urlEncodedFileName&line=n&column=n

Todo

Closes #2037

BinaryMuse added some commits Oct 18, 2017

@BinaryMuse

This comment has been minimized.

Show comment
Hide comment
@BinaryMuse

BinaryMuse Oct 19, 2017

Member

For the /core/open/file handler, it seems like it might be useful to do some URI parsing from the main process in order to call AtomApplication#windowForPaths or something similar to figure out which window we should route the URI event to.

On the other hand, package authors may wish to have access to similar information (that is, meta information about the various open Atom windows), so perhaps we should expose this across the application delegate somehow so it's accessible from renderer process code.

Member

BinaryMuse commented Oct 19, 2017

For the /core/open/file handler, it seems like it might be useful to do some URI parsing from the main process in order to call AtomApplication#windowForPaths or something similar to figure out which window we should route the URI event to.

On the other hand, package authors may wish to have access to similar information (that is, meta information about the various open Atom windows), so perhaps we should expose this across the application delegate somehow so it's accessible from renderer process code.

BinaryMuse added some commits Oct 19, 2017

@BinaryMuse BinaryMuse referenced this pull request Oct 19, 2017

Closed

Allows atom to open local files by URL scheme #14243

2 of 2 tasks complete
@BinaryMuse

This comment has been minimized.

Show comment
Hide comment
@BinaryMuse

BinaryMuse Oct 27, 2017

Member

This works, although it's not my absolute favorite strategy here. Open to 馃挱 s from @atom/maintainers if anyone has any :)

Member

BinaryMuse commented Oct 27, 2017

This works, although it's not my absolute favorite strategy here. Open to 馃挱 s from @atom/maintainers if anyone has any :)

@UziTech

This comment has been minimized.

Show comment
Hide comment
@UziTech

UziTech Oct 30, 2017

Contributor

I registered the open package to allow a link with the TextMate URL scheme to be open in Atom:

atom://open?url=file:///path/to/file.ext&line=10&column=2

One thing that would be really nice is if Atom could open an entire project that the file is in if it is not already open.

I'm not sure how we would define project, but that is my two cents.

Contributor

UziTech commented Oct 30, 2017

I registered the open package to allow a link with the TextMate URL scheme to be open in Atom:

atom://open?url=file:///path/to/file.ext&line=10&column=2

One thing that would be really nice is if Atom could open an entire project that the file is in if it is not already open.

I'm not sure how we would define project, but that is my two cents.

Rename AtomApplication#windows -> #windowStack
Update references across codebase
@nathansobo

This comment has been minimized.

Show comment
Hide comment
@nathansobo

nathansobo Nov 1, 2017

Contributor

Contributor

nathansobo commented on 2d20886 Nov 1, 2017

BinaryMuse added some commits Nov 2, 2017

@BinaryMuse BinaryMuse merged commit a3bb0bb into master Nov 3, 2017

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@BinaryMuse BinaryMuse deleted the mkt-core-uri-handlers branch Nov 3, 2017

@Ben3eeE

This comment has been minimized.

Show comment
Hide comment
@Ben3eeE

Ben3eeE Nov 3, 2017

Member

馃憦 馃帀

Member

Ben3eeE commented Nov 3, 2017

馃憦 馃帀

@nathansobo

This comment has been minimized.

Show comment
Hide comment
@nathansobo

nathansobo Nov 3, 2017

Contributor

馃挜

Contributor

nathansobo commented Nov 3, 2017

馃挜

win = new AtomWindow(this, @fileRecoveryService, {resourcePath, windowInitializationScript, devMode, safeMode, windowDimensions, env})
@windowStack.addWindow(win)
win.on 'window:loaded', ->
win.sendURIMessage url

This comment has been minimized.

@UziTech

UziTech Nov 4, 2017

Contributor

@BinaryMuse Any way we could use HistoryManager to check if url is in a project then load the entire project and open the url?

maybe we would want a setting to open individual files or project if found?

@UziTech

UziTech Nov 4, 2017

Contributor

@BinaryMuse Any way we could use HistoryManager to check if url is in a project then load the entire project and open the url?

maybe we would want a setting to open individual files or project if found?

@Arcanemagus Arcanemagus referenced this pull request Nov 15, 2017

Closed

Make the portal ID a link that opens in Atom #109

8 of 8 tasks complete
@RobinDaugherty

This comment has been minimized.

Show comment
Hide comment
@RobinDaugherty

RobinDaugherty Nov 16, 2017

@BinaryMuse it seems that line number in the URL is treated as a zero-indexed number while all other editors (and the Atom UI) treat this number as one-indexed. So a link to line=56 lands on line 57 in the UI. It seems like it might be best to change this to conform to other editors. Any preference?

RobinDaugherty commented Nov 16, 2017

@BinaryMuse it seems that line number in the URL is treated as a zero-indexed number while all other editors (and the Atom UI) treat this number as one-indexed. So a link to line=56 lands on line 57 in the UI. It seems like it might be best to change this to conform to other editors. Any preference?

@BinaryMuse

This comment has been minimized.

Show comment
Hide comment
@BinaryMuse

BinaryMuse Nov 16, 2017

Member

@RobinDaugherty Yes, I agree with you. I'll merge a change shortly to fix this. Thanks!

Member

BinaryMuse commented Nov 16, 2017

@RobinDaugherty Yes, I agree with you. I'll merge a change shortly to fix this. Thanks!

fabpot added a commit to symfony/symfony that referenced this pull request Dec 11, 2017

feature #25415 [FrameworkBundle] Add atom editor to ide config (lexcast)
This PR was merged into the 4.1-dev branch.

Discussion
----------

[FrameworkBundle] Add atom editor to ide config

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the master branch.
- Replace this comment by a description of what your PR is solving.
-->

Support for uri handler (added [here](atom/atom#15935)) in Atom editor is still in the current beta version. This works only for windows and mac.

Commits
-------

191b837 [FrameworkBundle] Add atom editor to ide config

@petecoop petecoop referenced this pull request Feb 21, 2018

Merged

Add Atom URI Handler #564

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