Skip to content

Fix document selector warning in the extension#10546

Description

馃Χ 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-diagnosticsLogging/Features to facilitate diagnosing user problemsarea-internalLabel for non-user facing issuesdebtCode quality issuesverifiedVerification succeeded

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions