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

set ignoreOverrides false for ipynb and sql files #10499

Merged
merged 3 commits into from
May 19, 2020

Conversation

MaddyDev
Copy link
Contributor

This PR fixes #10490

@coveralls
Copy link

coveralls commented May 19, 2020

Coverage Status

Coverage increased (+0.008%) to 34.001% when pulling 37d9fd0 on fix/customIgnoreOverrides into d6b5489 on master.

@@ -125,7 +125,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
// preserve pre 1.38 behaviour to not make group active when preserveFocus: true
// but make sure to restore the editor to fix https://github.com/microsoft/vscode/issues/79633
activation: options.preserveFocus ? EditorActivation.RESTORE : undefined,
ignoreOverrides: true
ignoreOverrides: uri.fsPath.endsWith('ipynb') || uri.fsPath.endsWith('sql') ? false : true // {{SQL CARBON EDIT}}
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need a toLower() here (i.e. a file is *.SQL or *.IPYNB)? Does that scenario work, or do we need a toLower() here?

@@ -125,7 +125,7 @@ export class MainThreadTextEditors implements MainThreadTextEditorsShape {
// preserve pre 1.38 behaviour to not make group active when preserveFocus: true
// but make sure to restore the editor to fix https://github.com/microsoft/vscode/issues/79633
activation: options.preserveFocus ? EditorActivation.RESTORE : undefined,
ignoreOverrides: true
ignoreOverrides: uri.fsPath.toLowerCase().endsWith('ipynb') || uri.fsPath.toLowerCase().endsWith('sql') ? false : true // {{SQL CARBON EDIT}}
Copy link
Member

Choose a reason for hiding this comment

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

do we know that uri will never be undefined here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I've been testing this myself. I haven't gotten into this case yet, but we should be defensive about this for uri and probably uri.fsPath as well.

Copy link
Member

Choose a reason for hiding this comment

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

yeah, particularly with the change coming so close to the release. unless, we can see a null check further up the callstack, or uri being referenced unchecked lower in the stack (in which case it will fail anyways)

Copy link
Contributor

Choose a reason for hiding this comment

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

right, those 2 scenarios don't appear to be true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there's no null check for uri, but further up the callstack they're resolving the document uri before calling this:

return documentPromise.then(document => {

@MaddyDev MaddyDev merged commit 76c8094 into master May 19, 2020
MaddyDev added a commit that referenced this pull request May 19, 2020
* set ignoreOverrides false for ipynb and sql files

* toLowerCase

* null checks added
chlafreniere pushed a commit that referenced this pull request May 19, 2020
* set ignoreOverrides false for ipynb and sql files

* toLowerCase

* null checks added
@Charles-Gagnon Charles-Gagnon deleted the fix/customIgnoreOverrides branch July 23, 2020 15:04
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.

SQL/IPYNB files opened that use showTextDocument() API, are now shown a text editor.
5 participants