馃Χ Repro steps
I couldn't repro it when running unit tests like mentioned in #1936, but it seems to appear in the dev tools (can be seen in the dev tools output copied by users in https://github.com/microsoft/vscode-python/issues/8661, #8636 and https://github.com/microsoft/vscode-python/issues/8567). I couldn't get it to appear in my dev tools output, but we should still fix the document selector schemes.
馃攷 Impacted methods
- registerCodeLensProvider
- registerCompletionItemProvider
- registerDefinitionProvider
- registerDocumentFormattingEditProvider
- registerDocumentRangeFormattingEditProvider
- registerDocumentSymbolProvider
- registerHoverProvider
- registerOnTypeFormattingEditProvider
- registerReferenceProvider
- registerRenameProvider
- registerSignatureHelpProvider
馃┕ Prescribed solution
We already have a predefined python document selector: the PYTHON constant from constants.ts, let's use it.
馃洜 Todo
jedi.ts: make sure that registerOnTypeFormattingEditProvider uses this.documentSelector too
analysisOptions.ts: replace the const documentSelector assignment with const documentSelector = PYTHON (PYTHON from constants.ts) in getDocumentSelector
intellisenseProvider.ts: replace the basic 'python' filter with PYTHON from constants.ts in L.58-60
completionProvider.ts: update the activate method in LaunchJsonCompletionProvider (add scheme: 'file' to the first argument of registerCompletionItemProvider)
completionProvider.unit.test.ts: update the deepEqual() calls
datascience.ts: update registerCodeLensProvider
- make sure that none of the tests are failing
馃Χ Repro steps
I couldn't repro it when running unit tests like mentioned in #1936, but it seems to appear in the dev tools (can be seen in the dev tools output copied by users in https://github.com/microsoft/vscode-python/issues/8661, #8636 and https://github.com/microsoft/vscode-python/issues/8567). I couldn't get it to appear in my dev tools output, but we should still fix the document selector schemes.
馃攷 Impacted methods
馃┕ Prescribed solution
We already have a predefined python document selector: the
PYTHONconstant fromconstants.ts, let's use it.馃洜 Todo
jedi.ts: make sure thatregisterOnTypeFormattingEditProviderusesthis.documentSelectortooanalysisOptions.ts: replace theconst documentSelectorassignment withconst documentSelector = PYTHON(PYTHONfromconstants.ts) ingetDocumentSelectorintellisenseProvider.ts: replace the basic'python'filter withPYTHONfromconstants.tsin L.58-60completionProvider.ts: update theactivatemethod inLaunchJsonCompletionProvider(addscheme: 'file'to the first argument ofregisterCompletionItemProvider)completionProvider.unit.test.ts: update thedeepEqual()callsdatascience.ts: updateregisterCodeLensProvider