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

Add command palette support and export from a file #3548

Merged
merged 5 commits into from
Dec 4, 2018
Merged

Conversation

rchiodo
Copy link

@rchiodo rchiodo commented Dec 4, 2018

For #3476 - Add command palette support
Also support exporting a file with and without running all of the cells in it.

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Has a news entry file (remember to thank yourself!)
  • Unit tests & system/integration tests are added/updated
  • Test plan is updated as appropriate
  • package-lock.json has been regenerated by running npm install (if dependencies have changed)

@rchiodo rchiodo self-assigned this Dec 4, 2018
<?xml version="1.0" encoding="utf-8"?>
Copy link
Author

@rchiodo rchiodo Dec 4, 2018

Choose a reason for hiding this comment

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

Forgot to mention we got new icons from Cherry. #ByDesign

@inject(ILogger) private logger: ILogger) {
}

public dispose() {
Copy link
Member

@IanMatthewHuff IanMatthewHuff Dec 4, 2018

Choose a reason for hiding this comment

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

Why is the dispose needed if it's a noop? #WontFix

Copy link
Author

Choose a reason for hiding this comment

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

I guess it isn't. All of the INotebook thingies implement Idisposable, but this one doesn't need to. Hmm. Well it would be simpler without it. I'll remove it.


In reply to: 238828207 [](ancestors = 238828207)

Copy link
Author

Choose a reason for hiding this comment

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

Actually I think I'll leave it for consistency's sake. It does no harm as nobody adds it to the disposable registry, but then this being the only one that isn't disposable seems odd.


In reply to: 238829492 [](ancestors = 238829492,238828207)

];
} else {
// Just a single markdown cell
return [generateMarkdownCell(code, file, line)];
Copy link
Member

@IanMatthewHuff IanMatthewHuff Dec 4, 2018

Choose a reason for hiding this comment

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

Using code here not copy means that one code path is using unix line endings and another code path is not. #Pending

Copy link
Author

Choose a reason for hiding this comment

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

Oh whoops. That was a mistake. Thanks.


In reply to: 238831404 [](ancestors = 238831404)

const firstNonMarkdown = splitMarkdown ? split.findIndex((l: string) => l.trim().length > 0 && !l.trim().startsWith('#')) : -1;
if (firstNonMarkdown >= 0) {
return [
generateMarkdownCell(split.slice(0, firstNonMarkdown).join('\n'), file, line),
Copy link
Member

@IanMatthewHuff IanMatthewHuff Dec 4, 2018

Choose a reason for hiding this comment

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

Could these just use a string[] so you don't need to do split / join / split on the same strings? #Pending

Copy link
Author

Choose a reason for hiding this comment

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

I guess I could have overloads. generateCell/generateMarkdownCell are called externally with just strings.


In reply to: 238832077 [](ancestors = 238832077)

Copy link
Author

Choose a reason for hiding this comment

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

actually I'm wrong, they're only called internally.


In reply to: 238832588 [](ancestors = 238832588,238832077)

Copy link
Member

Choose a reason for hiding this comment

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

not a big deal, it's not like it's an expensive operation. Just kinda scanned funny here.


In reply to: 238832588 [](ancestors = 238832588,238832077)

} else {
const activeEditor = this.documentManager.activeTextEditor;
if (activeEditor && activeEditor.document.languageId === PYTHON_LANGUAGE) {
await this.exportFileAndOutput(activeEditor.document.fileName);
Copy link
Member

@IanMatthewHuff IanMatthewHuff Dec 4, 2018

Choose a reason for hiding this comment

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

Copy paste error? Should just be export file. #Pending

Copy link
Author

Choose a reason for hiding this comment

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

You are right. That should be exportFile. I need to update the unit test.


In reply to: 238834387 [](ancestors = 238834387)

Copy link
Member

@IanMatthewHuff IanMatthewHuff left a comment

Choose a reason for hiding this comment

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

:shipit:

@rchiodo rchiodo merged commit 46650c0 into master Dec 4, 2018
@rchiodo rchiodo deleted the rchiodo/commands branch December 4, 2018 22:02
@lock lock bot locked as resolved and limited conversation to collaborators Jul 30, 2019
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.

None yet

2 participants