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

VSCode-Pluto deep integration #17

Merged
merged 39 commits into from
Nov 19, 2021
Merged

VSCode-Pluto deep integration #17

merged 39 commits into from
Nov 19, 2021

Conversation

pankgeorg
Copy link
Member

@pankgeorg pankgeorg commented Nov 9, 2021

TODOs (for this PR):

  • Same session for equal URIs
  • "natively" Sync file to VS Code state
  • Handle file rename/moves and hide pluto file manager
  • make manual edits propagate to the pluto session (reverse the above)
  • cleanup (both .jl file and htmls) when last webview closes
  • Make the on_save hook official instead of the type piracy

@pankgeorg pankgeorg changed the title Open a file into VSCode-Pluto VSCode-Pluto deep integration Nov 10, 2021
document.uri,
new vscode.Range(0, 0, document.lineCount, 0),
f)
vscode.workspace.applyEdit(edit)
Copy link
Member Author

Choose a reason for hiding this comment

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

#18

@fonsp
Copy link
Contributor

fonsp commented Nov 17, 2021

Merged from main! (I wrote all these beautiful comments for you but you didn't use them 💔)

@fonsp

This comment has been minimized.

private static readonly viewType = 'plutoView';
private readonly pluto_asset_dir = join(tmpdir(), uuid())
private readonly webviews = new WebviewCollection();
private readonly uri_to_notebook_id_map = new Map <vscode.Uri, string>();
Copy link
Contributor

Choose a reason for hiding this comment

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

We have uri_to_notebook_id_map but webviews also contains this information, since we store the notebook id and uri for each webview. We could remove the uri_to_notebook_id_map and rewrite that functionality by searching webviews

Copy link
Contributor

Choose a reason for hiding this comment

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

Right now it is unclear if they are added, updated and removed at the same time, or if there are differences between the two.

@fonsp fonsp linked an issue Nov 18, 2021 that may be closed by this pull request
@fonsp fonsp marked this pull request as ready for review November 19, 2021 19:35
@fonsp
Copy link
Contributor

fonsp commented Nov 19, 2021

@pankgeorg i'm merging this! But take a look at the comment above

@pankgeorg
Copy link
Member Author

@pankgeorg i'm merging this! But take a look at the comment above

Thanks! ❤️

Merged from main! (I wrote all these beautiful comments for you but you didn't use them 💔)

Comments helped a lot! Truth is I went AWOL a bit earlier than I should for my job here to be complete, as you found out it had some serious glitches with opening non-existing notebooks. I'll refactor the URI hashmap, I added it because it helped managing the file renames but it's probably not necessary as you propose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants