Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1080,73 +1080,73 @@
"command": "python.datascience.insertCellBelowPosition",
"title": "%python.command.python.datascience.insertCellBelowPosition.title%",
"category": "Python",
"when": "python.datascience.hascodecells && editorFocus && editorLangId == python && python.datascience.featureenabled"
"when": "python.datascience.hascodecells && python.datascience.featureenabled && !notebookEditorFocused"

Choose a reason for hiding this comment

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

Don't you also need editorFocus && editorLangId == python
So that we display these commands only for python files?

Copy link
Author

@joyceerhl joyceerhl Aug 5, 2020

Choose a reason for hiding this comment

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

Yeah I saw that that's what you recommended in #12529, but it turns out that:

  1. editorFocus doesn't work at all for some reason. It completely hides those commands. Possibly codelenses interfering? I'm not totally sure what's going on there. But it doesn't do what we want. This was why the commands weren't showing up for @greazer during demo earlier today.
  2. The python.datascience.hascodecells context key is equivalent to editorLangId == python, because we only set hascodecells if activeEditor.document.languageId === PYTHON_LANGUAGE:

if (activeEditor && activeEditor.document.languageId === PYTHON_LANGUAGE) {
// Inform the editor context that we have cells, fire and forget is ok on the promise here
// as we don't care to wait for this context to be set and we can't do anything if it fails
editorContext.set(hasCells(activeEditor.document, this.configuration.getSettings().datascience)).catch();

},
{
"command": "python.datascience.insertCellBelow",
"title": "%python.command.python.datascience.insertCellBelow.title%",
"category": "Python",
"when": "python.datascience.hascodecells && editorFocus && editorLangId == python && python.datascience.featureenabled"
"when": "python.datascience.hascodecells && python.datascience.featureenabled && !notebookEditorFocused"
},
{
"command": "python.datascience.insertCellAbove",
"title": "%python.command.python.datascience.insertCellAbove.title%",
"category": "Python",
"when": "python.datascience.hascodecells && editorFocus && editorLangId == python && python.datascience.featureenabled"
"when": "python.datascience.hascodecells && python.datascience.featureenabled && !notebookEditorFocused"
},
{
"command": "python.datascience.deleteCells",
"title": "%python.command.python.datascience.deleteCells.title%",
"category": "Python",
"when": "python.datascience.hascodecells && editorFocus && editorLangId == python && python.datascience.featureenabled"
"when": "python.datascience.hascodecells && python.datascience.featureenabled && !notebookEditorFocused"
},
{
"command": "python.datascience.selectCell",
"title": "%python.command.python.datascience.selectCell.title%",
"category": "Python",
"when": "python.datascience.hascodecells && editorFocus && editorLangId == python && python.datascience.featureenabled"
"when": "python.datascience.hascodecells && python.datascience.featureenabled && !notebookEditorFocused"
},
{
"command": "python.datascience.selectCellContents",
"title": "%python.command.python.datascience.selectCellContents.title%",
"category": "Python",
"when": "python.datascience.hascodecells && editorFocus && editorLangId == python && python.datascience.featureenabled"
"when": "python.datascience.hascodecells && python.datascience.featureenabled && !notebookEditorFocused"
},
{
"command": "python.datascience.extendSelectionByCellAbove",
"title": "%python.command.python.datascience.extendSelectionByCellAbove.title%",
"category": "Python",
"when": "python.datascience.hascodecells && editorFocus && editorLangId == python && python.datascience.featureenabled"
"when": "python.datascience.hascodecells && python.datascience.featureenabled && !notebookEditorFocused"
},
{
"command": "python.datascience.extendSelectionByCellBelow",
"title": "%python.command.python.datascience.extendSelectionByCellBelow.title%",
"category": "Python",
"when": "python.datascience.hascodecells && editorFocus && editorLangId == python && python.datascience.featureenabled"
"when": "python.datascience.hascodecells && python.datascience.featureenabled && !notebookEditorFocused"
},
{
"command": "python.datascience.moveCellsUp",
"title": "%python.command.python.datascience.moveCellsUp.title%",
"category": "Python",
"when": "python.datascience.hascodecells && editorFocus && editorLangId == python && python.datascience.featureenabled"
"when": "python.datascience.hascodecells && python.datascience.featureenabled && !notebookEditorFocused"
},
{
"command": "python.datascience.moveCellsDown",
"title": "%python.command.python.datascience.moveCellsDown.title%",
"category": "Python",
"when": "python.datascience.hascodecells && editorFocus && editorLangId == python && python.datascience.featureenabled"
"when": "python.datascience.hascodecells && python.datascience.featureenabled && !notebookEditorFocused"
},
{
"command": "python.datascience.changeCellToMarkdown",
"title": "%python.command.python.datascience.changeCellToMarkdown.title%",
"category": "Python",
"when": "python.datascience.hascodecells && editorFocus && editorLangId == python && python.datascience.featureenabled"
"when": "python.datascience.hascodecells && python.datascience.featureenabled && !notebookEditorFocused"
},
{
"command": "python.datascience.changeCellToCode",
"title": "%python.command.python.datascience.changeCellToCode.title%",
"category": "Python",
"when": "python.datascience.hascodecells && editorFocus && editorLangId == python && python.datascience.featureenabled"
"when": "python.datascience.hascodecells && python.datascience.featureenabled && !notebookEditorFocused"
},
{
"command": "python.datascience.runcurrentcell",
Expand Down Expand Up @@ -3685,4 +3685,4 @@
"publisherDisplayName": "Microsoft",
"publisherId": "998b010b-e2af-44a5-a6cd-0b5fd3b9b6f8"
}
}
}
2 changes: 1 addition & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@
"downloading.file.progress": "{0}{1} of {2} KB ({3}%)",
"DataScience.jupyterDataRateExceeded": "Cannot view variable because data rate exceeded. Please restart your server with a higher data rate limit. For example, --NotebookApp.iopub_data_rate_limit=10000000000.0",
"DataScience.addCellBelowCommandTitle": "Add cell",
"DataScience.debugCellCommandTitle": "Debug cell",
"DataScience.debugCellCommandTitle": "Debug Cell",
Copy link

Choose a reason for hiding this comment

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

Should all of the 'cell' commands have 'Cell' instead of 'cell'? There's others.

Choose a reason for hiding this comment

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

Agreed, we have localize('DataScience.addCellBelowCommandTitle', 'Add cell');, shouldn't this be Add Cell
FYI - in VS Code, they are capatalized, i.e. i'd make this change everywhere.

Copy link
Author

Choose a reason for hiding this comment

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

The rest of them don't even show up, I think we decided at some point last year not to show those codelenses. Can we remove them altogether?

Copy link
Author

Choose a reason for hiding this comment

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

Oops just saw Rich's followup above.

"DataScience.debugStepOverCommandTitle": "Step over",
"DataScience.debugContinueCommandTitle": "Continue",
"DataScience.debugStopCommandTitle": "Stop",
Expand Down
2 changes: 1 addition & 1 deletion src/client/common/utils/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ export namespace DataScience {
'Cannot view variable because data rate exceeded. Please restart your server with a higher data rate limit. For example, --NotebookApp.iopub_data_rate_limit=10000000000.0'
);
export const addCellBelowCommandTitle = localize('DataScience.addCellBelowCommandTitle', 'Add cell');
export const debugCellCommandTitle = localize('DataScience.debugCellCommandTitle', 'Debug cell');
export const debugCellCommandTitle = localize('DataScience.debugCellCommandTitle', 'Debug Cell');
Copy link
Member

Choose a reason for hiding this comment

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

Looks like the command above should be changed to match up.

Copy link
Author

Choose a reason for hiding this comment

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

Is the Add Cell codelens even supposed to be showing up anymore?

Copy link

Choose a reason for hiding this comment

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

I guess you could check the telemetry. It's still a command though.

export const debugStepOverCommandTitle = localize('DataScience.debugStepOverCommandTitle', 'Step over');
export const debugContinueCommandTitle = localize('DataScience.debugContinueCommandTitle', 'Continue');
export const debugStopCommandTitle = localize('DataScience.debugStopCommandTitle', 'Stop');
Expand Down