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

Refactor jump-to functionality, remove unused code #423

Merged
merged 18 commits into from
Dec 13, 2020

Conversation

krassowski
Copy link
Member

@krassowski krassowski commented Dec 12, 2020

  • implement jump back function
    • remove it from the context menu?
    • flip the icon (still displayed in the command palette)
  • remove unused code from @krassowski/jupyterlab_go_to_definition; these functions were never used in jupyterlab-lsp and can be still accessed from original @krassowski/jupyterlab_go_to_definition:
    • static analysis
    • kernel based-jumping (might be added back, but needs to be rewritten from scratch, as not in a maintainable state)
  • rename @krassowski/jupyterlab_go_to_definition to @krassowski/code-jumpers
  • move jumpers up the source tree to the /src
  • remove unused dependencies
  • implement ctrl + click jumping
    • add modifierKey and bindings
    • solve the issues preventing it from working
  • tests
    • test opening external files (symlinked) not this time
    • test jumping back
    • test ctrl+click jump

References

Fixes #370, fixes #372.

Code changes

TBD

User-facing changes

TBD

Backwards-incompatible changes

  • renamed the jumping implementation dependency to @krassowski/code-jumpers
  • changed interfaces in @krassowski/code-jumpers

Chores

  • linted
  • tested
  • documented
  • changelog entry

@krassowski krassowski marked this pull request as draft December 12, 2020 17:55
@bollwyvl
Copy link
Collaborator

Heavy! Let me know if I can assist in any way.

@krassowski krassowski marked this pull request as ready for review December 12, 2020 20:53
@krassowski
Copy link
Member Author

That would be it. I will try to merge PRs tomorrow and do a release before Monday. Feel free to review (though I will likely defer any major changes by opening issues out of comments). I am not sure how to test symlinking (only Ubuntu? all OSes?) - though not aiming to do this now (not enough time).

@bollwyvl
Copy link
Collaborator

Feel free to review

👀

I am not sure how to test symlinking

Should work fine on unixen... wouldn't bother on windows... guess i'll see more when i get there.

If this is about the .lsp_symlink... maybe we need to consider a configurable way to add additional stuff, somehow... shipping our own ContentsManager seems bad, but monkeypatching (a la jupytext seems worse).

CHANGELOG.md Outdated Show resolved Hide resolved
Click Element ${sel}
${original} = Measure Cursor Position
Capture Page Screenshot 01-ready-to-jump.png
Click Element ${sel} modifier=CTRL
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You think 🍎 people will expect ⌘ ?

Copy link
Member Author

@krassowski krassowski Dec 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it seems so there was a failure on this. Should we mention it in readme, or is it typically obvious to 🍎 people?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting post: https://nuclide.io/blog/2017/02/27/Command-Click-You-Have-One-Job/
I forgot about the multi-cursor placement! Ah, this is difficult to settle. If we keep Ctrl as default it might break workflow for some users; at least there is a setting for this; though indeed many IDEs use Ctrl + click for jump, and I think that fewer use for placement of additional cursors - so that seems like a tie to me.

@@ -38,13 +38,14 @@
"private": true,
"scripts": {
"bootstrap": "jlpm --no-optional --prefer-offline && lerna bootstrap && jlpm lint && jlpm clean && jlpm build",
"build": "jlpm build:schema && jlpm build:completion-theme && jlpm build:theme-material && jlpm build:theme-vscode && jlpm build:meta && jlpm build:ws",
"build": "jlpm build:schema && jlpm build:completion-theme && jlpm build:theme-material && jlpm build:theme-vscode && jlpm build:jump && jlpm build:meta && jlpm build:ws",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

honestly would love to get rid of this command, as build:meta should do it all...

}
}

jumpers.set('fileeditor', FileEditorJumper);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why side-effect?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

legacy, keeping as is for now, but needs a refactor in future.

@@ -29,10 +29,11 @@
},
"scripts": {
"build": "jlpm build:schema && tsc -b",
"build:schema": "jlpm build:schema-backend && jlpm build:schema-completion && jlpm build:schema-hover && jlpm build:schema-diagnostics && jlpm build:schema-syntax_highlighting",
"build:schema": "jlpm build:schema-backend && jlpm build:schema-completion && jlpm build:schema-hover && jlpm build:schema-diagnostics && jlpm build:schema-syntax_highlighting && jlpm build:schema-jump_to",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is getting long... could be lerna run build:schema and push the various schema builds into their respective packages?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, good idea; maybe not on this PR because the features are not packages just yet.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha, a very good point!

@bollwyvl
Copy link
Collaborator

Other than the OSX thing, LGTM aside from minor, unimpactful word suggestions. There's also the potential to make some of the schema building defined where it's used (rather than an increasingly long JSON line) and use lerna to find'm, but is not blocking.

@krassowski
Copy link
Member Author

krassowski commented Dec 13, 2020

Changing to Alt + click as default to avoid breaking UX for users using multi-cursor feature (this is how I did it in https://github.com/krassowski/jupyterlab-go-to-definition too).

@krassowski krassowski merged commit 6f16bfa into master Dec 13, 2020
@krassowski krassowski deleted the refactor-jump-to-definition branch February 16, 2021 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible to jump back after jump to definition? Add ctrl + click to jump to definition
2 participants