diff --git a/.eslintignore b/.eslintignore index bb0ff4902719..075ab58d5d6f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -191,14 +191,6 @@ src/test/application/misc/joinMailingListPrompt.unit.test.ts src/test/performance/load.perf.test.ts -src/test/refactor/extension.refactor.extract.method.test.ts -src/test/refactor/extension.refactor.extract.var.test.ts - -src/test/workspaceSymbols/provider.unit.test.ts -src/test/workspaceSymbols/common.ts -src/test/workspaceSymbols/main.unit.test.ts -src/test/workspaceSymbols/generator.unit.test.ts - src/client/interpreter/configuration/interpreterSelector/commands/base.ts src/client/interpreter/configuration/interpreterSelector/commands/resetInterpreter.ts src/client/interpreter/configuration/interpreterSelector/commands/setShebangInterpreter.ts @@ -223,27 +215,16 @@ src/client/terminals/codeExecution/terminalCodeExecution.ts src/client/terminals/codeExecution/codeExecutionManager.ts src/client/terminals/codeExecution/djangoContext.ts -src/client/providers/objectDefinitionProvider.ts src/client/providers/serviceRegistry.ts -src/client/providers/symbolProvider.ts src/client/providers/completionSource.ts -src/client/providers/renameProvider.ts -src/client/providers/hoverProvider.ts -src/client/providers/itemInfoSource.ts src/client/providers/formatProvider.ts src/client/providers/importSortProvider.ts src/client/providers/replProvider.ts src/client/providers/codeActionProvider/main.ts src/client/providers/codeActionProvider/launchJsonCodeActionProvider.ts src/client/providers/codeActionProvider/pythonCodeActionProvider.ts -src/client/providers/docStringFoldingProvider.ts src/client/providers/linterProvider.ts -src/client/providers/simpleRefactorProvider.ts -src/client/providers/completionProvider.ts -src/client/providers/definitionProvider.ts -src/client/providers/referenceProvider.ts src/client/providers/terminalProvider.ts -src/client/providers/signatureProvider.ts src/client/activation/languageServer/manager.ts src/client/activation/languageServer/languageServerExtension.ts @@ -464,9 +445,3 @@ src/client/application/diagnostics/commands/factory.ts src/client/application/diagnostics/commands/execVSCCommand.ts src/client/application/diagnostics/commands/launchBrowser.ts -src/client/refactor/proxy.ts -src/client/workspaceSymbols/main.ts -src/client/workspaceSymbols/generator.ts -src/client/workspaceSymbols/parser.ts -src/client/workspaceSymbols/provider.ts - diff --git a/.github/test_plan.md b/.github/test_plan.md index 4f313c7649e5..498f3c071150 100644 --- a/.github/test_plan.md +++ b/.github/test_plan.md @@ -141,36 +141,15 @@ SPAM='hello ${WHO}' - [ ] Create a virtual environment - [ ] Install `requests` into the virtual environment -#### Pylint/default linting - -[Prompting to install Pylint is covered under `Environments` above] - -For testing the disablement of the default linting rules for Pylint: - -```ini -# pylintrc -[MESSAGES CONTROL] -enable=bad-names -``` - -```python3 -# example.py -foo = 42 # Marked as a disallowed name. -``` - -- [ ] Installation via the prompt installs Pylint as appropriate - - [ ] Uses `--user` for system-install of Python - - [ ] Installs into a virtual environment environment directly -- [ ] Pylint works -- [ ] The existence of a `pylintrc` file turns off the default rules - -#### Other linters +#### Linting **Note**: - You can use the `Run Linting` command to run a newly installed linter - When the extension installs a new linter, it turns off all other linters +- [ ] pylint works + - [ ] `Select linter` lists the linter and installs it if necessary - [ ] flake8 works - [ ] `Select linter` lists the linter and installs it if necessary - [ ] mypy works @@ -223,14 +202,6 @@ def foo():pass - [ ] yapf - [ ] `"editor.formatOnType": true` works and has expected results -#### [Refactoring](https://code.visualstudio.com/docs/python/editing#_refactoring) - -- [ ] [`Extract Variable`](https://code.visualstudio.com/docs/python/editing#_extract-variable) works - - [ ] You are prompted to install `rope` if it is not already available -- [ ] [`Extract method`](https://code.visualstudio.com/docs/python/editing#_extract-method) works - - [ ] You are prompted to install `rope` if it is not already available -- [ ] [`Sort Imports`](https://code.visualstudio.com/docs/python/editing#_sort-imports) works - ### [Debugging](https://code.visualstudio.com/docs/python/debugging) - [ ] [Configurations](https://code.visualstudio.com/docs/python/debugging#_debugging-specific-app-types) work (see [`package.json`](https://github.com/Microsoft/vscode-python/blob/main/package.json) and the `"configurationSnippets"` section for all of the possible configurations) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0c37edaa8f23..afe52e99ce97 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,7 +12,6 @@ ".vscode-test": false, ".vscode test": false, "**/.mypy_cache/**": true, - "**/.ropeproject/**": true }, "search.exclude": { "out": true, // set this to false to include "out" folder in search results @@ -45,7 +44,6 @@ "typescript.tsdk": "./node_modules/typescript/lib", // we want to use the TS server from our node_modules folder to control its version "python.linting.enabled": false, "python.testing.promptToConfigure": false, - "python.workspaceSymbols.enabled": false, "python.formatting.provider": "black", "typescript.preferences.quoteStyle": "single", "javascript.preferences.quoteStyle": "single", diff --git a/build/conda-functional-requirements.txt b/build/conda-functional-requirements.txt index 4237bde6d759..276e241bbf0f 100644 --- a/build/conda-functional-requirements.txt +++ b/build/conda-functional-requirements.txt @@ -11,7 +11,6 @@ pycodestyle pydocstyle nose pytest==4.6.9 # Last version of pytest with Python 2.7 support -rope fastapi ; python_version>='3.6' uvicorn ; python_version>='3.6' flask diff --git a/build/test-requirements.txt b/build/test-requirements.txt index 04366eb8f0c7..f1d5761b0feb 100644 --- a/build/test-requirements.txt +++ b/build/test-requirements.txt @@ -10,7 +10,6 @@ pycodestyle pydocstyle prospector ; python_version > '2.7' pytest<6 ; python_version > '2.7' # Tests currently fail against pytest 6. -rope flask fastapi ; python_version > '2.7' uvicorn ; python_version > '2.7' diff --git a/news/3 Code Health/10440.md b/news/3 Code Health/10440.md new file mode 100644 index 000000000000..e237305ef278 --- /dev/null +++ b/news/3 Code Health/10440.md @@ -0,0 +1 @@ +Remove support for `rope`. Refactoring now supported via language servers. diff --git a/news/3 Code Health/13321.md b/news/3 Code Health/13321.md new file mode 100644 index 000000000000..83c8d97b63ea --- /dev/null +++ b/news/3 Code Health/13321.md @@ -0,0 +1 @@ +Remove `pylintMinimalCheckers` setting. Syntax errors now reported via language servers. diff --git a/news/3 Code Health/16063.md b/news/3 Code Health/16063.md new file mode 100644 index 000000000000..f2a1346b9474 --- /dev/null +++ b/news/3 Code Health/16063.md @@ -0,0 +1 @@ +Remove `ctags` support. Workspace symbols now supported via language servers. diff --git a/package.json b/package.json index 0b80082c0cd4..4bf27cbd27bd 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,6 @@ "onCommand:python.viewOutput", "onCommand:python.execSelectionInTerminal", "onCommand:python.execSelectionInDjangoShell", - "onCommand:python.buildWorkspaceSymbols", "onCommand:python.startREPL", "onCommand:python.goToPythonObject", "onCommand:python.reportIssue", @@ -308,11 +307,6 @@ "command": "python.analysis.restartLanguageServer", "title": "%python.command.python.analysis.restartLanguageServer.title%" }, - { - "category": "Python", - "command": "python.buildWorkspaceSymbols", - "title": "%python.command.python.buildWorkspaceSymbols.title%" - }, { "category": "Python", "command": "python.clearPersistentStorage", @@ -380,16 +374,6 @@ "command": "python.launchTensorBoard", "title": "%python.command.python.launchTensorBoard.title%" }, - { - "category": "Python Refactor", - "command": "python.refactorExtractMethod", - "title": "%python.command.python.refactorExtractMethod.title%" - }, - { - "category": "Python Refactor", - "command": "python.refactorExtractVariable", - "title": "%python.command.python.refactorExtractVariable.title%" - }, { "category": "Python", "command": "python.refreshTensorBoard", @@ -1275,47 +1259,6 @@ "description": "Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs).", "scope": "machine", "type": "string" - }, - "python.workspaceSymbols.ctagsPath": { - "default": "ctags", - "description": "Fully qualified path to the ctags executable (else leave as ctags, assuming it is in current path).", - "scope": "resource", - "type": "string" - }, - "python.workspaceSymbols.enabled": { - "default": false, - "description": "Set to 'true' to enable ctags to provide Workspace Symbols.", - "scope": "resource", - "type": "boolean" - }, - "python.workspaceSymbols.exclusionPatterns": { - "default": [ - "**/site-packages/**" - ], - "description": "Pattern used to exclude files and folders from ctags See http://ctags.sourceforge.net/ctags.html.", - "items": { - "type": "string" - }, - "scope": "resource", - "type": "array" - }, - "python.workspaceSymbols.rebuildOnFileSave": { - "default": true, - "description": "Whether to re-build the tags file on when changes made to python files are saved.", - "scope": "resource", - "type": "boolean" - }, - "python.workspaceSymbols.rebuildOnStart": { - "default": true, - "description": "Whether to re-build the tags file on start (defaults to true).", - "scope": "resource", - "type": "boolean" - }, - "python.workspaceSymbols.tagFilePath": { - "default": "${workspaceFolder}/.vscode/tags", - "description": "Fully qualified path to tag file (exuberant ctag file), used to provide workspace symbols.", - "scope": "resource", - "type": "string" } }, "title": "Python", @@ -1826,18 +1769,6 @@ "group": "Python", "when": "editorFocus && editorLangId == python" }, - { - "command": "python.refactorExtractMethod", - "group": "Refactor", - "title": "Refactor: Extract Method", - "when": "editorHasSelection && editorLangId == python && !notebookEditorFocused" - }, - { - "command": "python.refactorExtractVariable", - "group": "Refactor", - "title": "Refactor: Extract Variable", - "when": "editorHasSelection && editorLangId == python && !notebookEditorFocused" - }, { "command": "python.sortImports", "group": "Refactor", diff --git a/package.nls.de.json b/package.nls.de.json index dd638e16398b..1a1d49c2be9c 100644 --- a/package.nls.de.json +++ b/package.nls.de.json @@ -2,11 +2,8 @@ "python.command.python.sortImports.title": "Sortieren der Importe", "python.command.python.startREPL.title": "Starten des REPL", "python.command.python.createTerminal.title": "Terminal erstellen", - "python.command.python.buildWorkspaceSymbols.title": "Arbeitsplatz-Symbole erstellen", "python.command.python.execInTerminal.title": "Python-Datei im Terminal ausführen", "python.command.python.setInterpreter.title": "Interpreter auswählen", - "python.command.python.refactorExtractVariable.title": "Variable extrahieren", - "python.command.python.refactorExtractMethod.title": "Methode extrahieren", "python.command.python.execSelectionInTerminal.title": "Selektion/Reihe in Python-Terminal ausführen", "python.command.python.execSelectionInDjangoShell.title": "Selektion/Reihe in Django-Shell ausführen", "python.command.python.goToPythonObject.title": "Gehe zu Python-Objekt", diff --git a/package.nls.es.json b/package.nls.es.json index c75644b838a0..62381a675ddb 100644 --- a/package.nls.es.json +++ b/package.nls.es.json @@ -2,11 +2,8 @@ "python.command.python.sortImports.title": "Ordenar importaciones", "python.command.python.startREPL.title": "Nuevo REPL", "python.command.python.createTerminal.title": "Nueva terminal", - "python.command.python.buildWorkspaceSymbols.title": "Compilar símbolos del área de trabajo", "python.command.python.execInTerminal.title": "Ejecutar archivo Python en la terminal", "python.command.python.setInterpreter.title": "Seleccionar intérprete", - "python.command.python.refactorExtractVariable.title": "Extraer variable", - "python.command.python.refactorExtractMethod.title": "Extraer método", "python.command.python.execSelectionInTerminal.title": "Ejecutar línea/selección en la terminal", "python.command.python.execSelectionInDjangoShell.title": "Ejecutar línea/selección en el intérprete de Django", "python.command.python.goToPythonObject.title": "Ir al objeto de Python", diff --git a/package.nls.fr.json b/package.nls.fr.json index f79d28bd4911..605c7a16a74e 100644 --- a/package.nls.fr.json +++ b/package.nls.fr.json @@ -2,11 +2,8 @@ "python.command.python.sortImports.title": "Trier les imports", "python.command.python.startREPL.title": "Démarrer la console interactive", "python.command.python.createTerminal.title": "Créer un terminal", - "python.command.python.buildWorkspaceSymbols.title": "Construire les symboles de l'espace de travail", "python.command.python.execInTerminal.title": "Exécuter le script Python dans un terminal", "python.command.python.setInterpreter.title": "Sélectionner l'interpreteur", - "python.command.python.refactorExtractVariable.title": "Extraire la variable", - "python.command.python.refactorExtractMethod.title": "Extraire la méthode", "python.command.python.execSelectionInTerminal.title": "Exécuter la ligne/sélection dans un terminal Python", "python.command.python.execSelectionInDjangoShell.title": "Exécuter la ligne/sélection dans un shell Django", "python.command.python.goToPythonObject.title": "Se rendre à l'objet Python", diff --git a/package.nls.it.json b/package.nls.it.json index a88f39eb11a4..9ff7f2e83c9f 100644 --- a/package.nls.it.json +++ b/package.nls.it.json @@ -2,11 +2,8 @@ "python.command.python.sortImports.title": "Ordina gli import", "python.command.python.startREPL.title": "Apri nuova REPL", "python.command.python.createTerminal.title": "Apri nuovo terminale", - "python.command.python.buildWorkspaceSymbols.title": "Compila simboli dello spazio di lavoro", "python.command.python.execInTerminal.title": "Esegui file Python nel terminale", "python.command.python.setInterpreter.title": "Seleziona interprete", - "python.command.python.refactorExtractVariable.title": "Estrai variable", - "python.command.python.refactorExtractMethod.title": "Estrai metodo", "python.command.python.execSelectionInTerminal.title": "Esegui selezione/linea nel terminale di Python", "python.command.python.execSelectionInDjangoShell.title": "Esegui selezione/linea nella shell Django", "python.command.python.goToPythonObject.title": "Vai a oggetto Python", diff --git a/package.nls.ja.json b/package.nls.ja.json index e10a8e6ea872..a6c2d1541819 100644 --- a/package.nls.ja.json +++ b/package.nls.ja.json @@ -1,11 +1,8 @@ { "python.command.python.sortImports.title": "import 文を並び替える", "python.command.python.startREPL.title": "REPL を開始", - "python.command.python.buildWorkspaceSymbols.title": "ワークスペースのシンボルをビルド", "python.command.python.execInTerminal.title": "ターミナルで Python ファイルを実行", "python.command.python.setInterpreter.title": "インタープリターを選択", - "python.command.python.refactorExtractVariable.title": "変数を抽出", - "python.command.python.refactorExtractMethod.title": "メソッドを抽出", "python.command.python.execSelectionInTerminal.title": "Python ターミナルで選択範囲/行を実行", "python.command.python.execSelectionInDjangoShell.title": "Django シェルで選択範囲/行を実行", "python.command.python.goToPythonObject.title": "Python オブジェクトに移動", diff --git a/package.nls.json b/package.nls.json index edb7e74d2dce..13984371656f 100644 --- a/package.nls.json +++ b/package.nls.json @@ -2,7 +2,6 @@ "python.command.python.sortImports.title": "Sort Imports", "python.command.python.startREPL.title": "Start REPL", "python.command.python.createTerminal.title": "Create Terminal", - "python.command.python.buildWorkspaceSymbols.title": "Build Workspace Symbols", "python.command.python.execInTerminal.title": "Run Python File in Terminal", "python.command.python.debugInTerminal.title": "Debug Python File in Terminal", "python.command.python.setInterpreter.title": "Select Interpreter", @@ -10,8 +9,6 @@ "python.command.python.switchToDailyChannel.title": "Switch to Insiders Daily Channel", "python.command.python.switchToWeeklyChannel.title": "Switch to Insiders Weekly Channel", "python.command.python.clearWorkspaceInterpreter.title": "Clear Workspace Interpreter Setting", - "python.command.python.refactorExtractVariable.title": "Extract Variable", - "python.command.python.refactorExtractMethod.title": "Extract Method", "python.command.python.viewOutput.title": "Show Output", "python.command.python.viewLanguageServerOutput.title": "Show Language Server Output", "python.command.python.configureTests.title": "Configure Tests", diff --git a/package.nls.ko-kr.json b/package.nls.ko-kr.json index 910d256f31a5..7ecce3df7453 100644 --- a/package.nls.ko-kr.json +++ b/package.nls.ko-kr.json @@ -1,11 +1,8 @@ { "python.command.python.sortImports.title": "Import문 정렬", "python.command.python.startREPL.title": "REPL 시작", - "python.command.python.buildWorkspaceSymbols.title": "작업 영역 기호 빌드", "python.command.python.execInTerminal.title": "터미널에서 Python 파일 실행", "python.command.python.setInterpreter.title": "인터프리터 선택", - "python.command.python.refactorExtractVariable.title": "변수 추출", - "python.command.python.refactorExtractMethod.title": "메서드 추출", "python.command.python.execSelectionInTerminal.title": "Python 터미널에서 선택 영역/줄 실행", "python.command.python.execSelectionInDjangoShell.title": "Django 셸에서 선택 영역/줄 실행", "python.command.python.goToPythonObject.title": " Python 객체로 이동", diff --git a/package.nls.nl.json b/package.nls.nl.json index 6463e22b4644..cf8f4c144ef8 100644 --- a/package.nls.nl.json +++ b/package.nls.nl.json @@ -2,11 +2,8 @@ "python.command.python.sortImports.title": "Import sorteren", "python.command.python.startREPL.title": "REPL starten", "python.command.python.createTerminal.title": "Terminal aanmaken", - "python.command.python.buildWorkspaceSymbols.title": "Werkruimte-symbolen aanmaken", "python.command.python.execInTerminal.title": "Python-bestand in terminal uitvoeren", "python.command.python.setInterpreter.title": "Interpreter selecteren", - "python.command.python.refactorExtractVariable.title": "Variabelen selecteren", - "python.command.python.refactorExtractMethod.title": "Methode selecteren", "python.command.python.execSelectionInTerminal.title": "Selectie/rij in Python-terminal uitvoeren", "python.command.python.execSelectionInDjangoShell.title": "Selectie/rij in Django-shell uitvoeren", "python.command.python.goToPythonObject.title": "Naar Python-object gaan", diff --git a/package.nls.pl.json b/package.nls.pl.json index fefb0d9f8904..29c0a84f1709 100644 --- a/package.nls.pl.json +++ b/package.nls.pl.json @@ -2,11 +2,8 @@ "python.command.python.sortImports.title": "Sortuj importy", "python.command.python.startREPL.title": "Uruchom REPL", "python.command.python.createTerminal.title": "Otwórz Terminal", - "python.command.python.buildWorkspaceSymbols.title": "Zbuduj symbole dla przestrzeni roboczej", "python.command.python.execInTerminal.title": "Uruchom plik pythonowy w terminalu", "python.command.python.setInterpreter.title": "Wybierz wersję interpretera", - "python.command.python.refactorExtractVariable.title": "Wyodrębnij zmienną", - "python.command.python.refactorExtractMethod.title": "Wyodrębnij metodę", "python.command.python.viewOutput.title": "Pokaż wyniki", "python.command.python.configureTests.title": "Konfiguruj testy jednostkowe", "python.command.python.execSelectionInTerminal.title": "Uruchom zaznaczony obszar w interpreterze Pythona", diff --git a/package.nls.pt-br.json b/package.nls.pt-br.json index 01e8cebfb9ce..9418af230bee 100644 --- a/package.nls.pt-br.json +++ b/package.nls.pt-br.json @@ -2,11 +2,8 @@ "python.command.python.sortImports.title": "Ordenar Importações", "python.command.python.startREPL.title": "Iniciar REPL", "python.command.python.createTerminal.title": "Criar Terminal", - "python.command.python.buildWorkspaceSymbols.title": "Construir Símbolos da Área de Trabalho", "python.command.python.execInTerminal.title": "Executar Arquivo no Terminal", "python.command.python.setInterpreter.title": "Selecionar Interpretador", - "python.command.python.refactorExtractVariable.title": "Extrair Variável", - "python.command.python.refactorExtractMethod.title": "Extrair Método", "python.command.python.execSelectionInTerminal.title": "Executar Seleção/Linha no Terminal", "python.command.python.execSelectionInDjangoShell.title": "Executar Seleção/Linha no Django Shell", "python.command.python.goToPythonObject.title": "Ir para Objeto Python", diff --git a/package.nls.ru.json b/package.nls.ru.json index abb8a67f1d86..df09b32ce72b 100644 --- a/package.nls.ru.json +++ b/package.nls.ru.json @@ -1,11 +1,8 @@ { "python.command.python.sortImports.title": "Отсортировать Imports", "python.command.python.startREPL.title": "Открыть REPL", - "python.command.python.buildWorkspaceSymbols.title": "Собрать символы рабочего пространства", "python.command.python.execInTerminal.title": "Выполнить файл в консоли", "python.command.python.setInterpreter.title": "Выбрать интерпретатор", - "python.command.python.refactorExtractVariable.title": "Извлечь в переменную", - "python.command.python.refactorExtractMethod.title": "Извлечь в метод", "python.command.python.execSelectionInTerminal.title": "Выполнить выбранный текст или текущую строку в консоли", "python.command.python.execSelectionInDjangoShell.title": "Выполнить выбранный текст или текущую строку в оболочке Django", "python.command.python.goToPythonObject.title": "Перейти к объекту Python", diff --git a/package.nls.tr.json b/package.nls.tr.json index e578fd7c9416..1982ee70012e 100644 --- a/package.nls.tr.json +++ b/package.nls.tr.json @@ -2,11 +2,8 @@ "python.command.python.sortImports.title": "Import İfadelerini Sırala", "python.command.python.startREPL.title": "REPL Başlat", "python.command.python.createTerminal.title": "Terminal Oluştur", - "python.command.python.buildWorkspaceSymbols.title": "Çalışma Alanındaki Sembolleri Derle", "python.command.python.execInTerminal.title": "Terminalde Çalıştır", "python.command.python.setInterpreter.title": "Bir Interpreter Seçin", - "python.command.python.refactorExtractVariable.title": "Değişken Çıkar", - "python.command.python.refactorExtractMethod.title": "Metot Çıkar", "python.command.python.execSelectionInTerminal.title": "Seçimi/Satırı Terminalde Çalıştır", "python.command.python.execSelectionInDjangoShell.title": "Seçimi/Satırı Django Shell'inde Çalıştır", "python.command.python.goToPythonObject.title": "Python Nesnesine Git", diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json index 1d2864a2469e..01635caf3719 100644 --- a/package.nls.zh-cn.json +++ b/package.nls.zh-cn.json @@ -2,15 +2,12 @@ "python.command.python.sortImports.title": "排序 import 语句", "python.command.python.startREPL.title": "启动 REPL", "python.command.python.createTerminal.title": "创建终端", - "python.command.python.buildWorkspaceSymbols.title": "构建工作区符号", "python.command.python.execInTerminal.title": "在终端中运行 Python 文件", "python.command.python.setInterpreter.title": "选择解释器", "python.command.python.switchOffInsidersChannel.title": "切换到默认版本", "python.command.python.switchToDailyChannel.title": "切换到每日预览版本", "python.command.python.switchToWeeklyChannel.title": "切换到每周预览版本", - "python.command.python.clearWorkspaceInterpreter.title": "清除工作区选择的解释器设置", - "python.command.python.refactorExtractVariable.title": "提取变量", - "python.command.python.refactorExtractMethod.title": "提取方法", + "python.command.python.clearWorkspaceInterpreter.title": "清除工作区解释器设置", "python.command.python.viewOutput.title": "显示输出", "python.command.python.viewLanguageServerOutput.title": "显示语言服务器输出", "python.command.python.configureTests.title": "配置单元测试", diff --git a/package.nls.zh-tw.json b/package.nls.zh-tw.json index 03529ff4a997..6f5ca9c2ce1b 100644 --- a/package.nls.zh-tw.json +++ b/package.nls.zh-tw.json @@ -2,11 +2,8 @@ "python.command.python.sortImports.title": "排序 Import 語句", "python.command.python.startREPL.title": "啟動 REPL", "python.command.python.createTerminal.title": "建立終端機", - "python.command.python.buildWorkspaceSymbols.title": "建構工作區符號", "python.command.python.execInTerminal.title": "在終端機中執行 Python 檔案", "python.command.python.setInterpreter.title": "選擇直譯器", - "python.command.python.refactorExtractVariable.title": "提取變數", - "python.command.python.refactorExtractMethod.title": "提取方法", "python.command.python.execSelectionInTerminal.title": "在 Python 終端機中執行選定內容/行", "python.command.python.execSelectionInDjangoShell.title": "在 Django Shell 中執行選定內容/行", "python.command.python.goToPythonObject.title": "跳至 Python 物件", diff --git a/pythonFiles/.vscode/.ropeproject/config.py b/pythonFiles/.vscode/.ropeproject/config.py new file mode 100644 index 000000000000..dee2d1ae9a6b --- /dev/null +++ b/pythonFiles/.vscode/.ropeproject/config.py @@ -0,0 +1,114 @@ +# The default ``config.py`` +# flake8: noqa + + +def set_prefs(prefs): + """This function is called before opening the project""" + + # Specify which files and folders to ignore in the project. + # Changes to ignored resources are not added to the history and + # VCSs. Also they are not returned in `Project.get_files()`. + # Note that ``?`` and ``*`` match all characters but slashes. + # '*.pyc': matches 'test.pyc' and 'pkg/test.pyc' + # 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc' + # '.svn': matches 'pkg/.svn' and all of its children + # 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o' + # 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o' + prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject', + '.hg', '.svn', '_svn', '.git', '.tox'] + + # Specifies which files should be considered python files. It is + # useful when you have scripts inside your project. Only files + # ending with ``.py`` are considered to be python files by + # default. + # prefs['python_files'] = ['*.py'] + + # Custom source folders: By default rope searches the project + # for finding source folders (folders that should be searched + # for finding modules). You can add paths to that list. Note + # that rope guesses project source folders correctly most of the + # time; use this if you have any problems. + # The folders should be relative to project root and use '/' for + # separating folders regardless of the platform rope is running on. + # 'src/my_source_folder' for instance. + # prefs.add('source_folders', 'src') + + # You can extend python path for looking up modules + # prefs.add('python_path', '~/python/') + + # Should rope save object information or not. + prefs['save_objectdb'] = True + prefs['compress_objectdb'] = False + + # If `True`, rope analyzes each module when it is being saved. + prefs['automatic_soa'] = True + # The depth of calls to follow in static object analysis + prefs['soa_followed_calls'] = 0 + + # If `False` when running modules or unit tests "dynamic object + # analysis" is turned off. This makes them much faster. + prefs['perform_doa'] = True + + # Rope can check the validity of its object DB when running. + prefs['validate_objectdb'] = True + + # How many undos to hold? + prefs['max_history_items'] = 32 + + # Shows whether to save history across sessions. + prefs['save_history'] = True + prefs['compress_history'] = False + + # Set the number spaces used for indenting. According to + # :PEP:`8`, it is best to use 4 spaces. Since most of rope's + # unit-tests use 4 spaces it is more reliable, too. + prefs['indent_size'] = 4 + + # Builtin and c-extension modules that are allowed to be imported + # and inspected by rope. + prefs['extension_modules'] = [] + + # Add all standard c-extensions to extension_modules list. + prefs['import_dynload_stdmods'] = True + + # If `True` modules with syntax errors are considered to be empty. + # The default value is `False`; When `False` syntax errors raise + # `rope.base.exceptions.ModuleSyntaxError` exception. + prefs['ignore_syntax_errors'] = False + + # If `True`, rope ignores unresolvable imports. Otherwise, they + # appear in the importing namespace. + prefs['ignore_bad_imports'] = False + + # If `True`, rope will insert new module imports as + # `from import ` by default. + prefs['prefer_module_from_imports'] = False + + # If `True`, rope will transform a comma list of imports into + # multiple separate import statements when organizing + # imports. + prefs['split_imports'] = False + + # If `True`, rope will remove all top-level import statements and + # reinsert them at the top of the module when making changes. + prefs['pull_imports_to_top'] = True + + # If `True`, rope will sort imports alphabetically by module name instead + # of alphabetically by import statement, with from imports after normal + # imports. + prefs['sort_imports_alphabetically'] = False + + # Location of implementation of + # rope.base.oi.type_hinting.interfaces.ITypeHintingFactory In general + # case, you don't have to change this value, unless you're an rope expert. + # Change this value to inject you own implementations of interfaces + # listed in module rope.base.oi.type_hinting.providers.interfaces + # For example, you can add you own providers for Django Models, or disable + # the search type-hinting in a class hierarchy, etc. + prefs['type_hinting_factory'] = ( + 'rope.base.oi.type_hinting.factory.default_type_hinting_factory') + + +def project_opened(project): + """This function is called after opening the project""" + # Do whatever you like here! diff --git a/pythonFiles/.vscode/.ropeproject/objectdb b/pythonFiles/.vscode/.ropeproject/objectdb new file mode 100644 index 000000000000..0a47446c0ad2 Binary files /dev/null and b/pythonFiles/.vscode/.ropeproject/objectdb differ diff --git a/pythonFiles/refactor.py b/pythonFiles/refactor.py deleted file mode 100644 index f9d3b29e3b19..000000000000 --- a/pythonFiles/refactor.py +++ /dev/null @@ -1,395 +0,0 @@ -# Arguments are: -# 1. Working directory. -# 2. Rope folder - -import difflib -import io -import json -import os -import sys -import traceback - -try: - import rope - from rope.base import libutils - from rope.refactor.rename import Rename - from rope.refactor.extract import ExtractMethod, ExtractVariable - import rope.base.project - import rope.base.taskhandle -except: - jsonMessage = { - "error": True, - "message": "Rope not installed", - "traceback": "", - "type": "ModuleNotFoundError", - } - sys.stderr.write(json.dumps(jsonMessage)) - sys.stderr.flush() - -WORKSPACE_ROOT = sys.argv[1] -ROPE_PROJECT_FOLDER = ".vscode/.ropeproject" - - -class RefactorProgress: - """ - Refactor progress information - """ - - def __init__(self, name="Task Name", message=None, percent=0): - self.name = name - self.message = message - self.percent = percent - - -class ChangeType: - """ - Change Type Enum - """ - - EDIT = 0 - NEW = 1 - DELETE = 2 - - -class Change: - """ """ - - EDIT = 0 - NEW = 1 - DELETE = 2 - - def __init__(self, filePath, fileMode=ChangeType.EDIT, diff=""): - self.filePath = filePath - self.diff = diff - self.fileMode = fileMode - - -def get_diff(changeset): - """This is a copy of the code form the ChangeSet.get_description method found in Rope.""" - new = changeset.new_contents - old = changeset.old_contents - if old is None: - if changeset.resource.exists(): - old = changeset.resource.read() - else: - old = "" - - # Ensure code has a trailing empty lines, before generating a diff. - # https://github.com/Microsoft/vscode-python/issues/695. - old_lines = old.splitlines(True) - if not old_lines[-1].endswith("\n"): - old_lines[-1] = old_lines[-1] + os.linesep - new = new + os.linesep - - result = difflib.unified_diff( - old_lines, - new.splitlines(True), - "a/" + changeset.resource.path, - "b/" + changeset.resource.path, - ) - return "".join(list(result)) - - -class BaseRefactoring(object): - """ - Base class for refactorings - """ - - def __init__(self, project, resource, name="Refactor", progressCallback=None): - self._progressCallback = progressCallback - self._handle = rope.base.taskhandle.TaskHandle(name) - self._handle.add_observer(self._update_progress) - self.project = project - self.resource = resource - self.changes = [] - - def _update_progress(self): - jobset = self._handle.current_jobset() - if jobset and not self._progressCallback is None: - progress = RefactorProgress() - # getting current job set name - if jobset.get_name() is not None: - progress.name = jobset.get_name() - # getting active job name - if jobset.get_active_job_name() is not None: - progress.message = jobset.get_active_job_name() - # adding done percent - percent = jobset.get_percent_done() - if percent is not None: - progress.percent = percent - if not self._progressCallback is None: - self._progressCallback(progress) - - def stop(self): - self._handle.stop() - - def refactor(self): - try: - self.onRefactor() - except rope.base.exceptions.InterruptedTaskError: - # we can ignore this exception, as user has cancelled refactoring - pass - - def onRefactor(self): - """ - To be implemented by each base class - """ - pass - - -class RenameRefactor(BaseRefactoring): - def __init__( - self, - project, - resource, - name="Rename", - progressCallback=None, - startOffset=None, - newName="new_Name", - ): - BaseRefactoring.__init__(self, project, resource, name, progressCallback) - self._newName = newName - self.startOffset = startOffset - - def onRefactor(self): - renamed = Rename(self.project, self.resource, self.startOffset) - changes = renamed.get_changes(self._newName, task_handle=self._handle) - for item in changes.changes: - if isinstance(item, rope.base.change.ChangeContents): - self.changes.append( - Change(item.resource.real_path, ChangeType.EDIT, get_diff(item)) - ) - else: - raise Exception("Unknown Change") - - -class ExtractVariableRefactor(BaseRefactoring): - def __init__( - self, - project, - resource, - name="Extract Variable", - progressCallback=None, - startOffset=None, - endOffset=None, - newName="new_Name", - similar=False, - global_=False, - ): - BaseRefactoring.__init__(self, project, resource, name, progressCallback) - self._newName = newName - self._startOffset = startOffset - self._endOffset = endOffset - self._similar = similar - self._global = global_ - - def onRefactor(self): - renamed = ExtractVariable( - self.project, self.resource, self._startOffset, self._endOffset - ) - changes = renamed.get_changes(self._newName, self._similar, self._global) - for item in changes.changes: - if isinstance(item, rope.base.change.ChangeContents): - self.changes.append( - Change(item.resource.real_path, ChangeType.EDIT, get_diff(item)) - ) - else: - raise Exception("Unknown Change") - - -class ExtractMethodRefactor(ExtractVariableRefactor): - def __init__( - self, - project, - resource, - name="Extract Method", - progressCallback=None, - startOffset=None, - endOffset=None, - newName="new_Name", - similar=False, - global_=False, - ): - ExtractVariableRefactor.__init__( - self, - project, - resource, - name, - progressCallback, - startOffset=startOffset, - endOffset=endOffset, - newName=newName, - similar=similar, - global_=global_, - ) - - def onRefactor(self): - renamed = ExtractMethod( - self.project, self.resource, self._startOffset, self._endOffset - ) - changes = renamed.get_changes(self._newName, self._similar, self._global) - for item in changes.changes: - if isinstance(item, rope.base.change.ChangeContents): - self.changes.append( - Change(item.resource.real_path, ChangeType.EDIT, get_diff(item)) - ) - else: - raise Exception("Unknown Change") - - -class RopeRefactoring(object): - def __init__(self): - self.default_sys_path = sys.path - self._input = io.open(sys.stdin.fileno(), encoding="utf-8") - - def _rename(self, filePath, start, newName, indent_size): - """ - Renames a variable - """ - project = rope.base.project.Project( - WORKSPACE_ROOT, - ropefolder=ROPE_PROJECT_FOLDER, - save_history=False, - indent_size=indent_size, - ) - resourceToRefactor = libutils.path_to_resource(project, filePath) - refactor = RenameRefactor( - project, resourceToRefactor, startOffset=start, newName=newName - ) - refactor.refactor() - changes = refactor.changes - project.close() - valueToReturn = [] - for change in changes: - valueToReturn.append({"diff": change.diff}) - return valueToReturn - - def _extractVariable(self, filePath, start, end, newName, indent_size): - """ - Extracts a variable - """ - project = rope.base.project.Project( - WORKSPACE_ROOT, - ropefolder=ROPE_PROJECT_FOLDER, - save_history=False, - indent_size=indent_size, - ) - resourceToRefactor = libutils.path_to_resource(project, filePath) - refactor = ExtractVariableRefactor( - project, - resourceToRefactor, - startOffset=start, - endOffset=end, - newName=newName, - similar=True, - ) - refactor.refactor() - changes = refactor.changes - project.close() - valueToReturn = [] - for change in changes: - valueToReturn.append({"diff": change.diff}) - return valueToReturn - - def _extractMethod(self, filePath, start, end, newName, indent_size): - """ - Extracts a method - """ - project = rope.base.project.Project( - WORKSPACE_ROOT, - ropefolder=ROPE_PROJECT_FOLDER, - save_history=False, - indent_size=indent_size, - ) - resourceToRefactor = libutils.path_to_resource(project, filePath) - refactor = ExtractMethodRefactor( - project, - resourceToRefactor, - startOffset=start, - endOffset=end, - newName=newName, - similar=True, - ) - refactor.refactor() - changes = refactor.changes - project.close() - valueToReturn = [] - for change in changes: - valueToReturn.append({"diff": change.diff}) - return valueToReturn - - def _serialize(self, identifier, results): - """ - Serializes the refactor results - """ - return json.dumps({"id": identifier, "results": results}) - - def _deserialize(self, request): - """Deserialize request from VSCode. - - Args: - request: String with raw request from VSCode. - - Returns: - Python dictionary with request data. - """ - return json.loads(request) - - def _process_request(self, request): - """Accept serialized request from VSCode and write response.""" - request = self._deserialize(request) - lookup = request.get("lookup", "") - - if lookup == "": - pass - elif lookup == "rename": - changes = self._rename( - request["file"], - int(request["start"]), - request["name"], - int(request["indent_size"]), - ) - return self._write_response(self._serialize(request["id"], changes)) - elif lookup == "extract_variable": - changes = self._extractVariable( - request["file"], - int(request["start"]), - int(request["end"]), - request["name"], - int(request["indent_size"]), - ) - return self._write_response(self._serialize(request["id"], changes)) - elif lookup == "extract_method": - changes = self._extractMethod( - request["file"], - int(request["start"]), - int(request["end"]), - request["name"], - int(request["indent_size"]), - ) - return self._write_response(self._serialize(request["id"], changes)) - - def _write_response(self, response): - sys.stdout.write(response + "\n") - sys.stdout.flush() - - def watch(self): - self._write_response("STARTED") - while True: - try: - self._process_request(self._input.readline()) - except: - exc_type, exc_value, exc_tb = sys.exc_info() - tb_info = traceback.extract_tb(exc_tb) - jsonMessage = { - "error": True, - "message": str(exc_value), - "traceback": str(tb_info), - "type": str(exc_type), - } - sys.stderr.write(json.dumps(jsonMessage)) - sys.stderr.flush() - - -if __name__ == "__main__": - RopeRefactoring().watch() diff --git a/pythonFiles/symbolProvider.py b/pythonFiles/symbolProvider.py deleted file mode 100644 index 033ce4b99900..000000000000 --- a/pythonFiles/symbolProvider.py +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -import ast -import json -import sys - - -class Visitor(ast.NodeVisitor): - def __init__(self): - self.symbols = {"classes": [], "methods": [], "functions": []} - - def visit_Module(self, node): - self.visitChildren(node) - - def visitChildren(self, node, namespace=""): - for child in node.body: - if isinstance(child, ast.FunctionDef): - self.visitDef(child, namespace) - if isinstance(child, ast.ClassDef): - self.visitClassDef(child, namespace) - try: - if isinstance(child, ast.AsyncFunctionDef): - self.visitDef(child, namespace) - except Exception: - pass - - def visitDef(self, node, namespace=""): - end_position = self.getEndPosition(node) - symbol = "functions" if namespace == "" else "methods" - self.symbols[symbol].append(self.getDataObject(node, namespace)) - - def visitClassDef(self, node, namespace=""): - end_position = self.getEndPosition(node) - self.symbols["classes"].append(self.getDataObject(node, namespace)) - - if len(namespace) > 0: - namespace = "{0}::{1}".format(namespace, node.name) - else: - namespace = node.name - self.visitChildren(node, namespace) - - def getDataObject(self, node, namespace=""): - end_position = self.getEndPosition(node) - return { - "namespace": namespace, - "name": node.name, - "range": { - "start": {"line": node.lineno - 1, "character": node.col_offset}, - "end": {"line": end_position[0], "character": end_position[1]}, - }, - } - - def getEndPosition(self, node): - if not hasattr(node, "body") or len(node.body) == 0: - return (node.lineno - 1, node.col_offset) - return self.getEndPosition(node.body[-1]) - - -def provide_symbols(source): - """Provides a list of all symbols in provided code. - - The list comprises of 3-item tuples that contain the starting line number, - ending line number and whether the statement is a single line. - - """ - tree = ast.parse(source) - visitor = Visitor() - visitor.visit(tree) - sys.stdout.write(json.dumps(visitor.symbols)) - sys.stdout.flush() - - -if __name__ == "__main__": - if len(sys.argv) == 3: - contents = sys.argv[2] - else: - with open(sys.argv[1], "r") as source: - contents = source.read() - - try: - default_encoding = sys.getdefaultencoding() - encoded_contents = contents.encode(default_encoding, "surrogateescape") - contents = encoded_contents.decode(default_encoding, "replace") - except (UnicodeError, LookupError): - pass - if isinstance(contents, bytes): - contents = contents.decode("utf8") - provide_symbols(contents) diff --git a/resources/ctagOptions b/resources/ctagOptions deleted file mode 100644 index 3b656ac370fe..000000000000 --- a/resources/ctagOptions +++ /dev/null @@ -1,23 +0,0 @@ ---recurse=yes ---tag-relative=yes ---exclude=.git ---exclude=log ---exclude=tmp ---exclude=doc ---exclude=deps ---exclude=node_modules ---exclude=.vscode ---exclude=public/assets ---exclude=*.git* ---exclude=*.pyc ---exclude=*.pyo ---exclude=.DS_Store ---exclude=**/*.jar ---exclude=**/*.class ---exclude=**/.idea/ ---exclude=build ---exclude=Builds ---exclude=doc ---fields=Knz ---extra=+f ---append=no \ No newline at end of file diff --git a/resources/report_issue_user_settings.json b/resources/report_issue_user_settings.json index 3237576bc753..c216fe64e3dd 100644 --- a/resources/report_issue_user_settings.json +++ b/resources/report_issue_user_settings.json @@ -99,14 +99,6 @@ "showAdvancedMembers": true, "typeshedPaths": "placeholder" }, - "workspaceSymbols": { - "ctagsPath": "placeholder", - "enabled": true, - "exclusionPatterns": true, - "rebuildOnFileSave": true, - "rebuildOnStart": true, - "tagFilePath": "placeholder" - }, "testing": { "cwd": "placeholder", "debugPort": true, diff --git a/src/client/common/application/commands.ts b/src/client/common/application/commands.ts index 995fcbabcecd..dde7b8257d74 100644 --- a/src/client/common/application/commands.ts +++ b/src/client/common/application/commands.ts @@ -85,7 +85,6 @@ export interface ICommandNameArgumentTypeMapping extends ICommandNameWithoutArgu ['extension.open']: [string]; ['workbench.action.openIssueReporter']: [{ extensionId: string; issueBody: string }]; [Commands.GetSelectedInterpreterPath]: [{ workspaceFolder: string } | string[]]; - [Commands.Build_Workspace_Symbols]: [boolean, CancellationToken]; [Commands.Sort_Imports]: [undefined, Uri]; [Commands.Exec_In_Terminal]: [undefined, Uri]; [Commands.Exec_In_Terminal_Icon]: [undefined, Uri]; diff --git a/src/client/common/configSettings.ts b/src/client/common/configSettings.ts index c2948bf33196..517beef02fb4 100644 --- a/src/client/common/configSettings.ts +++ b/src/client/common/configSettings.ts @@ -41,7 +41,6 @@ import { ISortImportSettings, ITensorBoardSettings, ITerminalSettings, - IWorkspaceSymbolSettings, LoggingLevelSettingType, Resource, } from './types'; @@ -122,8 +121,6 @@ export class PythonSettings implements IPythonSettings { public sortImports!: ISortImportSettings; - public workspaceSymbols!: IWorkspaceSymbolSettings; - public disableInstallationChecks = false; public globalModuleInstallation = false; @@ -467,33 +464,6 @@ export class PythonSettings implements IPythonSettings { typeshedPaths: [], }; - const workspaceSymbolsSettings = systemVariables.resolveAny( - pythonSettings.get('workspaceSymbols'), - )!; - if (this.workspaceSymbols) { - Object.assign( - this.workspaceSymbols, - workspaceSymbolsSettings, - ); - } else { - this.workspaceSymbols = workspaceSymbolsSettings; - } - // Support for travis. - this.workspaceSymbols = this.workspaceSymbols - ? this.workspaceSymbols - : { - ctagsPath: 'ctags', - enabled: true, - exclusionPatterns: [], - rebuildOnFileSave: true, - rebuildOnStart: true, - tagFilePath: workspaceRoot ? path.join(workspaceRoot, 'tags') : '', - }; - this.workspaceSymbols.tagFilePath = getAbsolutePath( - systemVariables.resolveAny(this.workspaceSymbols.tagFilePath), - workspaceRoot, - ); - const testSettings = systemVariables.resolveAny(pythonSettings.get('testing'))!; if (this.testing) { Object.assign(this.testing, testSettings); diff --git a/src/client/common/constants.ts b/src/client/common/constants.ts index 266d7344c962..9b1f4d4163ec 100644 --- a/src/client/common/constants.ts +++ b/src/client/common/constants.ts @@ -42,9 +42,6 @@ export namespace Commands { export const Test_Stop_Refreshing = 'python.stopRefreshingTests'; export const Sort_Imports = 'python.sortImports'; export const ViewOutput = 'python.viewOutput'; - export const Refactor_Extract_Variable = 'python.refactorExtractVariable'; - export const Refactor_Extract_Method = 'python.refactorExtractMethod'; - export const Build_Workspace_Symbols = 'python.buildWorkspaceSymbols'; export const Start_REPL = 'python.startREPL'; export const Create_Terminal = 'python.createTerminal'; export const Set_Linter = 'python.setLinter'; diff --git a/src/client/common/installer/moduleInstaller.ts b/src/client/common/installer/moduleInstaller.ts index 13e5ba12c378..62c1717f8be3 100644 --- a/src/client/common/installer/moduleInstaller.ts +++ b/src/client/common/installer/moduleInstaller.ts @@ -179,8 +179,6 @@ export function translateProductToModule(product: Product): string { return 'flake8'; case Product.unittest: return 'unittest'; - case Product.rope: - return 'rope'; case Product.bandit: return 'bandit'; case Product.jupyter: diff --git a/src/client/common/installer/productInstaller.ts b/src/client/common/installer/productInstaller.ts index add920fbb176..52bae4d7efd6 100644 --- a/src/client/common/installer/productInstaller.ts +++ b/src/client/common/installer/productInstaller.ts @@ -1,7 +1,6 @@ /* eslint-disable max-classes-per-file */ import { inject, injectable, named } from 'inversify'; -import * as os from 'os'; import * as semver from 'semver'; import { CancellationToken, OutputChannel, Uri } from 'vscode'; import '../extensions'; @@ -14,9 +13,7 @@ import { EventName } from '../../telemetry/constants'; import { IApplicationShell, ICommandManager, IWorkspaceService } from '../application/types'; import { Commands, STANDARD_OUTPUT_CHANNEL } from '../constants'; import { traceError, traceInfo } from '../logger'; -import { IPlatformService } from '../platform/types'; import { IProcessServiceFactory, IPythonExecutionFactory } from '../process/types'; -import { ITerminalServiceFactory } from '../terminal/types'; import { IConfigurationService, IInstaller, @@ -42,9 +39,6 @@ import { export { Product } from '../types'; -export const CTagsInstallationScript = - os.platform() === 'darwin' ? 'brew install ctags' : 'sudo apt-get install exuberant-ctags'; - // Products which may not be available to install from certain package registries, keyed by product name // Installer implementations can check this to determine a suitable installation channel for a product // This is temporary and can be removed when https://github.com/microsoft/vscode-jupyter/issues/5034 is unblocked @@ -225,46 +219,6 @@ abstract class BaseInstaller { } } -export class CTagsInstaller extends BaseInstaller { - public async install(_product: Product, resource?: Uri): Promise { - if (this.serviceContainer.get(IPlatformService).isWindows) { - this.outputChannel.appendLine('Install Universal Ctags Win32 to enable support for Workspace Symbols'); - this.outputChannel.appendLine('Download the CTags binary from the Universal CTags site.'); - this.outputChannel.appendLine( - 'Option 1: Extract ctags.exe from the downloaded zip to any folder within your PATH so that Visual Studio Code can run it.', - ); - this.outputChannel.appendLine( - 'Option 2: Extract to any folder and add the path to this folder to the command setting.', - ); - this.outputChannel.appendLine( - 'Option 3: Extract to any folder and define that path in the python.workspaceSymbols.ctagsPath setting of your user settings file (settings.json).', - ); - this.outputChannel.show(); - } else { - const terminalService = this.serviceContainer - .get(ITerminalServiceFactory) - .getTerminalService({ resource }); - terminalService - .sendCommand(CTagsInstallationScript, []) - .catch((ex) => traceError(`Failed to install ctags. Script sent '${CTagsInstallationScript}', ${ex}`)); - } - return InstallerResponse.Ignore; - } - - protected async promptToInstallImplementation( - product: Product, - resource?: Uri, - _cancel?: CancellationToken, - ): Promise { - const item = await this.appShell.showErrorMessage( - 'Install CTags to enable Python workspace symbols?', - 'Yes', - 'No', - ); - return item === 'Yes' ? this.install(product, resource) : InstallerResponse.Ignore; - } -} - export class FormatterInstaller extends BaseInstaller { protected async promptToInstallImplementation( product: Product, @@ -427,23 +381,6 @@ export class TestFrameworkInstaller extends BaseInstaller { } } -class RefactoringLibraryInstaller extends BaseInstaller { - protected async promptToInstallImplementation( - product: Product, - resource?: Uri, - cancel?: CancellationToken, - _flags?: ModuleInstallFlags, - ): Promise { - const productName = ProductNames.get(product)!; - const item = await this.appShell.showErrorMessage( - `Refactoring library ${productName} is not installed. Install?`, - 'Yes', - 'No', - ); - return item === 'Yes' ? this.install(product, resource, cancel) : InstallerResponse.Ignore; - } -} - export class DataScienceInstaller extends BaseInstaller { // Override base installer to support a more DS-friendly streamlined installation. public async install( @@ -614,12 +551,8 @@ export class ProductInstaller implements IInstaller { return new FormatterInstaller(this.serviceContainer, this.outputChannel); case ProductType.Linter: return new LinterInstaller(this.serviceContainer, this.outputChannel); - case ProductType.WorkspaceSymbols: - return new CTagsInstaller(this.serviceContainer, this.outputChannel); case ProductType.TestFramework: return new TestFrameworkInstaller(this.serviceContainer, this.outputChannel); - case ProductType.RefactoringLibrary: - return new RefactoringLibraryInstaller(this.serviceContainer, this.outputChannel); case ProductType.DataScience: return new DataScienceInstaller(this.serviceContainer, this.outputChannel); default: diff --git a/src/client/common/installer/productNames.ts b/src/client/common/installer/productNames.ts index 89551e4d844e..b79b3a84d2c6 100644 --- a/src/client/common/installer/productNames.ts +++ b/src/client/common/installer/productNames.ts @@ -16,7 +16,6 @@ ProductNames.set(Product.pydocstyle, 'pydocstyle'); ProductNames.set(Product.pylint, 'pylint'); ProductNames.set(Product.pytest, 'pytest'); ProductNames.set(Product.yapf, 'yapf'); -ProductNames.set(Product.rope, 'rope'); ProductNames.set(Product.tensorboard, 'tensorboard'); ProductNames.set(Product.torchProfilerInstallName, 'torch-tb-profiler'); ProductNames.set(Product.torchProfilerImportName, 'torch_tb_profiler'); diff --git a/src/client/common/installer/productPath.ts b/src/client/common/installer/productPath.ts index 2ac48ed35d62..5c36a6bbd3bd 100644 --- a/src/client/common/installer/productPath.ts +++ b/src/client/common/installer/productPath.ts @@ -37,17 +37,6 @@ export abstract class BaseProductPathsService implements IProductPathService { } } -@injectable() -export class CTagsProductPathService extends BaseProductPathsService { - constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) { - super(serviceContainer); - } - public getExecutableNameFromSettings(_: Product, resource?: Uri): string { - const settings = this.configService.getSettings(resource); - return settings.workspaceSymbols.ctagsPath; - } -} - @injectable() export class FormatterProductPathService extends BaseProductPathsService { constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) { @@ -89,16 +78,6 @@ export class TestFrameworkProductPathService extends BaseProductPathsService { } } -@injectable() -export class RefactoringLibraryProductPathService extends BaseProductPathsService { - constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) { - super(serviceContainer); - } - public getExecutableNameFromSettings(product: Product, _?: Uri): string { - return this.productInstaller.translateProductToModuleName(product); - } -} - @injectable() export class DataScienceProductPathService extends BaseProductPathsService { constructor(@inject(IServiceContainer) serviceContainer: IServiceContainer) { diff --git a/src/client/common/installer/productService.ts b/src/client/common/installer/productService.ts index 569a302e06df..6b8dfe5d35c2 100644 --- a/src/client/common/installer/productService.ts +++ b/src/client/common/installer/productService.ts @@ -20,13 +20,11 @@ export class ProductService implements IProductService { this.ProductTypes.set(Product.pydocstyle, ProductType.Linter); this.ProductTypes.set(Product.pylama, ProductType.Linter); this.ProductTypes.set(Product.pylint, ProductType.Linter); - this.ProductTypes.set(Product.ctags, ProductType.WorkspaceSymbols); this.ProductTypes.set(Product.pytest, ProductType.TestFramework); this.ProductTypes.set(Product.unittest, ProductType.TestFramework); this.ProductTypes.set(Product.autopep8, ProductType.Formatter); this.ProductTypes.set(Product.black, ProductType.Formatter); this.ProductTypes.set(Product.yapf, ProductType.Formatter); - this.ProductTypes.set(Product.rope, ProductType.RefactoringLibrary); this.ProductTypes.set(Product.jupyter, ProductType.DataScience); this.ProductTypes.set(Product.notebook, ProductType.DataScience); this.ProductTypes.set(Product.ipykernel, ProductType.DataScience); diff --git a/src/client/common/installer/serviceRegistry.ts b/src/client/common/installer/serviceRegistry.ts index 539d448698e2..578ff0d8db9f 100644 --- a/src/client/common/installer/serviceRegistry.ts +++ b/src/client/common/installer/serviceRegistry.ts @@ -11,11 +11,9 @@ import { PipEnvInstaller } from './pipEnvInstaller'; import { PipInstaller } from './pipInstaller'; import { PoetryInstaller } from './poetryInstaller'; import { - CTagsProductPathService, DataScienceProductPathService, FormatterProductPathService, LinterProductPathService, - RefactoringLibraryProductPathService, TestFrameworkProductPathService, } from './productPath'; import { ProductService } from './productService'; @@ -47,11 +45,6 @@ export function registerTypes(serviceManager: IServiceManager) { ); serviceManager.addSingleton(IProductService, ProductService); - serviceManager.addSingleton( - IProductPathService, - CTagsProductPathService, - ProductType.WorkspaceSymbols, - ); serviceManager.addSingleton( IProductPathService, FormatterProductPathService, @@ -63,11 +56,6 @@ export function registerTypes(serviceManager: IServiceManager) { TestFrameworkProductPathService, ProductType.TestFramework, ); - serviceManager.addSingleton( - IProductPathService, - RefactoringLibraryProductPathService, - ProductType.RefactoringLibrary, - ); serviceManager.addSingleton( IProductPathService, DataScienceProductPathService, diff --git a/src/client/common/process/internal/scripts/index.ts b/src/client/common/process/internal/scripts/index.ts index 27d366ec29fa..b9fd904763a8 100644 --- a/src/client/common/process/internal/scripts/index.ts +++ b/src/client/common/process/internal/scripts/index.ts @@ -3,7 +3,6 @@ import * as path from 'path'; import { _SCRIPTS_DIR } from './constants'; -import { SymbolProviderSymbols } from './types'; const SCRIPTS_DIR = _SCRIPTS_DIR; @@ -76,25 +75,6 @@ export function sortImports(filename: string, sortArgs?: string[]): [string[], ( return [args, parse]; } -// refactor.py - -export function refactor(root: string): [string[], (out: string) => Record[]] { - const script = path.join(SCRIPTS_DIR, 'refactor.py'); - const args = [script, root]; - - // TODO: Make the return type more specific, like we did - // with completion(). - function parse(out: string): Record[] { - // TODO: Also handle "STARTED"? - return out - .split(/\r?\n/g) - .filter((line) => line.length > 0) - .map((resp) => JSON.parse(resp)); - } - - return [args, parse]; -} - // normalizeSelection.py export function normalizeSelection(): [string[], (out: string) => string] { @@ -109,26 +89,6 @@ export function normalizeSelection(): [string[], (out: string) => string] { return [args, parse]; } -// symbolProvider.py - -export function symbolProvider( - filename: string, - // If "text" is provided then it gets passed to the script as-is. - text?: string, -): [string[], (out: string) => SymbolProviderSymbols] { - const script = path.join(SCRIPTS_DIR, 'symbolProvider.py'); - const args = [script, filename]; - if (text) { - args.push(text); - } - - function parse(out: string): SymbolProviderSymbols { - return JSON.parse(out); - } - - return [args, parse]; -} - // printEnvVariables.py export function printEnvVariables(): [string[], (out: string) => NodeJS.ProcessEnv] { diff --git a/src/client/common/process/internal/scripts/types.ts b/src/client/common/process/internal/scripts/types.ts deleted file mode 100644 index e4f32897d878..000000000000 --- a/src/client/common/process/internal/scripts/types.ts +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// Symbol providers - -type Position = { - line: number; - character: number; -}; -type RawSymbol = { - // If no namespace then ''. - namespace: string; - name: string; - range: { - start: Position; - end: Position; - }; -}; -export type SymbolProviderSymbols = { - classes: RawSymbol[]; - methods: RawSymbol[]; - functions: RawSymbol[]; -}; diff --git a/src/client/common/types.ts b/src/client/common/types.ts index 14615647d0f6..0e7523317cb1 100644 --- a/src/client/common/types.ts +++ b/src/client/common/types.ts @@ -77,7 +77,6 @@ export enum ProductType { Formatter = 'Formatter', TestFramework = 'TestFramework', RefactoringLibrary = 'RefactoringLibrary', - WorkspaceSymbols = 'WorkspaceSymbols', DataScience = 'DataScience', } @@ -93,8 +92,6 @@ export enum Product { autopep8 = 10, mypy = 11, unittest = 12, - ctags = 13, - rope = 14, isort = 15, black = 16, bandit = 17, @@ -182,7 +179,6 @@ export interface IPythonSettings { readonly autoComplete: IAutoCompleteSettings; readonly terminal: ITerminalSettings; readonly sortImports: ISortImportSettings; - readonly workspaceSymbols: IWorkspaceSymbolSettings; readonly envFile: string; readonly disableInstallationChecks: boolean; readonly globalModuleInstallation: boolean; @@ -283,14 +279,7 @@ export interface IAutoCompleteSettings { readonly showAdvancedMembers: boolean; readonly typeshedPaths: string[]; } -export interface IWorkspaceSymbolSettings { - readonly enabled: boolean; - tagFilePath: string; - readonly rebuildOnStart: boolean; - readonly rebuildOnFileSave: boolean; - readonly ctagsPath: string; - readonly exclusionPatterns: string[]; -} + export interface ITerminalSettings { readonly executeInFileDir: boolean; readonly launchArgs: string[]; diff --git a/src/client/extensionActivation.ts b/src/client/extensionActivation.ts index 113353ece830..059d8cb82052 100644 --- a/src/client/extensionActivation.ts +++ b/src/client/extensionActivation.ts @@ -31,7 +31,6 @@ import { PythonCodeActionProvider } from './providers/codeActionProvider/pythonC import { PythonFormattingEditProvider } from './providers/formatProvider'; import { ReplProvider } from './providers/replProvider'; import { registerTypes as providersRegisterTypes } from './providers/serviceRegistry'; -import { activateSimplePythonRefactorProvider } from './providers/simpleRefactorProvider'; import { TerminalProvider } from './providers/terminalProvider'; import { ISortImportsEditingProvider } from './providers/types'; import { setExtensionInstallTelemetryProperties } from './telemetry/extensionInstallTelemetry'; @@ -92,8 +91,6 @@ async function activateLegacy(ext: ExtensionState): Promise { // register "services" - const standardOutputChannel = serviceManager.get(IOutputChannel, STANDARD_OUTPUT_CHANNEL); - // We need to setup this property before any telemetry is sent const fs = serviceManager.get(IFileSystem); await setExtensionInstallTelemetryProperties(fs); @@ -158,8 +155,6 @@ async function activateLegacy(ext: ExtensionState): Promise { serviceManager.get(ITerminalAutoActivation).register(); const pythonSettings = configuration.getSettings(); - activateSimplePythonRefactorProvider(context, standardOutputChannel, serviceContainer); - const sortImports = serviceContainer.get(ISortImportsEditingProvider); sortImports.registerCommands(); diff --git a/src/client/linters/linterCommands.ts b/src/client/linters/linterCommands.ts index c423a0f33a22..ad3decdcef63 100644 --- a/src/client/linters/linterCommands.ts +++ b/src/client/linters/linterCommands.ts @@ -36,7 +36,7 @@ export class LinterCommands implements IDisposable { const linters = this.linterManager.getAllLinterInfos(); const suggestions = linters.map((x) => x.id).sort(); const linterList = ['Disable Linting', ...suggestions]; - const activeLinters = await this.linterManager.getActiveLinters(true, this.settingsUri); + const activeLinters = await this.linterManager.getActiveLinters(this.settingsUri); let current: string; switch (activeLinters.length) { @@ -82,7 +82,7 @@ export class LinterCommands implements IDisposable { public async enableLintingAsync(): Promise { const options = ['Enable', 'Disable']; - const current = (await this.linterManager.isLintingEnabled(true, this.settingsUri)) ? options[0] : options[1]; + const current = (await this.linterManager.isLintingEnabled(this.settingsUri)) ? options[0] : options[1]; const quickPickOptions: QuickPickOptions = { matchOnDetail: true, diff --git a/src/client/linters/linterInfo.ts b/src/client/linters/linterInfo.ts index 912eea1cdf04..f946cde97f7c 100644 --- a/src/client/linters/linterInfo.ts +++ b/src/client/linters/linterInfo.ts @@ -3,8 +3,6 @@ import * as path from 'path'; import { Uri } from 'vscode'; -import { LanguageServerType } from '../activation/types'; -import { IWorkspaceService } from '../common/application/types'; import { ExecutionInfo, IConfigurationService, Product } from '../common/types'; import { ILinterInfo, LinterId } from './types'; @@ -74,38 +72,3 @@ export class LinterInfo implements ILinterInfo { return { execPath, moduleName, args, product: this.product }; } } - -export class PylintLinterInfo extends LinterInfo { - constructor( - configService: IConfigurationService, - private readonly workspaceService: IWorkspaceService, - configFileNames: string[] = [], - ) { - super(Product.pylint, LinterId.PyLint, configService, configFileNames); - } - public isEnabled(resource?: Uri): boolean { - // We want to be sure the setting is not default since default is `true` and hence - // missing setting yields `true`. When setting is missing and LS is non-Jedi, - // we want default to be `false`. So inspection here makes sure we are not getting - // `true` because there is no setting and LS is active. - const enabled = super.isEnabled(resource); // Is it enabled by settings? - const usingJedi = this.configService.getSettings(resource).languageServer === LanguageServerType.Jedi; - if (usingJedi) { - // In Jedi case adhere to default behavior. Missing setting means `enabled`. - return enabled; - } - // If we're using LS, then by default Pylint is disabled unless user provided - // the value. We have to resort to direct inspection of settings here. - const configuration = this.workspaceService.getConfiguration('python', resource); - const inspection = configuration.inspect(`linting.${this.enabledSettingName}`); - if ( - !inspection || - (inspection.globalValue === undefined && - inspection.workspaceFolderValue === undefined && - inspection.workspaceValue === undefined) - ) { - return false; - } - return enabled; - } -} diff --git a/src/client/linters/linterManager.ts b/src/client/linters/linterManager.ts index 690db3a91172..e8ec38c5ca08 100644 --- a/src/client/linters/linterManager.ts +++ b/src/client/linters/linterManager.ts @@ -5,13 +5,12 @@ import { inject, injectable } from 'inversify'; import { CancellationToken, OutputChannel, TextDocument, Uri } from 'vscode'; -import { IWorkspaceService } from '../common/application/types'; import { traceError } from '../common/logger'; import { IConfigurationService, Product } from '../common/types'; import { IServiceContainer } from '../ioc/types'; import { Bandit } from './bandit'; import { Flake8 } from './flake8'; -import { LinterInfo, PylintLinterInfo } from './linterInfo'; +import { LinterInfo } from './linterInfo'; import { MyPy } from './mypy'; import { Prospector } from './prospector'; import { Pycodestyle } from './pycodestyle'; @@ -33,19 +32,13 @@ class DisabledLinter implements ILinter { @injectable() export class LinterManager implements ILinterManager { protected linters: ILinterInfo[]; - private configService: IConfigurationService; - private checkedForInstalledLinters = new Set(); - constructor( - @inject(IServiceContainer) private readonly serviceContainer: IServiceContainer, - @inject(IWorkspaceService) private readonly workspaceService: IWorkspaceService, - ) { - this.configService = this.serviceContainer.get(IConfigurationService); + constructor(@inject(IConfigurationService) private configService: IConfigurationService) { // Note that we use unit tests to ensure all the linters are here. this.linters = [ new LinterInfo(Product.bandit, LinterId.Bandit, this.configService), new LinterInfo(Product.flake8, LinterId.Flake8, this.configService), - new PylintLinterInfo(this.configService, this.workspaceService, ['.pylintrc', 'pylintrc']), + new LinterInfo(Product.pylint, LinterId.PyLint, this.configService, ['pylintrc', '.pylintrc']), new LinterInfo(Product.mypy, LinterId.MyPy, this.configService), new LinterInfo(Product.pycodestyle, LinterId.PyCodeStyle, this.configService), new LinterInfo(Product.prospector, LinterId.Prospector, this.configService), @@ -66,9 +59,9 @@ export class LinterManager implements ILinterManager { throw new Error(`Invalid linter '${Product[product]}'`); } - public async isLintingEnabled(silent: boolean, resource?: Uri): Promise { + public async isLintingEnabled(resource?: Uri): Promise { const settings = this.configService.getSettings(resource); - const activeLintersPresent = await this.getActiveLinters(silent, resource); + const activeLintersPresent = await this.getActiveLinters(resource); return settings.linting.enabled && activeLintersPresent.length > 0; } @@ -76,10 +69,7 @@ export class LinterManager implements ILinterManager { await this.configService.updateSetting('linting.enabled', enable, resource); } - public async getActiveLinters(silent: boolean, resource?: Uri): Promise { - if (!silent) { - await this.enableUnconfiguredLinters(resource); - } + public async getActiveLinters(resource?: Uri): Promise { return this.linters.filter((x) => x.isEnabled(resource)); } @@ -93,7 +83,7 @@ export class LinterManager implements ILinterManager { // if we have valid linter product(s), enable only those if (validProducts.length > 0) { - const active = await this.getActiveLinters(true, resource); + const active = await this.getActiveLinters(resource); for (const x of active) { await x.enableAsync(false, resource); } @@ -113,7 +103,7 @@ export class LinterManager implements ILinterManager { serviceContainer: IServiceContainer, resource?: Uri, ): Promise { - if (!(await this.isLintingEnabled(true, resource))) { + if (!(await this.isLintingEnabled(resource))) { return new DisabledLinter(this.configService); } const error = 'Linter manager: Unknown linter'; @@ -140,17 +130,4 @@ export class LinterManager implements ILinterManager { } throw new Error(error); } - - protected async enableUnconfiguredLinters(resource?: Uri): Promise { - const settings = this.configService.getSettings(resource); - if (!settings.linting.enabled) { - return; - } - // If we've already checked during this session for the same workspace and Python path, then don't bother again. - const workspaceKey = `${this.workspaceService.getWorkspaceFolderIdentifier(resource)}${settings.pythonPath}`; - if (this.checkedForInstalledLinters.has(workspaceKey)) { - return; - } - this.checkedForInstalledLinters.add(workspaceKey); - } } diff --git a/src/client/linters/lintingEngine.ts b/src/client/linters/lintingEngine.ts index 00c7dab0ea08..c932a9e27882 100644 --- a/src/client/linters/lintingEngine.ts +++ b/src/client/linters/lintingEngine.ts @@ -90,7 +90,7 @@ export class LintingEngine implements ILintingEngine { this.pendingLintings.set(document.uri.fsPath, cancelToken); - const activeLinters = await this.linterManager.getActiveLinters(false, document.uri); + const activeLinters = await this.linterManager.getActiveLinters(document.uri); const promises: Promise[] = activeLinters.map(async (info: ILinterInfo) => { const stopWatch = new StopWatch(); const linter = await this.linterManager.createLinter( @@ -161,7 +161,7 @@ export class LintingEngine implements ILintingEngine { } private async shouldLintDocument(document: vscode.TextDocument): Promise { - if (!(await this.linterManager.isLintingEnabled(false, document.uri))) { + if (!(await this.linterManager.isLintingEnabled(document.uri))) { this.diagnosticCollection.set(document.uri, []); return false; } diff --git a/src/client/linters/types.ts b/src/client/linters/types.ts index 7fedb20ba9de..10d78fd29bd0 100644 --- a/src/client/linters/types.ts +++ b/src/client/linters/types.ts @@ -45,8 +45,8 @@ export const ILinterManager = Symbol('ILinterManager'); export interface ILinterManager { getAllLinterInfos(): ILinterInfo[]; getLinterInfo(product: Product): ILinterInfo; - getActiveLinters(silent: boolean, resource?: vscode.Uri): Promise; - isLintingEnabled(silent: boolean, resource?: vscode.Uri): Promise; + getActiveLinters(resource?: vscode.Uri): Promise; + isLintingEnabled(resource?: vscode.Uri): Promise; enableLintingAsync(enable: boolean, resource?: vscode.Uri): Promise; setActiveLintersAsync(products: Product[], resource?: vscode.Uri): Promise; createLinter( diff --git a/src/client/providers/linterProvider.ts b/src/client/providers/linterProvider.ts index 8bfde47e192b..8be6be069154 100644 --- a/src/client/providers/linterProvider.ts +++ b/src/client/providers/linterProvider.ts @@ -90,7 +90,7 @@ export class LinterProvider implements IExtensionActivationService, Disposable { } this.linterManager - .getActiveLinters(false, document.uri) + .getActiveLinters(document.uri) .then((linters) => { const fileName = path.basename(document.uri.fsPath).toLowerCase(); const watchers = linters.filter((info) => info.configFileNames.indexOf(fileName) >= 0); diff --git a/src/client/providers/simpleRefactorProvider.ts b/src/client/providers/simpleRefactorProvider.ts deleted file mode 100644 index ed485e084137..000000000000 --- a/src/client/providers/simpleRefactorProvider.ts +++ /dev/null @@ -1,223 +0,0 @@ -import * as vscode from 'vscode'; -import { Commands } from '../common/constants'; -import { getTextEditsFromPatch } from '../common/editor'; -import { traceError } from '../common/logger'; -import { IPythonExecutionFactory } from '../common/process/types'; -import { IInstaller, Product } from '../common/types'; -import { StopWatch } from '../common/utils/stopWatch'; -import { IServiceContainer } from '../ioc/types'; -import { RefactorProxy } from '../refactor/proxy'; -import { sendTelemetryWhenDone } from '../telemetry'; -import { EventName } from '../telemetry/constants'; - -type RenameResponse = { - results: [{ diff: string }]; -}; - -let installer: IInstaller; - -export function activateSimplePythonRefactorProvider( - context: vscode.ExtensionContext, - outputChannel: vscode.OutputChannel, - serviceContainer: IServiceContainer, -) { - installer = serviceContainer.get(IInstaller); - let disposable = vscode.commands.registerCommand(Commands.Refactor_Extract_Variable, () => { - const stopWatch = new StopWatch(); - const promise = extractVariable( - vscode.window.activeTextEditor!, - vscode.window.activeTextEditor!.selection, - outputChannel, - serviceContainer, - ).catch(() => {}); - sendTelemetryWhenDone(EventName.REFACTOR_EXTRACT_VAR, promise, stopWatch); - }); - context.subscriptions.push(disposable); - - disposable = vscode.commands.registerCommand(Commands.Refactor_Extract_Method, () => { - const stopWatch = new StopWatch(); - const promise = extractMethod( - vscode.window.activeTextEditor!, - vscode.window.activeTextEditor!.selection, - outputChannel, - serviceContainer, - ).catch(() => {}); - sendTelemetryWhenDone(EventName.REFACTOR_EXTRACT_FUNCTION, promise, stopWatch); - }); - context.subscriptions.push(disposable); -} - -// Exported for unit testing -export function extractVariable( - textEditor: vscode.TextEditor, - range: vscode.Range, - outputChannel: vscode.OutputChannel, - serviceContainer: IServiceContainer, -): Promise { - let workspaceFolder = vscode.workspace.getWorkspaceFolder(textEditor.document.uri); - if ( - !workspaceFolder && - Array.isArray(vscode.workspace.workspaceFolders) && - vscode.workspace.workspaceFolders.length > 0 - ) { - workspaceFolder = vscode.workspace.workspaceFolders[0]; - } - const workspaceRoot = workspaceFolder ? workspaceFolder.uri.fsPath : __dirname; - - return validateDocumentForRefactor(textEditor).then(() => { - const newName = `newvariable${new Date().getMilliseconds().toString()}`; - const proxy = new RefactorProxy(workspaceRoot, async () => { - const factory = serviceContainer.get(IPythonExecutionFactory); - return factory.create({ resource: vscode.Uri.file(workspaceRoot) }); - }); - const rename = proxy - .extractVariable( - textEditor.document, - newName, - textEditor.document.uri.fsPath, - range, - textEditor.options, - ) - .then((response) => { - return response.results[0].diff; - }); - - return extractName(textEditor, newName, rename, outputChannel); - }); -} - -// Exported for unit testing -export function extractMethod( - textEditor: vscode.TextEditor, - range: vscode.Range, - outputChannel: vscode.OutputChannel, - serviceContainer: IServiceContainer, -): Promise { - let workspaceFolder = vscode.workspace.getWorkspaceFolder(textEditor.document.uri); - if ( - !workspaceFolder && - Array.isArray(vscode.workspace.workspaceFolders) && - vscode.workspace.workspaceFolders.length > 0 - ) { - workspaceFolder = vscode.workspace.workspaceFolders[0]; - } - const workspaceRoot = workspaceFolder ? workspaceFolder.uri.fsPath : __dirname; - - return validateDocumentForRefactor(textEditor).then(() => { - const newName = `newmethod${new Date().getMilliseconds().toString()}`; - const proxy = new RefactorProxy(workspaceRoot, async () => { - const factory = serviceContainer.get(IPythonExecutionFactory); - return factory.create({ resource: vscode.Uri.file(workspaceRoot) }); - }); - const rename = proxy - .extractMethod( - textEditor.document, - newName, - textEditor.document.uri.fsPath, - range, - textEditor.options, - ) - .then((response) => { - return response.results[0].diff; - }); - - return extractName(textEditor, newName, rename, outputChannel); - }); -} - -function validateDocumentForRefactor(textEditor: vscode.TextEditor): Promise { - if (!textEditor.document.isDirty) { - return Promise.resolve(); - } - - return new Promise((resolve, reject) => { - vscode.window.showInformationMessage('Please save changes before refactoring', 'Save').then((item) => { - if (item === 'Save') { - textEditor.document.save().then(resolve, reject); - } else { - return reject(); - } - }); - }); -} - -function extractName( - textEditor: vscode.TextEditor, - newName: string, - renameResponse: Promise, - outputChannel: vscode.OutputChannel, -): Promise { - let changeStartsAtLine = -1; - return renameResponse - .then((diff) => { - if (diff.length === 0) { - return []; - } - return getTextEditsFromPatch(textEditor.document.getText(), diff); - }) - .then((edits) => { - return textEditor.edit((editBuilder) => { - edits.forEach((edit) => { - if (changeStartsAtLine === -1 || changeStartsAtLine > edit.range.start.line) { - changeStartsAtLine = edit.range.start.line; - } - editBuilder.replace(edit.range, edit.newText); - }); - }); - }) - .then((done) => { - if (done && changeStartsAtLine >= 0) { - let newWordPosition: vscode.Position | undefined; - for (let lineNumber = changeStartsAtLine; lineNumber < textEditor.document.lineCount; lineNumber += 1) { - const line = textEditor.document.lineAt(lineNumber); - const indexOfWord = line.text.indexOf(newName); - if (indexOfWord >= 0) { - newWordPosition = new vscode.Position(line.range.start.line, indexOfWord); - break; - } - } - - if (newWordPosition) { - textEditor.selections = [ - new vscode.Selection( - newWordPosition, - new vscode.Position(newWordPosition.line, newWordPosition.character + newName.length), - ), - ]; - textEditor.revealRange( - new vscode.Range(textEditor.selection.start, textEditor.selection.end), - vscode.TextEditorRevealType.Default, - ); - } - return newWordPosition; - } - return null; - }) - .then((newWordPosition) => { - if (newWordPosition) { - return textEditor.document.save().then(() => { - // Now that we have selected the new variable, lets invoke the rename command - return vscode.commands.executeCommand('editor.action.rename'); - }); - } - }) - .catch((error) => { - if (error === 'Not installed') { - installer - .promptToInstall(Product.rope, textEditor.document.uri) - .catch((ex) => traceError('Python Extension: simpleRefactorProvider.promptToInstall', ex)); - return Promise.reject(''); - } - let errorMessage = `${error}`; - if (typeof error === 'string') { - errorMessage = error; - } - if (typeof error === 'object' && error.message) { - errorMessage = error.message; - } - outputChannel.appendLine(`${'#'.repeat(10)}Refactor Output${'#'.repeat(10)}`); - outputChannel.appendLine(`Error in refactoring:\n${errorMessage}`); - vscode.window.showErrorMessage(`Cannot perform refactoring using selected element(s). (${errorMessage})`); - return Promise.reject(error); - }); -} diff --git a/src/client/refactor/proxy.ts b/src/client/refactor/proxy.ts deleted file mode 100644 index 7f89eef54408..000000000000 --- a/src/client/refactor/proxy.ts +++ /dev/null @@ -1,206 +0,0 @@ -import { ChildProcess } from 'child_process'; -import { Disposable, Position, Range, TextDocument, TextEditorOptions, window } from 'vscode'; -import '../common/extensions'; -import { traceError } from '../common/logger'; -import { IS_WINDOWS } from '../common/platform/constants'; -import * as internalScripts from '../common/process/internal/scripts'; -import { IPythonExecutionService } from '../common/process/types'; -import { createDeferred, Deferred } from '../common/utils/async'; -import { getWindowsLineEndingCount } from '../common/utils/text'; - -export class RefactorProxy extends Disposable { - private _process?: ChildProcess; - private _previousOutData: string = ''; - private _previousStdErrData: string = ''; - private _startedSuccessfully: boolean = false; - private _commandResolve?: (value?: any | PromiseLike) => void; - private _commandReject!: (reason?: any) => void; - private initialized!: Deferred; - constructor( - private workspaceRoot: string, - private getPythonExecutionService: () => Promise, - ) { - super(() => {}); - } - - public dispose() { - try { - this._process!.kill(); - } catch (ex) {} - this._process = undefined; - } - private getOffsetAt(document: TextDocument, position: Position): number { - if (!IS_WINDOWS) { - return document.offsetAt(position); - } - - // get line count - // Rope always uses LF, instead of CRLF on windows, funny isn't it - // So for each line, reduce one characer (for CR) - // But Not all Windows users use CRLF - const offset = document.offsetAt(position); - const winEols = getWindowsLineEndingCount(document, offset); - - return offset - winEols; - } - public rename( - document: TextDocument, - name: string, - filePath: string, - range: Range, - options?: TextEditorOptions, - ): Promise { - if (!options) { - options = window.activeTextEditor!.options; - } - const command = { - lookup: 'rename', - file: filePath, - start: this.getOffsetAt(document, range.start).toString(), - id: '1', - name: name, - indent_size: options.tabSize, - }; - - return this.sendCommand(JSON.stringify(command)); - } - public extractVariable( - document: TextDocument, - name: string, - filePath: string, - range: Range, - options?: TextEditorOptions, - ): Promise { - if (!options) { - options = window.activeTextEditor!.options; - } - const command = { - lookup: 'extract_variable', - file: filePath, - start: this.getOffsetAt(document, range.start).toString(), - end: this.getOffsetAt(document, range.end).toString(), - id: '1', - name: name, - indent_size: options.tabSize, - }; - return this.sendCommand(JSON.stringify(command)); - } - public extractMethod( - document: TextDocument, - name: string, - filePath: string, - range: Range, - options?: TextEditorOptions, - ): Promise { - if (!options) { - options = window.activeTextEditor!.options; - } - // Ensure last line is an empty line - if ( - !document.lineAt(document.lineCount - 1).isEmptyOrWhitespace && - range.start.line === document.lineCount - 1 - ) { - return Promise.reject('Missing blank line at the end of document (PEP8).'); - } - const command = { - lookup: 'extract_method', - file: filePath, - start: this.getOffsetAt(document, range.start).toString(), - end: this.getOffsetAt(document, range.end).toString(), - id: '1', - name: name, - indent_size: options.tabSize, - }; - return this.sendCommand(JSON.stringify(command)); - } - private sendCommand(command: string): Promise { - return this.initialize().then(() => { - return new Promise((resolve, reject) => { - this._commandResolve = resolve; - this._commandReject = reject; - this._process!.stdin?.write(command + '\n'); - }); - }); - } - private async initialize(): Promise { - const pythonProc = await this.getPythonExecutionService(); - this.initialized = createDeferred(); - const [args, parse] = internalScripts.refactor(this.workspaceRoot); - const result = pythonProc.execObservable(args, {}); - this._process = result.proc; - result.out.subscribe( - (output) => { - if (output.source === 'stdout') { - if (!this._startedSuccessfully && output.out.startsWith('STARTED')) { - this._startedSuccessfully = true; - return this.initialized.resolve(); - } - this.onData(output.out, parse); - } else { - this.handleStdError(output.out); - } - }, - (error) => this.handleError(error), - ); - - return this.initialized.promise; - } - private handleStdError(data: string) { - // Possible there was an exception in parsing the data returned - // So append the data then parse it - let dataStr = (this._previousStdErrData = this._previousStdErrData + data + ''); - let errorResponse: { message: string; traceback: string; type: string }[]; - try { - errorResponse = dataStr - .split(/\r?\n/g) - .filter((line) => line.length > 0) - .map((resp) => JSON.parse(resp)); - this._previousStdErrData = ''; - } catch (ex) { - traceError(ex); - // Possible we've only received part of the data, hence don't clear previousData - return; - } - if (typeof errorResponse[0].message !== 'string' || errorResponse[0].message.length === 0) { - errorResponse[0].message = errorResponse[0].traceback.splitLines().pop()!; - } - let errorMessage = errorResponse[0].message + '\n' + errorResponse[0].traceback; - - if (this._startedSuccessfully) { - this._commandReject(`Refactor failed. ${errorMessage}`); - } else { - if (typeof errorResponse[0].type === 'string' && errorResponse[0].type === 'ModuleNotFoundError') { - this.initialized.reject('Not installed'); - return; - } - - this.initialized.reject(`Refactor failed. ${errorMessage}`); - } - } - private handleError(error: Error) { - if (this._startedSuccessfully) { - return this._commandReject(error); - } - this.initialized.reject(error); - } - private onData(data: string, parse: (out: string) => object[]) { - if (!this._commandResolve) { - return; - } - - // Possible there was an exception in parsing the data returned - // So append the data then parse it - let dataStr = (this._previousOutData = this._previousOutData + data + ''); - let response: any; - try { - response = parse(dataStr); - this._previousOutData = ''; - } catch (ex) { - // Possible we've only received part of the data, hence don't clear previousData - return; - } - this.dispose(); - this._commandResolve!(response[0]); - this._commandResolve = undefined; - } -} diff --git a/src/client/telemetry/constants.ts b/src/client/telemetry/constants.ts index a171efd122ef..c89766f1b321 100644 --- a/src/client/telemetry/constants.ts +++ b/src/client/telemetry/constants.ts @@ -10,8 +10,6 @@ export enum EventName { FORMAT_ON_TYPE = 'FORMAT.FORMAT_ON_TYPE', EDITOR_LOAD = 'EDITOR.LOAD', LINTING = 'LINTING', - REFACTOR_EXTRACT_VAR = 'REFACTOR_EXTRACT_VAR', - REFACTOR_EXTRACT_FUNCTION = 'REFACTOR_EXTRACT_FUNCTION', REPL = 'REPL', SELECT_INTERPRETER = 'SELECT_INTERPRETER', SELECT_INTERPRETER_ENTER_BUTTON = 'SELECT_INTERPRETER_ENTER_BUTTON', @@ -35,8 +33,6 @@ export enum EventName { INSIDERS_PROMPT = 'INSIDERS_PROMPT', ENVFILE_VARIABLE_SUBSTITUTION = 'ENVFILE_VARIABLE_SUBSTITUTION', ENVFILE_WORKSPACE = 'ENVFILE_WORKSPACE', - WORKSPACE_SYMBOLS_BUILD = 'WORKSPACE_SYMBOLS.BUILD', - WORKSPACE_SYMBOLS_GO_TO = 'WORKSPACE_SYMBOLS.GO_TO', EXECUTION_CODE = 'EXECUTION_CODE', EXECUTION_DJANGO = 'EXECUTION_DJANGO', @@ -102,7 +98,6 @@ export enum EventName { LINTER_NOT_INSTALLED_PROMPT = 'LINTER_NOT_INSTALLED_PROMPT', LINTER_INSTALL_PROMPT = 'LINTER_INSTALL_PROMPT', - CONFIGURE_AVAILABLE_LINTER_PROMPT = 'CONFIGURE_AVAILABLE_LINTER_PROMPT', HASHED_PACKAGE_NAME = 'HASHED_PACKAGE_NAME', HASHED_PACKAGE_PERF = 'HASHED_PACKAGE_PERF', diff --git a/src/client/telemetry/index.ts b/src/client/telemetry/index.ts index 965b24449eda..3f462c55de8a 100644 --- a/src/client/telemetry/index.ts +++ b/src/client/telemetry/index.ts @@ -1338,14 +1338,6 @@ export interface IEventNamePropertyMapping { */ selection: 'Yes' | 'No' | undefined; }; - /** - * Telemetry event sent when 'Extract Method' command is invoked - */ - [EventName.REFACTOR_EXTRACT_FUNCTION]: never | undefined; - /** - * Telemetry event sent when 'Extract Variable' command is invoked - */ - [EventName.REFACTOR_EXTRACT_VAR]: never | undefined; /** * Telemetry event sent when starting REPL */ @@ -1363,26 +1355,6 @@ export interface IEventNamePropertyMapping { */ enabled: boolean; }; - /** - * Telemetry event sent with details when clicking the prompt with the following message, - * `Prompt message` :- 'You have a pylintrc file in your workspace. Do you want to enable pylint?' - */ - [EventName.CONFIGURE_AVAILABLE_LINTER_PROMPT]: { - /** - * Name of the linter tool - * - * @type {LinterId} - */ - tool: LinterId; - /** - * `enable` When 'Enable [linter name]' option is clicked - * `ignore` When 'Not now' option is clicked - * `disablePrompt` When 'Do not show again` option is clicked - * - * @type {('enable' | 'ignore' | 'disablePrompt' | undefined)} - */ - action: 'enable' | 'ignore' | 'disablePrompt' | undefined; - }; /** * Telemetry event sent if and when user configure tests command. This command can be trigerred from multiple places in the extension. (Command palette, prompt etc.) */ @@ -1520,14 +1492,6 @@ export interface IEventNamePropertyMapping { * Telemetry event sent when testing is disabled for a workspace. */ [EventName.UNITTEST_DISABLED]: never | undefined; - /** - * Telemetry sent when building workspace symbols - */ - [EventName.WORKSPACE_SYMBOLS_BUILD]: never | undefined; - /** - * Telemetry sent when providing workspace symbols doing Project-wide search for a symbol matching the given query string - */ - [EventName.WORKSPACE_SYMBOLS_GO_TO]: never | undefined; /* Telemetry event sent to provide information on whether we have successfully identify the type of shell used. This information is useful in determining how well we identify shells on users machines. diff --git a/src/client/workspaceSymbols/contracts.ts b/src/client/workspaceSymbols/contracts.ts deleted file mode 100644 index ae447a4e2fbb..000000000000 --- a/src/client/workspaceSymbols/contracts.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Position, SymbolKind } from 'vscode'; - -export interface ITag { - fileName: string; - symbolName: string; - symbolKind: SymbolKind; - position: Position; - code: string; -} diff --git a/src/client/workspaceSymbols/generator.ts b/src/client/workspaceSymbols/generator.ts deleted file mode 100644 index 779440d8cfb5..000000000000 --- a/src/client/workspaceSymbols/generator.ts +++ /dev/null @@ -1,99 +0,0 @@ -import * as path from 'path'; -import { Disposable, OutputChannel, Uri } from 'vscode'; -import { IApplicationShell } from '../common/application/types'; -import { IFileSystem } from '../common/platform/types'; -import { IProcessServiceFactory } from '../common/process/types'; -import { IConfigurationService, IPythonSettings } from '../common/types'; -import { EXTENSION_ROOT_DIR } from '../constants'; -import { captureTelemetry } from '../telemetry'; -import { EventName } from '../telemetry/constants'; - -export class Generator implements Disposable { - private optionsFile: string; - private disposables: Disposable[]; - private pythonSettings: IPythonSettings; - public get tagFilePath(): string { - return this.pythonSettings.workspaceSymbols.tagFilePath; - } - public get enabled(): boolean { - return this.pythonSettings.workspaceSymbols.enabled; - } - constructor( - public readonly workspaceFolder: Uri, - private readonly output: OutputChannel, - private readonly appShell: IApplicationShell, - private readonly fs: IFileSystem, - private readonly processServiceFactory: IProcessServiceFactory, - configurationService: IConfigurationService, - ) { - this.disposables = []; - this.optionsFile = path.join(EXTENSION_ROOT_DIR, 'resources', 'ctagOptions'); - this.pythonSettings = configurationService.getSettings(workspaceFolder); - } - - public dispose() { - this.disposables.forEach((d) => d.dispose()); - } - public async generateWorkspaceTags(): Promise { - if (!this.pythonSettings.workspaceSymbols.enabled) { - return; - } - return this.generateTags({ directory: this.workspaceFolder.fsPath }); - } - private buildCmdArgs(): string[] { - const exclusions = this.pythonSettings.workspaceSymbols.exclusionPatterns; - const excludes = exclusions.length === 0 ? [] : exclusions.map((pattern) => `--exclude=${pattern}`); - - return [`--options=${this.optionsFile}`, '--languages=Python'].concat(excludes); - } - @captureTelemetry(EventName.WORKSPACE_SYMBOLS_BUILD) - private async generateTags(source: { directory?: string; file?: string }): Promise { - const tagFile = path.normalize(this.pythonSettings.workspaceSymbols.tagFilePath); - const cmd = this.pythonSettings.workspaceSymbols.ctagsPath; - const args = this.buildCmdArgs(); - let outputFile = tagFile; - if (source.file && source.file.length > 0) { - source.directory = path.dirname(source.file); - } - - if (path.dirname(outputFile) === source.directory) { - outputFile = path.basename(outputFile); - } - const outputDir = path.dirname(outputFile); - if (!(await this.fs.directoryExists(outputDir))) { - await this.fs.createDirectory(outputDir); - } - args.push('-o', outputFile, '.'); - this.output.appendLine(`${'-'.repeat(10)}Generating Tags${'-'.repeat(10)}`); - this.output.appendLine(`${cmd} ${args.join(' ')}`); - const promise = new Promise(async (resolve, reject) => { - try { - const processService = await this.processServiceFactory.create(); - const result = processService.execObservable(cmd, args, { cwd: source.directory }); - let errorMsg = ''; - result.out.subscribe( - (output) => { - if (output.source === 'stderr') { - errorMsg += output.out; - } - this.output.append(output.out); - }, - reject, - () => { - if (errorMsg.length > 0) { - reject(new Error(errorMsg)); - } else { - resolve(); - } - }, - ); - } catch (ex) { - reject(ex); - } - }); - - this.appShell.setStatusBarMessage('Generating Tags', promise); - - await promise; - } -} diff --git a/src/client/workspaceSymbols/main.ts b/src/client/workspaceSymbols/main.ts deleted file mode 100644 index af3aa232a90b..000000000000 --- a/src/client/workspaceSymbols/main.ts +++ /dev/null @@ -1,151 +0,0 @@ -import { CancellationToken, Disposable, languages, OutputChannel, TextDocument } from 'vscode'; -import { IApplicationShell, ICommandManager, IDocumentManager, IWorkspaceService } from '../common/application/types'; -import { Commands, STANDARD_OUTPUT_CHANNEL } from '../common/constants'; -import { isNotInstalledError } from '../common/helpers'; -import { IFileSystem } from '../common/platform/types'; -import { IProcessServiceFactory } from '../common/process/types'; -import { IConfigurationService, IInstaller, InstallerResponse, IOutputChannel, Product } from '../common/types'; -import { IServiceContainer } from '../ioc/types'; -import { Generator } from './generator'; -import { WorkspaceSymbolProvider } from './provider'; - -const MAX_NUMBER_OF_ATTEMPTS_TO_INSTALL_AND_BUILD = 2; - -export class WorkspaceSymbols implements Disposable { - private disposables: Disposable[]; - private generators: Generator[] = []; - private readonly outputChannel: OutputChannel; - private commandMgr: ICommandManager; - private fs: IFileSystem; - private workspace: IWorkspaceService; - private processFactory: IProcessServiceFactory; - private appShell: IApplicationShell; - private configurationService: IConfigurationService; - private documents: IDocumentManager; - - constructor(private serviceContainer: IServiceContainer) { - this.outputChannel = this.serviceContainer.get(IOutputChannel, STANDARD_OUTPUT_CHANNEL); - this.commandMgr = this.serviceContainer.get(ICommandManager); - this.fs = this.serviceContainer.get(IFileSystem); - this.workspace = this.serviceContainer.get(IWorkspaceService); - this.processFactory = this.serviceContainer.get(IProcessServiceFactory); - this.appShell = this.serviceContainer.get(IApplicationShell); - this.configurationService = this.serviceContainer.get(IConfigurationService); - this.documents = this.serviceContainer.get(IDocumentManager); - this.disposables = []; - this.disposables.push(this.outputChannel); - this.registerCommands(); - this.initializeGenerators(); - languages.registerWorkspaceSymbolProvider( - new WorkspaceSymbolProvider(this.fs, this.commandMgr, this.generators), - ); - this.disposables.push(this.workspace.onDidChangeWorkspaceFolders(() => this.initializeGenerators())); - this.disposables.push(this.documents.onDidSaveTextDocument((e) => this.onDocumentSaved(e))); - this.buildSymbolsOnStart(); - } - public dispose() { - this.disposables.forEach((d) => d.dispose()); - } - private initializeGenerators() { - while (this.generators.length > 0) { - const generator = this.generators.shift()!; - generator.dispose(); - } - - if (Array.isArray(this.workspace.workspaceFolders)) { - this.workspace.workspaceFolders.forEach((wkSpc) => { - this.generators.push( - new Generator( - wkSpc.uri, - this.outputChannel, - this.appShell, - this.fs, - this.processFactory, - this.configurationService, - ), - ); - }); - } - } - - private buildSymbolsOnStart() { - if (Array.isArray(this.workspace.workspaceFolders)) { - this.workspace.workspaceFolders.forEach((workspaceFolder) => { - const pythonSettings = this.configurationService.getSettings(workspaceFolder.uri); - if (pythonSettings.workspaceSymbols.rebuildOnStart) { - const promises = this.buildWorkspaceSymbols(true); - return Promise.all(promises); - } - }); - } - } - - private registerCommands() { - this.disposables.push( - this.commandMgr.registerCommand( - Commands.Build_Workspace_Symbols, - async (rebuild: boolean = true, token?: CancellationToken) => { - const promises = this.buildWorkspaceSymbols(rebuild, token); - return Promise.all(promises); - }, - ), - ); - } - - private onDocumentSaved(document: TextDocument) { - const workspaceFolder = this.workspace.getWorkspaceFolder(document.uri); - const pythonSettings = this.configurationService.getSettings(workspaceFolder?.uri); - if (pythonSettings.workspaceSymbols.rebuildOnFileSave) { - const promises = this.buildWorkspaceSymbols(true); - return Promise.all(promises); - } - } - - private buildWorkspaceSymbols(rebuild: boolean = true, token?: CancellationToken): Promise[] { - if (token && token.isCancellationRequested) { - return []; - } - if (this.generators.length === 0) { - return []; - } - - let promptPromise: Promise; - let promptResponse: InstallerResponse; - return this.generators.map(async (generator) => { - if (!generator.enabled) { - return; - } - const exists = await this.fs.fileExists(generator.tagFilePath); - // If file doesn't exist, then run the ctag generator, - // or check if required to rebuild. - if (!rebuild && exists) { - return; - } - for (let counter = 0; counter < MAX_NUMBER_OF_ATTEMPTS_TO_INSTALL_AND_BUILD; counter += 1) { - try { - await generator.generateWorkspaceTags(); - return; - } catch (error) { - if (!isNotInstalledError(error)) { - return; - } - } - if (!token || token.isCancellationRequested) { - return; - } - // Display prompt once for all workspaces. - if (promptPromise) { - promptResponse = await promptPromise; - continue; - } else { - const installer = this.serviceContainer.get(IInstaller); - promptPromise = installer.promptToInstall(Product.ctags, this.workspace.workspaceFolders![0]!.uri); - promptResponse = await promptPromise; - } - if (promptResponse !== InstallerResponse.Installed || !token || token.isCancellationRequested) { - return; - } - } - }); - } -} diff --git a/src/client/workspaceSymbols/parser.ts b/src/client/workspaceSymbols/parser.ts deleted file mode 100644 index b46ce151f6b4..000000000000 --- a/src/client/workspaceSymbols/parser.ts +++ /dev/null @@ -1,170 +0,0 @@ -import * as path from 'path'; -import * as vscode from 'vscode'; -import { IFileSystem } from '../common/platform/types'; -import { ITag } from './contracts'; - -// TODO: Turn these into imports. -const LineByLineReader = require('line-by-line'); -const NamedRegexp = require('named-js-regexp'); -const fuzzy = require('fuzzy'); - -const IsFileRegEx = /\tkind:file\tline:\d+$/g; -const LINE_REGEX = '(?\\w+)\\t(?.*)\\t\\/\\^(?.*)\\$\\/;"\\tkind:(?\\w+)\\tline:(?\\d+)$'; - -interface IRegexGroup { - name: string; - file: string; - code: string; - type: string; - line: number; -} - -function matchNamedRegEx(data: String, regex: String): IRegexGroup | null { - const compiledRegexp = NamedRegexp(regex, 'g'); - const rawMatch = compiledRegexp.exec(data); - if (rawMatch !== null) { - return rawMatch.groups(); - } - - return null; -} - -const CTagKinMapping = new Map(); -CTagKinMapping.set('_array', vscode.SymbolKind.Array); -CTagKinMapping.set('_boolean', vscode.SymbolKind.Boolean); -CTagKinMapping.set('_class', vscode.SymbolKind.Class); -CTagKinMapping.set('_classes', vscode.SymbolKind.Class); -CTagKinMapping.set('_constant', vscode.SymbolKind.Constant); -CTagKinMapping.set('_constants', vscode.SymbolKind.Constant); -CTagKinMapping.set('_constructor', vscode.SymbolKind.Constructor); -CTagKinMapping.set('_enum', vscode.SymbolKind.Enum); -CTagKinMapping.set('_enums', vscode.SymbolKind.Enum); -CTagKinMapping.set('_enumeration', vscode.SymbolKind.Enum); -CTagKinMapping.set('_enumerations', vscode.SymbolKind.Enum); -CTagKinMapping.set('_field', vscode.SymbolKind.Field); -CTagKinMapping.set('_fields', vscode.SymbolKind.Field); -CTagKinMapping.set('_file', vscode.SymbolKind.File); -CTagKinMapping.set('_files', vscode.SymbolKind.File); -CTagKinMapping.set('_function', vscode.SymbolKind.Function); -CTagKinMapping.set('_functions', vscode.SymbolKind.Function); -CTagKinMapping.set('_member', vscode.SymbolKind.Function); -CTagKinMapping.set('_interface', vscode.SymbolKind.Interface); -CTagKinMapping.set('_interfaces', vscode.SymbolKind.Interface); -CTagKinMapping.set('_key', vscode.SymbolKind.Key); -CTagKinMapping.set('_keys', vscode.SymbolKind.Key); -CTagKinMapping.set('_method', vscode.SymbolKind.Method); -CTagKinMapping.set('_methods', vscode.SymbolKind.Method); -CTagKinMapping.set('_module', vscode.SymbolKind.Module); -CTagKinMapping.set('_modules', vscode.SymbolKind.Module); -CTagKinMapping.set('_namespace', vscode.SymbolKind.Namespace); -CTagKinMapping.set('_namespaces', vscode.SymbolKind.Namespace); -CTagKinMapping.set('_number', vscode.SymbolKind.Number); -CTagKinMapping.set('_numbers', vscode.SymbolKind.Number); -CTagKinMapping.set('_null', vscode.SymbolKind.Null); -CTagKinMapping.set('_object', vscode.SymbolKind.Object); -CTagKinMapping.set('_package', vscode.SymbolKind.Package); -CTagKinMapping.set('_packages', vscode.SymbolKind.Package); -CTagKinMapping.set('_property', vscode.SymbolKind.Property); -CTagKinMapping.set('_properties', vscode.SymbolKind.Property); -CTagKinMapping.set('_objects', vscode.SymbolKind.Object); -CTagKinMapping.set('_string', vscode.SymbolKind.String); -CTagKinMapping.set('_variable', vscode.SymbolKind.Variable); -CTagKinMapping.set('_variables', vscode.SymbolKind.Variable); -CTagKinMapping.set('_projects', vscode.SymbolKind.Package); -CTagKinMapping.set('_defines', vscode.SymbolKind.Module); -CTagKinMapping.set('_labels', vscode.SymbolKind.Interface); -CTagKinMapping.set('_macros', vscode.SymbolKind.Function); -CTagKinMapping.set('_types (structs and records)', vscode.SymbolKind.Class); -CTagKinMapping.set('_subroutine', vscode.SymbolKind.Method); -CTagKinMapping.set('_subroutines', vscode.SymbolKind.Method); -CTagKinMapping.set('_types', vscode.SymbolKind.Class); -CTagKinMapping.set('_programs', vscode.SymbolKind.Class); -CTagKinMapping.set("_Object's method", vscode.SymbolKind.Method); -CTagKinMapping.set('_Module or functor', vscode.SymbolKind.Module); -CTagKinMapping.set('_Global variable', vscode.SymbolKind.Variable); -CTagKinMapping.set('_Type name', vscode.SymbolKind.Class); -CTagKinMapping.set('_A function', vscode.SymbolKind.Function); -CTagKinMapping.set('_A constructor', vscode.SymbolKind.Constructor); -CTagKinMapping.set('_An exception', vscode.SymbolKind.Class); -CTagKinMapping.set("_A 'structure' field", vscode.SymbolKind.Field); -CTagKinMapping.set('_procedure', vscode.SymbolKind.Function); -CTagKinMapping.set('_procedures', vscode.SymbolKind.Function); -CTagKinMapping.set('_constant definitions', vscode.SymbolKind.Constant); -CTagKinMapping.set('_javascript functions', vscode.SymbolKind.Function); -CTagKinMapping.set('_singleton methods', vscode.SymbolKind.Method); - -const newValuesAndKeys = {}; -CTagKinMapping.forEach((value, key) => { - (newValuesAndKeys as any)[key.substring(1)] = value; -}); -Object.keys(newValuesAndKeys).forEach((key) => { - CTagKinMapping.set(key, (newValuesAndKeys as any)[key]); -}); - -export function parseTags( - workspaceFolder: string, - tagFile: string, - query: string, - token: vscode.CancellationToken, - fs: IFileSystem, -): Promise { - return fs.fileExists(tagFile).then((exists) => { - if (!exists) { - return Promise.resolve([]); - } - - return new Promise((resolve, reject) => { - const lr = new LineByLineReader(tagFile); - let lineNumber = 0; - const tags: ITag[] = []; - - lr.on('error', (err: Error) => { - reject(err); - }); - - lr.on('line', (line: string) => { - lineNumber = lineNumber + 1; - if (token.isCancellationRequested) { - lr.close(); - return; - } - const tag = parseTagsLine(workspaceFolder, line, query); - if (tag) { - tags.push(tag); - } - if (tags.length >= 100) { - lr.close(); - } - }); - - lr.on('end', () => { - resolve(tags); - }); - }); - }); -} -function parseTagsLine(workspaceFolder: string, line: string, searchPattern: string): ITag | undefined { - if (IsFileRegEx.test(line)) { - return; - } - const match = matchNamedRegEx(line, LINE_REGEX); - if (!match) { - return; - } - if (!fuzzy.test(searchPattern, match.name)) { - return; - } - let file = match.file; - if (!path.isAbsolute(file)) { - file = path.resolve(workspaceFolder, '.vscode', file); - } - - const symbolKind = CTagKinMapping.get(match.type) || vscode.SymbolKind.Null; - return { - fileName: file, - code: match.code, - position: new vscode.Position(Number(match.line) - 1, 0), - symbolName: match.name, - symbolKind: symbolKind, - }; -} diff --git a/src/client/workspaceSymbols/provider.ts b/src/client/workspaceSymbols/provider.ts deleted file mode 100644 index 7fa6c2e1d0d6..000000000000 --- a/src/client/workspaceSymbols/provider.ts +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -const flatten = require('lodash/flatten') as typeof import('lodash/flatten'); -import { - CancellationToken, - Location, - SymbolInformation, - Uri, - WorkspaceSymbolProvider as IWorspaceSymbolProvider, -} from 'vscode'; -import { ICommandManager } from '../common/application/types'; -import { Commands } from '../common/constants'; -import { IFileSystem } from '../common/platform/types'; -import { captureTelemetry } from '../telemetry'; -import { EventName } from '../telemetry/constants'; -import { Generator } from './generator'; -import { parseTags } from './parser'; - -export class WorkspaceSymbolProvider implements IWorspaceSymbolProvider { - public constructor( - private fs: IFileSystem, - private commands: ICommandManager, - private tagGenerators: Generator[], - ) {} - - @captureTelemetry(EventName.WORKSPACE_SYMBOLS_GO_TO) - public async provideWorkspaceSymbols(query: string, token: CancellationToken): Promise { - if (this.tagGenerators.length === 0) { - return []; - } - const generatorsWithTagFiles = await Promise.all( - this.tagGenerators.map((generator) => this.fs.fileExists(generator.tagFilePath)), - ); - if (generatorsWithTagFiles.filter((exists) => exists).length !== this.tagGenerators.length) { - await this.commands.executeCommand(Commands.Build_Workspace_Symbols, true, token); - } - - const generators: Generator[] = []; - await Promise.all( - this.tagGenerators.map(async (generator) => { - if (await this.fs.fileExists(generator.tagFilePath)) { - generators.push(generator); - } - }), - ); - - const promises = generators - .filter((generator) => generator !== undefined && generator.enabled) - .map(async (generator) => { - // load tags - const items = await parseTags( - generator!.workspaceFolder.fsPath, - generator!.tagFilePath, - query, - token, - this.fs, - ); - if (!Array.isArray(items)) { - return []; - } - return items.map( - (item) => - new SymbolInformation( - item.symbolName, - item.symbolKind, - '', - new Location(Uri.file(item.fileName), item.position), - ), - ); - }); - - const symbols = await Promise.all(promises); - return flatten(symbols); - } -} diff --git a/src/test/.vscode/.ropeproject/config.py b/src/test/.vscode/.ropeproject/config.py new file mode 100644 index 000000000000..dee2d1ae9a6b --- /dev/null +++ b/src/test/.vscode/.ropeproject/config.py @@ -0,0 +1,114 @@ +# The default ``config.py`` +# flake8: noqa + + +def set_prefs(prefs): + """This function is called before opening the project""" + + # Specify which files and folders to ignore in the project. + # Changes to ignored resources are not added to the history and + # VCSs. Also they are not returned in `Project.get_files()`. + # Note that ``?`` and ``*`` match all characters but slashes. + # '*.pyc': matches 'test.pyc' and 'pkg/test.pyc' + # 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc' + # '.svn': matches 'pkg/.svn' and all of its children + # 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o' + # 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o' + prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject', + '.hg', '.svn', '_svn', '.git', '.tox'] + + # Specifies which files should be considered python files. It is + # useful when you have scripts inside your project. Only files + # ending with ``.py`` are considered to be python files by + # default. + # prefs['python_files'] = ['*.py'] + + # Custom source folders: By default rope searches the project + # for finding source folders (folders that should be searched + # for finding modules). You can add paths to that list. Note + # that rope guesses project source folders correctly most of the + # time; use this if you have any problems. + # The folders should be relative to project root and use '/' for + # separating folders regardless of the platform rope is running on. + # 'src/my_source_folder' for instance. + # prefs.add('source_folders', 'src') + + # You can extend python path for looking up modules + # prefs.add('python_path', '~/python/') + + # Should rope save object information or not. + prefs['save_objectdb'] = True + prefs['compress_objectdb'] = False + + # If `True`, rope analyzes each module when it is being saved. + prefs['automatic_soa'] = True + # The depth of calls to follow in static object analysis + prefs['soa_followed_calls'] = 0 + + # If `False` when running modules or unit tests "dynamic object + # analysis" is turned off. This makes them much faster. + prefs['perform_doa'] = True + + # Rope can check the validity of its object DB when running. + prefs['validate_objectdb'] = True + + # How many undos to hold? + prefs['max_history_items'] = 32 + + # Shows whether to save history across sessions. + prefs['save_history'] = True + prefs['compress_history'] = False + + # Set the number spaces used for indenting. According to + # :PEP:`8`, it is best to use 4 spaces. Since most of rope's + # unit-tests use 4 spaces it is more reliable, too. + prefs['indent_size'] = 4 + + # Builtin and c-extension modules that are allowed to be imported + # and inspected by rope. + prefs['extension_modules'] = [] + + # Add all standard c-extensions to extension_modules list. + prefs['import_dynload_stdmods'] = True + + # If `True` modules with syntax errors are considered to be empty. + # The default value is `False`; When `False` syntax errors raise + # `rope.base.exceptions.ModuleSyntaxError` exception. + prefs['ignore_syntax_errors'] = False + + # If `True`, rope ignores unresolvable imports. Otherwise, they + # appear in the importing namespace. + prefs['ignore_bad_imports'] = False + + # If `True`, rope will insert new module imports as + # `from import ` by default. + prefs['prefer_module_from_imports'] = False + + # If `True`, rope will transform a comma list of imports into + # multiple separate import statements when organizing + # imports. + prefs['split_imports'] = False + + # If `True`, rope will remove all top-level import statements and + # reinsert them at the top of the module when making changes. + prefs['pull_imports_to_top'] = True + + # If `True`, rope will sort imports alphabetically by module name instead + # of alphabetically by import statement, with from imports after normal + # imports. + prefs['sort_imports_alphabetically'] = False + + # Location of implementation of + # rope.base.oi.type_hinting.interfaces.ITypeHintingFactory In general + # case, you don't have to change this value, unless you're an rope expert. + # Change this value to inject you own implementations of interfaces + # listed in module rope.base.oi.type_hinting.providers.interfaces + # For example, you can add you own providers for Django Models, or disable + # the search type-hinting in a class hierarchy, etc. + prefs['type_hinting_factory'] = ( + 'rope.base.oi.type_hinting.factory.default_type_hinting_factory') + + +def project_opened(project): + """This function is called after opening the project""" + # Do whatever you like here! diff --git a/src/test/.vscode/.ropeproject/objectdb b/src/test/.vscode/.ropeproject/objectdb new file mode 100644 index 000000000000..0a47446c0ad2 Binary files /dev/null and b/src/test/.vscode/.ropeproject/objectdb differ diff --git a/src/test/.vscode/settings.json b/src/test/.vscode/settings.json index c0a63dea1b93..6c96e3a507b2 100644 --- a/src/test/.vscode/settings.json +++ b/src/test/.vscode/settings.json @@ -1,7 +1,6 @@ { "python.linting.pylintEnabled": false, "python.linting.flake8Enabled": false, - "python.workspaceSymbols.enabled": false, "python.testing.pytestArgs": [], "python.testing.unittestArgs": ["-s=./tests", "-p=test_*.py", "-v", "-s", ".", "-p", "*test*.py"], "python.sortImports.args": [], @@ -17,5 +16,6 @@ // Do not set this to "Microsoft", else it will result in LS being downloaded on CI // and that slows down tests significantly. We have other tests on CI for testing // downloading of LS with this setting enabled. - "python.languageServer": "Jedi" + "python.languageServer": "Jedi", + "python.pythonPath": "C:\\GIT\\s p\\vscode-python\\.venv\\Scripts\\python.exe" } diff --git a/src/test/.vscode/tags b/src/test/.vscode/tags deleted file mode 100644 index e4dc3f827c89..000000000000 --- a/src/test/.vscode/tags +++ /dev/null @@ -1,721 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ -!_TAG_PROGRAM_AUTHOR Universal Ctags Team // -!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ -!_TAG_PROGRAM_URL https://ctags.io/ /official site/ -!_TAG_PROGRAM_VERSION 0.0.0 /f9e6e3c1/ -A ..\\pythonFiles\\autocomp\\pep526.py /^class A:$/;" kind:class line:13 -A ..\\pythonFiles\\definition\\await.test.py /^class A:$/;" kind:class line:3 -B ..\\pythonFiles\\autocomp\\pep526.py /^class B:$/;" kind:class line:17 -B ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^class B(Exception):$/;" kind:class line:19 -B ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^class B(Exception):$/;" kind:class line:19 -B ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^class B(Exception):$/;" kind:class line:19 -BaseRefactoring ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^class BaseRefactoring(object):$/;" kind:class line:54 -BoundedQueue ..\\pythonFiles\\autocomp\\misc.py /^ class BoundedQueue(_Verbose):$/;" kind:class line:1250 -BoundedSemaphore ..\\pythonFiles\\autocomp\\misc.py /^def BoundedSemaphore(*args, **kwargs):$/;" kind:function line:497 -C ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^class C(B):$/;" kind:class line:22 -C ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^class C(B):$/;" kind:class line:22 -C ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^class C(B):$/;" kind:class line:22 -Change ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^class Change():$/;" kind:class line:41 -ChangeType ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^class ChangeType():$/;" kind:class line:32 -Child2Class ..\\pythonFiles\\symbolFiles\\childFile.py /^class Child2Class(object):$/;" kind:class line:5 -Class1 ..\\pythonFiles\\autocomp\\one.py /^class Class1(object):$/;" kind:class line:6 -Class1 ..\\pythonFiles\\definition\\one.py /^class Class1(object):$/;" kind:class line:6 -Condition ..\\pythonFiles\\autocomp\\misc.py /^def Condition(*args, **kwargs):$/;" kind:function line:242 -ConsumerThread ..\\pythonFiles\\autocomp\\misc.py /^ class ConsumerThread(Thread):$/;" kind:class line:1298 -D ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^class D(C):$/;" kind:class line:25 -D ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^class D(C):$/;" kind:class line:25 -D ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^class D(C):$/;" kind:class line:25 -DELETE ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ DELETE = 2$/;" kind:variable line:38 -DELETE ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ DELETE = 2$/;" kind:variable line:46 -Decorator ..\\pythonFiles\\autocomp\\deco.py /^class Decorator(metaclass=abc.ABCMeta):$/;" kind:class line:3 -DoSomething ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^class DoSomething():$/;" kind:class line:200 -DoSomething ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^class DoSomething():$/;" kind:class line:200 -DoSomething ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^class DoSomething():$/;" kind:class line:200 -EDIT ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ EDIT = 0$/;" kind:variable line:36 -EDIT ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ EDIT = 0$/;" kind:variable line:44 -Event ..\\pythonFiles\\autocomp\\misc.py /^def Event(*args, **kwargs):$/;" kind:function line:542 -Example3 ..\\pythonFiles\\formatting\\fileToFormat.py /^class Example3( object ):$/;" kind:class line:12 -ExtractMethodRefactor ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^class ExtractMethodRefactor(ExtractVariableRefactor):$/;" kind:class line:144 -ExtractVariableRefactor ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^class ExtractVariableRefactor(BaseRefactoring):$/;" kind:class line:120 -Foo ..\\multiRootWkspc\\disableLinters\\file.py /^class Foo(object):$/;" kind:class line:5 -Foo ..\\multiRootWkspc\\parent\\child\\file.py /^class Foo(object):$/;" kind:class line:5 -Foo ..\\multiRootWkspc\\workspace1\\file.py /^class Foo(object):$/;" kind:class line:5 -Foo ..\\multiRootWkspc\\workspace2\\file.py /^class Foo(object):$/;" kind:class line:5 -Foo ..\\multiRootWkspc\\workspace3\\file.py /^class Foo(object):$/;" kind:class line:5 -Foo ..\\pythonFiles\\autocomp\\four.py /^class Foo(object):$/;" kind:class line:7 -Foo ..\\pythonFiles\\definition\\four.py /^class Foo(object):$/;" kind:class line:7 -Foo ..\\pythonFiles\\linting\\file.py /^class Foo(object):$/;" kind:class line:5 -Foo ..\\pythonFiles\\linting\\flake8config\\file.py /^class Foo(object):$/;" kind:class line:5 -Foo ..\\pythonFiles\\linting\\pycodestyleconfig\\file.py /^class Foo(object):$/;" kind:class line:5 -Foo ..\\pythonFiles\\linting\\pydocstyleconfig27\\file.py /^class Foo(object):$/;" kind:class line:5 -Foo ..\\pythonFiles\\linting\\pylintconfig\\file.py /^class Foo(object):$/;" kind:class line:5 -Foo ..\\pythonFiles\\symbolFiles\\file.py /^class Foo(object):$/;" kind:class line:5 -Gaussian ..\\pythonFiles\\jupyter\\cells.py /^class Gaussian(object):$/;" kind:class line:100 -Lock ..\\pythonFiles\\autocomp\\misc.py /^Lock = _allocate_lock$/;" kind:variable line:112 -N ..\\pythonFiles\\jupyter\\cells.py /^N = 50$/;" kind:variable line:42 -NEW ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ NEW = 1$/;" kind:variable line:37 -NEW ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ NEW = 1$/;" kind:variable line:45 -PEP_484_style ..\\pythonFiles\\autocomp\\pep526.py /^PEP_484_style = SOMETHING # type: str$/;" kind:variable line:5 -PEP_526_style ..\\pythonFiles\\autocomp\\pep526.py /^PEP_526_style: str = "hello world"$/;" kind:variable line:3 -ProducerThread ..\\pythonFiles\\autocomp\\misc.py /^ class ProducerThread(Thread):$/;" kind:class line:1282 -RLock ..\\pythonFiles\\autocomp\\misc.py /^def RLock(*args, **kwargs):$/;" kind:function line:114 -ROPE_PROJECT_FOLDER ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ROPE_PROJECT_FOLDER = sys.argv[2]$/;" kind:variable line:18 -ROPE_PROJECT_FOLDER ..\\pythonFiles\\sorting\\noconfig\\after.py /^ROPE_PROJECT_FOLDER = sys.argv[2]$/;" kind:variable line:12 -ROPE_PROJECT_FOLDER ..\\pythonFiles\\sorting\\noconfig\\before.py /^ROPE_PROJECT_FOLDER = sys.argv[2]$/;" kind:variable line:9 -ROPE_PROJECT_FOLDER ..\\pythonFiles\\sorting\\noconfig\\original.py /^ROPE_PROJECT_FOLDER = sys.argv[2]$/;" kind:variable line:9 -Random ..\\pythonFiles\\autocomp\\misc.py /^class Random(_random.Random):$/;" kind:class line:1331 -RefactorProgress ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^class RefactorProgress():$/;" kind:class line:21 -RenameRefactor ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^class RenameRefactor(BaseRefactoring):$/;" kind:class line:101 -RopeRefactoring ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^class RopeRefactoring(object):$/;" kind:class line:162 -Semaphore ..\\pythonFiles\\autocomp\\misc.py /^def Semaphore(*args, **kwargs):$/;" kind:function line:412 -TOOLS ..\\pythonFiles\\jupyter\\cells.py /^TOOLS = "pan,wheel_zoom,box_zoom,reset,save,box_select"$/;" kind:variable line:68 -Test_CheckMyApp ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^class Test_CheckMyApp:$/;" kind:class line:6 -Test_CheckMyApp ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^class Test_CheckMyApp:$/;" kind:class line:6 -Test_CheckMyApp ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^class Test_CheckMyApp:$/;" kind:class line:6 -Test_Current_Working_Directory ..\\pythonFiles\\testFiles\\cwd\\src\\tests\\test_cwd.py /^class Test_Current_Working_Directory(unittest.TestCase):$/;" kind:class line:6 -Test_NestedClassA ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^ class Test_NestedClassA:$/;" kind:class line:13 -Test_NestedClassA ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^ class Test_NestedClassA:$/;" kind:class line:13 -Test_NestedClassA ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^ class Test_NestedClassA:$/;" kind:class line:13 -Test_Root_test1 ..\\pythonFiles\\testFiles\\single\\test_root.py /^class Test_Root_test1(unittest.TestCase):$/;" kind:class line:6 -Test_Root_test1 ..\\pythonFiles\\testFiles\\standard\\test_root.py /^class Test_Root_test1(unittest.TestCase):$/;" kind:class line:6 -Test_Root_test1 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\test_root.py /^class Test_Root_test1(unittest.TestCase):$/;" kind:class line:6 -Test_nested_classB_Of_A ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^ class Test_nested_classB_Of_A:$/;" kind:class line:16 -Test_nested_classB_Of_A ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^ class Test_nested_classB_Of_A:$/;" kind:class line:16 -Test_nested_classB_Of_A ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^ class Test_nested_classB_Of_A:$/;" kind:class line:16 -Test_test1 ..\\pythonFiles\\testFiles\\single\\tests\\test_one.py /^class Test_test1(unittest.TestCase):$/;" kind:class line:6 -Test_test1 ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_one.py /^class Test_test1(unittest.TestCase):$/;" kind:class line:6 -Test_test1 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_unittest_one.py /^class Test_test1(unittest.TestCase):$/;" kind:class line:6 -Test_test1 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_one.py /^class Test_test1(unittest.TestCase):$/;" kind:class line:6 -Test_test2 ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_two.py /^class Test_test2(unittest.TestCase):$/;" kind:class line:3 -Test_test2 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_two.py /^class Test_test2(unittest.TestCase):$/;" kind:class line:3 -Test_test2a ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_two.py /^class Test_test2a(unittest.TestCase):$/;" kind:class line:17 -Test_test2a ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_two.py /^class Test_test2a(unittest.TestCase):$/;" kind:class line:17 -Test_test2a1 ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_two.py /^ class Test_test2a1(unittest.TestCase):$/;" kind:class line:24 -Test_test2a1 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_two.py /^ class Test_test2a1(unittest.TestCase):$/;" kind:class line:24 -Test_test3 ..\\pythonFiles\\testFiles\\standard\\tests\\unittest_three_test.py /^class Test_test3(unittest.TestCase):$/;" kind:class line:4 -Test_test3 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\unittest_three_test.py /^class Test_test3(unittest.TestCase):$/;" kind:class line:4 -Test_test_one_1 ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_one.py /^class Test_test_one_1(unittest.TestCase):$/;" kind:class line:3 -Test_test_one_2 ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_one.py /^class Test_test_one_2(unittest.TestCase):$/;" kind:class line:14 -Test_test_two_1 ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_two.py /^class Test_test_two_1(unittest.TestCase):$/;" kind:class line:3 -Test_test_two_2 ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_two.py /^class Test_test_two_2(unittest.TestCase):$/;" kind:class line:14 -Thread ..\\pythonFiles\\autocomp\\misc.py /^class Thread(_Verbose):$/;" kind:class line:640 -ThreadError ..\\pythonFiles\\autocomp\\misc.py /^ThreadError = thread.error$/;" kind:variable line:38 -Timer ..\\pythonFiles\\autocomp\\misc.py /^def Timer(*args, **kwargs):$/;" kind:function line:1046 -VERSION ..\\pythonFiles\\autocomp\\misc.py /^ VERSION = 3 # used by getstate\/setstate$/;" kind:variable line:1345 -WORKSPACE_ROOT ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^WORKSPACE_ROOT = sys.argv[1]$/;" kind:variable line:17 -WORKSPACE_ROOT ..\\pythonFiles\\sorting\\noconfig\\after.py /^WORKSPACE_ROOT = sys.argv[1]$/;" kind:variable line:11 -WORKSPACE_ROOT ..\\pythonFiles\\sorting\\noconfig\\before.py /^WORKSPACE_ROOT = sys.argv[1]$/;" kind:variable line:8 -WORKSPACE_ROOT ..\\pythonFiles\\sorting\\noconfig\\original.py /^WORKSPACE_ROOT = sys.argv[1]$/;" kind:variable line:8 -Workspace2Class ..\\pythonFiles\\symbolFiles\\workspace2File.py /^class Workspace2Class(object):$/;" kind:class line:5 -_BoundedSemaphore ..\\pythonFiles\\autocomp\\misc.py /^class _BoundedSemaphore(_Semaphore):$/;" kind:class line:515 -_Condition ..\\pythonFiles\\autocomp\\misc.py /^class _Condition(_Verbose):$/;" kind:class line:255 -_DummyThread ..\\pythonFiles\\autocomp\\misc.py /^class _DummyThread(Thread):$/;" kind:class line:1128 -_Event ..\\pythonFiles\\autocomp\\misc.py /^class _Event(_Verbose):$/;" kind:class line:552 -_MainThread ..\\pythonFiles\\autocomp\\misc.py /^class _MainThread(Thread):$/;" kind:class line:1088 -_RLock ..\\pythonFiles\\autocomp\\misc.py /^class _RLock(_Verbose):$/;" kind:class line:125 -_Semaphore ..\\pythonFiles\\autocomp\\misc.py /^class _Semaphore(_Verbose):$/;" kind:class line:423 -_Timer ..\\pythonFiles\\autocomp\\misc.py /^class _Timer(Thread):$/;" kind:class line:1058 -_VERBOSE ..\\pythonFiles\\autocomp\\misc.py /^_VERBOSE = False$/;" kind:variable line:53 -_Verbose ..\\pythonFiles\\autocomp\\misc.py /^ class _Verbose(object):$/;" kind:class line:57 -_Verbose ..\\pythonFiles\\autocomp\\misc.py /^ class _Verbose(object):$/;" kind:class line:79 -__all__ ..\\pythonFiles\\autocomp\\misc.py /^__all__ = ['activeCount', 'active_count', 'Condition', 'currentThread',$/;" kind:variable line:30 -__bootstrap ..\\pythonFiles\\autocomp\\misc.py /^ def __bootstrap(self):$/;" kind:member line:769 -__bootstrap_inner ..\\pythonFiles\\autocomp\\misc.py /^ def __bootstrap_inner(self):$/;" kind:member line:792 -__delete ..\\pythonFiles\\autocomp\\misc.py /^ def __delete(self):$/;" kind:member line:876 -__enter__ ..\\pythonFiles\\autocomp\\misc.py /^ __enter__ = acquire$/;" kind:variable line:185 -__enter__ ..\\pythonFiles\\autocomp\\misc.py /^ __enter__ = acquire$/;" kind:variable line:477 -__enter__ ..\\pythonFiles\\autocomp\\misc.py /^ def __enter__(self):$/;" kind:member line:285 -__exc_clear ..\\pythonFiles\\autocomp\\misc.py /^ __exc_clear = _sys.exc_clear$/;" kind:variable line:654 -__exc_info ..\\pythonFiles\\autocomp\\misc.py /^ __exc_info = _sys.exc_info$/;" kind:variable line:651 -__exit__ ..\\pythonFiles\\autocomp\\misc.py /^ def __exit__(self, *args):$/;" kind:member line:288 -__exit__ ..\\pythonFiles\\autocomp\\misc.py /^ def __exit__(self, t, v, tb):$/;" kind:member line:215 -__exit__ ..\\pythonFiles\\autocomp\\misc.py /^ def __exit__(self, t, v, tb):$/;" kind:member line:493 -__getstate__ ..\\pythonFiles\\autocomp\\misc.py /^ def __getstate__(self): # for pickle$/;" kind:member line:1422 -__init__ ..\\multiRootWkspc\\disableLinters\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\multiRootWkspc\\parent\\child\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\multiRootWkspc\\workspace1\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\multiRootWkspc\\workspace2\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\multiRootWkspc\\workspace3\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, limit):$/;" kind:member line:1252 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, queue, count):$/;" kind:member line:1300 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, queue, quota):$/;" kind:member line:1284 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, verbose=None):$/;" kind:member line:59 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, verbose=None):$/;" kind:member line:80 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self):$/;" kind:member line:1090 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self):$/;" kind:member line:1130 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, group=None, target=None, name=None,$/;" kind:member line:656 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, interval, function, args=[], kwargs={}):$/;" kind:member line:1067 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, lock=None, verbose=None):$/;" kind:member line:260 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, value=1, verbose=None):$/;" kind:member line:433 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, value=1, verbose=None):$/;" kind:member line:521 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, verbose=None):$/;" kind:member line:132 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, verbose=None):$/;" kind:member line:561 -__init__ ..\\pythonFiles\\autocomp\\misc.py /^ def __init__(self, x=None):$/;" kind:member line:1347 -__init__ ..\\pythonFiles\\autocomp\\one.py /^ def __init__(self, file_path=None, file_contents=None):$/;" kind:member line:14 -__init__ ..\\pythonFiles\\definition\\await.test.py /^ def __init__(self):$/;" kind:member line:4 -__init__ ..\\pythonFiles\\definition\\one.py /^ def __init__(self, file_path=None, file_contents=None):$/;" kind:member line:14 -__init__ ..\\pythonFiles\\formatting\\fileToFormat.py /^ def __init__ ( self, bar ):$/;" kind:member line:13 -__init__ ..\\pythonFiles\\jupyter\\cells.py /^ def __init__(self, mean=0.0, std=1, size=1000):$/;" kind:member line:104 -__init__ ..\\pythonFiles\\linting\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\pythonFiles\\linting\\flake8config\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\pythonFiles\\linting\\pycodestyleconfig\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\pythonFiles\\linting\\pydocstyleconfig27\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\pythonFiles\\linting\\pylintconfig\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def __init__(self):$/;" kind:member line:164 -__init__ ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def __init__(self, filePath, fileMode=ChangeType.EDIT, diff=""):$/;" kind:member line:48 -__init__ ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def __init__(self, name='Task Name', message=None, percent=0):$/;" kind:member line:26 -__init__ ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def __init__(self, project, resource, name="Extract Method", progressCallback=None, startOff/;" kind:member line:146 -__init__ ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def __init__(self, project, resource, name="Extract Variable", progressCallback=None, startO/;" kind:member line:122 -__init__ ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def __init__(self, project, resource, name="Refactor", progressCallback=None):$/;" kind:member line:59 -__init__ ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def __init__(self, project, resource, name="Rename", progressCallback=None, startOffset=None/;" kind:member line:103 -__init__ ..\\pythonFiles\\symbolFiles\\childFile.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\pythonFiles\\symbolFiles\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\pythonFiles\\symbolFiles\\workspace2File.py /^ def __init__(self):$/;" kind:member line:8 -__init__.py ..\\pythonFiles\\autoimport\\two\\__init__.py 1;" kind:file line:1 -__initialized ..\\pythonFiles\\autocomp\\misc.py /^ __initialized = False$/;" kind:variable line:646 -__reduce__ ..\\pythonFiles\\autocomp\\misc.py /^ def __reduce__(self):$/;" kind:member line:1428 -__repr__ ..\\pythonFiles\\autocomp\\misc.py /^ def __repr__(self):$/;" kind:member line:138 -__repr__ ..\\pythonFiles\\autocomp\\misc.py /^ def __repr__(self):$/;" kind:member line:291 -__repr__ ..\\pythonFiles\\autocomp\\misc.py /^ def __repr__(self):$/;" kind:member line:713 -__revision__ ..\\multiRootWkspc\\disableLinters\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\multiRootWkspc\\parent\\child\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\multiRootWkspc\\workspace1\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\multiRootWkspc\\workspace2\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\multiRootWkspc\\workspace3\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\pythonFiles\\linting\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\pythonFiles\\linting\\flake8config\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\pythonFiles\\linting\\pycodestyleconfig\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\pythonFiles\\linting\\pydocstyleconfig27\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\pythonFiles\\linting\\pylintconfig\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\pythonFiles\\symbolFiles\\childFile.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\pythonFiles\\symbolFiles\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\pythonFiles\\symbolFiles\\workspace2File.py /^__revision__ = None$/;" kind:variable line:3 -__setstate__ ..\\pythonFiles\\autocomp\\misc.py /^ def __setstate__(self, state): # for pickle$/;" kind:member line:1425 -__stop ..\\pythonFiles\\autocomp\\misc.py /^ def __stop(self):$/;" kind:member line:866 -_acquire_restore ..\\pythonFiles\\autocomp\\misc.py /^ def _acquire_restore(self, count_owner):$/;" kind:member line:220 -_acquire_restore ..\\pythonFiles\\autocomp\\misc.py /^ def _acquire_restore(self, x):$/;" kind:member line:297 -_active ..\\pythonFiles\\autocomp\\misc.py /^_active = {} # maps thread id to Thread object$/;" kind:variable line:634 -_active_limbo_lock ..\\pythonFiles\\autocomp\\misc.py /^_active_limbo_lock = _allocate_lock()$/;" kind:variable line:633 -_after_fork ..\\pythonFiles\\autocomp\\misc.py /^def _after_fork():$/;" kind:function line:1211 -_allocate_lock ..\\pythonFiles\\autocomp\\misc.py /^_allocate_lock = thread.allocate_lock$/;" kind:variable line:36 -_block ..\\pythonFiles\\autocomp\\misc.py /^ def _block(self):$/;" kind:member line:705 -_count ..\\pythonFiles\\autocomp\\misc.py /^from itertools import count as _count$/;" kind:unknown line:14 -_counter ..\\pythonFiles\\autocomp\\misc.py /^_counter = _count().next$/;" kind:variable line:627 -_deque ..\\pythonFiles\\autocomp\\misc.py /^from collections import deque as _deque$/;" kind:unknown line:13 -_deserialize ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def _deserialize(self, request):$/;" kind:member line:204 -_enumerate ..\\pythonFiles\\autocomp\\misc.py /^def _enumerate():$/;" kind:function line:1179 -_exitfunc ..\\pythonFiles\\autocomp\\misc.py /^ def _exitfunc(self):$/;" kind:member line:1100 -_extractMethod ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def _extractMethod(self, filePath, start, end, newName):$/;" kind:member line:183 -_extractVariable ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def _extractVariable(self, filePath, start, end, newName):$/;" kind:member line:168 -_figure_data ..\\pythonFiles\\jupyter\\cells.py /^ def _figure_data(self, format):$/;" kind:member line:112 -_format_exc ..\\pythonFiles\\autocomp\\misc.py /^from traceback import format_exc as _format_exc$/;" kind:unknown line:16 -_get_ident ..\\pythonFiles\\autocomp\\misc.py /^_get_ident = thread.get_ident$/;" kind:variable line:37 -_is_owned ..\\pythonFiles\\autocomp\\misc.py /^ def _is_owned(self):$/;" kind:member line:238 -_is_owned ..\\pythonFiles\\autocomp\\misc.py /^ def _is_owned(self):$/;" kind:member line:300 -_limbo ..\\pythonFiles\\autocomp\\misc.py /^_limbo = {}$/;" kind:variable line:635 -_newname ..\\pythonFiles\\autocomp\\misc.py /^def _newname(template="Thread-%d"):$/;" kind:function line:629 -_note ..\\pythonFiles\\autocomp\\misc.py /^ def _note(self, *args):$/;" kind:member line:82 -_note ..\\pythonFiles\\autocomp\\misc.py /^ def _note(self, format, *args):$/;" kind:member line:64 -_pickSomeNonDaemonThread ..\\pythonFiles\\autocomp\\misc.py /^def _pickSomeNonDaemonThread():$/;" kind:function line:1113 -_process_request ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def _process_request(self, request):$/;" kind:member line:215 -_profile_hook ..\\pythonFiles\\autocomp\\misc.py /^_profile_hook = None$/;" kind:variable line:87 -_randbelow ..\\pythonFiles\\autocomp\\misc.py /^ def _randbelow(self, n, int=int, maxsize=1< int:$/;" kind:function line:6 -after.py ..\\pythonFiles\\sorting\\noconfig\\after.py 1;" kind:file line:1 -after.py ..\\pythonFiles\\sorting\\withconfig\\after.py 1;" kind:file line:1 -ask_ok ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^ def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):$/;" kind:member line:263 -ask_ok ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):$/;" kind:function line:124 -ask_ok ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^ def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):$/;" kind:member line:263 -ask_ok ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):$/;" kind:function line:124 -ask_ok ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^ def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):$/;" kind:member line:263 -ask_ok ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):$/;" kind:function line:124 -await.test.py ..\\pythonFiles\\definition\\await.test.py 1;" kind:file line:1 -ax ..\\pythonFiles\\jupyter\\cells.py /^fig, ax = plt.subplots(subplot_kw=dict(axisbg='#EEEEEE'))$/;" kind:variable line:39 -b ..\\pythonFiles\\autocomp\\pep526.py /^ b: int = 0$/;" kind:variable line:18 -b ..\\pythonFiles\\typeFormatFiles\\elseBlocksFirstLine2.py /^ b = 3$/;" kind:variable line:3 -b ..\\pythonFiles\\typeFormatFiles\\elseBlocksFirstLine4.py /^ b = 3$/;" kind:variable line:3 -b ..\\pythonFiles\\typeFormatFiles\\elseBlocksFirstLineTab.py /^ b = 3$/;" kind:variable line:3 -bar ..\\pythonFiles\\autocomp\\four.py /^ def bar():$/;" kind:member line:11 -bar ..\\pythonFiles\\definition\\four.py /^ def bar():$/;" kind:member line:11 -before.1.py ..\\pythonFiles\\sorting\\withconfig\\before.1.py 1;" kind:file line:1 -before.py ..\\pythonFiles\\sorting\\noconfig\\before.py 1;" kind:file line:1 -before.py ..\\pythonFiles\\sorting\\withconfig\\before.py 1;" kind:file line:1 -betavariate ..\\pythonFiles\\autocomp\\misc.py /^ def betavariate(self, alpha, beta):$/;" kind:member line:1862 -calculate_cash_flows ..\\pythonFiles\\definition\\decorators.py /^def calculate_cash_flows(remaining_loan_term, remaining_io_term,$/;" kind:function line:20 -cancel ..\\pythonFiles\\autocomp\\misc.py /^ def cancel(self):$/;" kind:member line:1075 -cells.py ..\\pythonFiles\\jupyter\\cells.py 1;" kind:file line:1 -childFile.py ..\\pythonFiles\\symbolFiles\\childFile.py 1;" kind:file line:1 -choice ..\\pythonFiles\\autocomp\\misc.py /^ def choice(self, seq):$/;" kind:member line:1513 -clear ..\\pythonFiles\\autocomp\\misc.py /^ def clear(self):$/;" kind:member line:590 -content ..\\pythonFiles\\autocomp\\doc.py /^ content = line.upper()$/;" kind:variable line:6 -ct ..\\pythonFiles\\autocomp\\two.py /^class ct:$/;" kind:class line:1 -ct ..\\pythonFiles\\definition\\two.py /^class ct:$/;" kind:class line:1 -currentThread ..\\pythonFiles\\autocomp\\misc.py /^def currentThread():$/;" kind:function line:1152 -current_thread ..\\pythonFiles\\autocomp\\misc.py /^current_thread = currentThread$/;" kind:variable line:1165 -daemon ..\\pythonFiles\\autocomp\\misc.py /^ def daemon(self):$/;" kind:member line:1009 -daemon ..\\pythonFiles\\autocomp\\misc.py /^ def daemon(self, daemonic):$/;" kind:member line:1025 -deco.py ..\\pythonFiles\\autocomp\\deco.py 1;" kind:file line:1 -decorators.py ..\\pythonFiles\\definition\\decorators.py 1;" kind:file line:1 -description ..\\pythonFiles\\autocomp\\one.py /^ description = "Run isort on modules registered in setuptools"$/;" kind:variable line:11 -description ..\\pythonFiles\\definition\\one.py /^ description = "Run isort on modules registered in setuptools"$/;" kind:variable line:11 -df ..\\pythonFiles\\jupyter\\cells.py /^df = df.cumsum()$/;" kind:variable line:87 -df ..\\pythonFiles\\jupyter\\cells.py /^df = pd.DataFrame(np.random.randn(1000, 4), index=ts.index,$/;" kind:variable line:85 -divide ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^ def divide(x, y):$/;" kind:member line:329 -divide ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^def divide(x, y):$/;" kind:function line:190 -divide ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^ def divide(x, y):$/;" kind:member line:329 -divide ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^def divide(x, y):$/;" kind:function line:190 -divide ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^ def divide(x, y):$/;" kind:member line:329 -divide ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^def divide(x, y):$/;" kind:function line:190 -divide ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^def divide(x, y):$/;" kind:function line:188 -divide ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^def divide(x, y):$/;" kind:function line:199 -divide ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^def divide(x, y):$/;" kind:function line:188 -divide ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^def divide(x, y):$/;" kind:function line:199 -divide ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^def divide(x, y):$/;" kind:function line:188 -divide ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^def divide(x, y):$/;" kind:function line:199 -doc.py ..\\pythonFiles\\autocomp\\doc.py 1;" kind:file line:1 -dummy.py ..\\pythonFiles\\dummy.py 1;" kind:file line:1 -elseBlocks2.py ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py 1;" kind:file line:1 -elseBlocks4.py ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py 1;" kind:file line:1 -elseBlocksFirstLine2.py ..\\pythonFiles\\typeFormatFiles\\elseBlocksFirstLine2.py 1;" kind:file line:1 -elseBlocksFirstLine4.py ..\\pythonFiles\\typeFormatFiles\\elseBlocksFirstLine4.py 1;" kind:file line:1 -elseBlocksFirstLineTab.py ..\\pythonFiles\\typeFormatFiles\\elseBlocksFirstLineTab.py 1;" kind:file line:1 -elseBlocksTab.py ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py 1;" kind:file line:1 -enumerate ..\\pythonFiles\\autocomp\\misc.py /^def enumerate():$/;" kind:function line:1183 -example1 ..\\pythonFiles\\formatting\\fileToFormat.py /^def example1():$/;" kind:function line:3 -example2 ..\\pythonFiles\\formatting\\fileToFormat.py /^def example2(): return {'has_key() is deprecated':True}.has_key({'f':2}.has_key(''));$/;" kind:function line:11 -expovariate ..\\pythonFiles\\autocomp\\misc.py /^ def expovariate(self, lambd):$/;" kind:member line:1670 -fig ..\\pythonFiles\\jupyter\\cells.py /^fig, ax = plt.subplots(subplot_kw=dict(axisbg='#EEEEEE'))$/;" kind:variable line:39 -file.py ..\\multiRootWkspc\\disableLinters\\file.py 1;" kind:file line:1 -file.py ..\\multiRootWkspc\\parent\\child\\file.py 1;" kind:file line:1 -file.py ..\\multiRootWkspc\\workspace1\\file.py 1;" kind:file line:1 -file.py ..\\multiRootWkspc\\workspace2\\file.py 1;" kind:file line:1 -file.py ..\\multiRootWkspc\\workspace3\\file.py 1;" kind:file line:1 -file.py ..\\pythonFiles\\linting\\file.py 1;" kind:file line:1 -file.py ..\\pythonFiles\\linting\\flake8config\\file.py 1;" kind:file line:1 -file.py ..\\pythonFiles\\linting\\pycodestyleconfig\\file.py 1;" kind:file line:1 -file.py ..\\pythonFiles\\linting\\pydocstyleconfig27\\file.py 1;" kind:file line:1 -file.py ..\\pythonFiles\\linting\\pylintconfig\\file.py 1;" kind:file line:1 -file.py ..\\pythonFiles\\symbolFiles\\file.py 1;" kind:file line:1 -fileToFormat.py ..\\pythonFiles\\formatting\\fileToFormat.py 1;" kind:file line:1 -five.py ..\\pythonFiles\\autocomp\\five.py 1;" kind:file line:1 -five.py ..\\pythonFiles\\definition\\five.py 1;" kind:file line:1 -four.py ..\\pythonFiles\\autocomp\\four.py 1;" kind:file line:1 -four.py ..\\pythonFiles\\definition\\four.py 1;" kind:file line:1 -fun ..\\pythonFiles\\autocomp\\two.py /^ def fun():$/;" kind:member line:2 -fun ..\\pythonFiles\\definition\\two.py /^ def fun():$/;" kind:member line:2 -function1 ..\\pythonFiles\\definition\\one.py /^def function1():$/;" kind:function line:33 -function2 ..\\pythonFiles\\definition\\one.py /^def function2():$/;" kind:function line:37 -function3 ..\\pythonFiles\\definition\\one.py /^def function3():$/;" kind:function line:40 -function4 ..\\pythonFiles\\definition\\one.py /^def function4():$/;" kind:function line:43 -gammavariate ..\\pythonFiles\\autocomp\\misc.py /^ def gammavariate(self, alpha, beta):$/;" kind:member line:1737 -gauss ..\\pythonFiles\\autocomp\\misc.py /^ def gauss(self, mu, sigma):$/;" kind:member line:1809 -get ..\\pythonFiles\\autocomp\\misc.py /^ def get(self):$/;" kind:member line:1271 -getName ..\\pythonFiles\\autocomp\\misc.py /^ def getName(self):$/;" kind:member line:1038 -getstate ..\\pythonFiles\\autocomp\\misc.py /^ def getstate(self):$/;" kind:member line:1388 -greeting ..\\pythonFiles\\autocomp\\pep484.py /^def greeting(name: str) -> str:$/;" kind:function line:2 -hoverTest.py ..\\pythonFiles\\autocomp\\hoverTest.py 1;" kind:file line:1 -ident ..\\pythonFiles\\autocomp\\misc.py /^ def ident(self):$/;" kind:member line:984 -identity ..\\pythonFiles\\definition\\decorators.py /^def identity(ob):$/;" kind:function line:1 -imp.py ..\\pythonFiles\\autocomp\\imp.py 1;" kind:file line:1 -instant_print ..\\pythonFiles\\autocomp\\lamb.py /^instant_print = lambda x: [print(x), sys.stdout.flush(), sys.stderr.flush()]$/;" kind:function line:1 -isAlive ..\\pythonFiles\\autocomp\\misc.py /^ def isAlive(self):$/;" kind:member line:995 -isDaemon ..\\pythonFiles\\autocomp\\misc.py /^ def isDaemon(self):$/;" kind:member line:1032 -isSet ..\\pythonFiles\\autocomp\\misc.py /^ def isSet(self):$/;" kind:member line:570 -is_alive ..\\pythonFiles\\autocomp\\misc.py /^ is_alive = isAlive$/;" kind:variable line:1006 -is_set ..\\pythonFiles\\autocomp\\misc.py /^ is_set = isSet$/;" kind:variable line:574 -join ..\\pythonFiles\\autocomp\\misc.py /^ def join(self, timeout=None):$/;" kind:member line:1146 -join ..\\pythonFiles\\autocomp\\misc.py /^ def join(self, timeout=None):$/;" kind:member line:911 -lamb.py ..\\pythonFiles\\autocomp\\lamb.py 1;" kind:file line:1 -local ..\\pythonFiles\\autocomp\\misc.py /^ from thread import _local as local$/;" kind:unknown line:1206 -lognormvariate ..\\pythonFiles\\autocomp\\misc.py /^ def lognormvariate(self, mu, sigma):$/;" kind:member line:1658 -meth1 ..\\multiRootWkspc\\disableLinters\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1 ..\\multiRootWkspc\\parent\\child\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1 ..\\multiRootWkspc\\workspace1\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1 ..\\multiRootWkspc\\workspace2\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1 ..\\multiRootWkspc\\workspace3\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1 ..\\pythonFiles\\linting\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1 ..\\pythonFiles\\linting\\flake8config\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1 ..\\pythonFiles\\linting\\pycodestyleconfig\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1 ..\\pythonFiles\\linting\\pydocstyleconfig27\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1 ..\\pythonFiles\\linting\\pylintconfig\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1 ..\\pythonFiles\\symbolFiles\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1OfChild ..\\pythonFiles\\symbolFiles\\childFile.py /^ def meth1OfChild(self, arg):$/;" kind:member line:11 -meth1OfWorkspace2 ..\\pythonFiles\\symbolFiles\\workspace2File.py /^ def meth1OfWorkspace2(self, arg):$/;" kind:member line:11 -meth2 ..\\multiRootWkspc\\disableLinters\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth2 ..\\multiRootWkspc\\parent\\child\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth2 ..\\multiRootWkspc\\workspace1\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth2 ..\\multiRootWkspc\\workspace2\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth2 ..\\multiRootWkspc\\workspace3\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth2 ..\\pythonFiles\\linting\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth2 ..\\pythonFiles\\linting\\flake8config\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth2 ..\\pythonFiles\\linting\\pycodestyleconfig\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth2 ..\\pythonFiles\\linting\\pydocstyleconfig27\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth2 ..\\pythonFiles\\linting\\pylintconfig\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth2 ..\\pythonFiles\\symbolFiles\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth3 ..\\multiRootWkspc\\disableLinters\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth3 ..\\multiRootWkspc\\parent\\child\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth3 ..\\multiRootWkspc\\workspace1\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth3 ..\\multiRootWkspc\\workspace2\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth3 ..\\multiRootWkspc\\workspace3\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth3 ..\\pythonFiles\\linting\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth3 ..\\pythonFiles\\linting\\flake8config\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth3 ..\\pythonFiles\\linting\\pycodestyleconfig\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth3 ..\\pythonFiles\\linting\\pydocstyleconfig27\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth3 ..\\pythonFiles\\linting\\pylintconfig\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth3 ..\\pythonFiles\\symbolFiles\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth4 ..\\multiRootWkspc\\disableLinters\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth4 ..\\multiRootWkspc\\parent\\child\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth4 ..\\multiRootWkspc\\workspace1\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth4 ..\\multiRootWkspc\\workspace2\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth4 ..\\multiRootWkspc\\workspace3\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth4 ..\\pythonFiles\\linting\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth4 ..\\pythonFiles\\linting\\flake8config\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth4 ..\\pythonFiles\\linting\\pycodestyleconfig\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth4 ..\\pythonFiles\\linting\\pydocstyleconfig27\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth4 ..\\pythonFiles\\linting\\pylintconfig\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth4 ..\\pythonFiles\\symbolFiles\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth5 ..\\multiRootWkspc\\disableLinters\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth5 ..\\multiRootWkspc\\parent\\child\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth5 ..\\multiRootWkspc\\workspace1\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth5 ..\\multiRootWkspc\\workspace2\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth5 ..\\multiRootWkspc\\workspace3\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth5 ..\\pythonFiles\\linting\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth5 ..\\pythonFiles\\linting\\flake8config\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth5 ..\\pythonFiles\\linting\\pycodestyleconfig\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth5 ..\\pythonFiles\\linting\\pydocstyleconfig27\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth5 ..\\pythonFiles\\linting\\pylintconfig\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth5 ..\\pythonFiles\\symbolFiles\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth6 ..\\multiRootWkspc\\disableLinters\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth6 ..\\multiRootWkspc\\parent\\child\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth6 ..\\multiRootWkspc\\workspace1\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth6 ..\\multiRootWkspc\\workspace2\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth6 ..\\multiRootWkspc\\workspace3\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth6 ..\\pythonFiles\\linting\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth6 ..\\pythonFiles\\linting\\flake8config\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth6 ..\\pythonFiles\\linting\\pycodestyleconfig\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth6 ..\\pythonFiles\\linting\\pydocstyleconfig27\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth6 ..\\pythonFiles\\linting\\pylintconfig\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth6 ..\\pythonFiles\\symbolFiles\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth7 ..\\multiRootWkspc\\disableLinters\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth7 ..\\multiRootWkspc\\parent\\child\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth7 ..\\multiRootWkspc\\workspace1\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth7 ..\\multiRootWkspc\\workspace2\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth7 ..\\multiRootWkspc\\workspace3\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth7 ..\\pythonFiles\\linting\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth7 ..\\pythonFiles\\linting\\flake8config\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth7 ..\\pythonFiles\\linting\\pycodestyleconfig\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth7 ..\\pythonFiles\\linting\\pydocstyleconfig27\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth7 ..\\pythonFiles\\linting\\pylintconfig\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth7 ..\\pythonFiles\\symbolFiles\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth8 ..\\multiRootWkspc\\disableLinters\\file.py /^ def meth8(self):$/;" kind:member line:80 -meth8 ..\\multiRootWkspc\\parent\\child\\file.py /^ def meth8(self):$/;" kind:member line:80 -meth8 ..\\multiRootWkspc\\workspace1\\file.py /^ def meth8(self):$/;" kind:member line:80 -meth8 ..\\multiRootWkspc\\workspace2\\file.py /^ def meth8(self):$/;" kind:member line:80 -meth8 ..\\multiRootWkspc\\workspace3\\file.py /^ def meth8(self):$/;" kind:member line:80 -meth8 ..\\pythonFiles\\linting\\file.py /^ def meth8(self):$/;" kind:member line:80 -meth8 ..\\pythonFiles\\linting\\flake8config\\file.py /^ def meth8(self):$/;" kind:member line:80 -meth8 ..\\pythonFiles\\linting\\pycodestyleconfig\\file.py /^ def meth8(self):$/;" kind:member line:80 -meth8 ..\\pythonFiles\\linting\\pydocstyleconfig27\\file.py /^ def meth8(self):$/;" kind:member line:80 -meth8 ..\\pythonFiles\\linting\\pylintconfig\\file.py /^ def meth8(self):$/;" kind:member line:80 -meth8 ..\\pythonFiles\\symbolFiles\\file.py /^ def meth8(self):$/;" kind:member line:80 -method1 ..\\pythonFiles\\autocomp\\one.py /^ def method1(self):$/;" kind:member line:18 -method1 ..\\pythonFiles\\definition\\one.py /^ def method1(self):$/;" kind:member line:18 -method2 ..\\pythonFiles\\autocomp\\one.py /^ def method2(self):$/;" kind:member line:24 -method2 ..\\pythonFiles\\definition\\one.py /^ def method2(self):$/;" kind:member line:24 -minus ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^ def minus():$/;" kind:member line:287 -minus ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^def minus():$/;" kind:function line:148 -minus ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^ def minus():$/;" kind:member line:287 -minus ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^def minus():$/;" kind:function line:148 -minus ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^ def minus():$/;" kind:member line:287 -minus ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^def minus():$/;" kind:function line:148 -minus ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^def minus():$/;" kind:function line:100 -minus ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^def minus():$/;" kind:function line:91 -minus ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^def minus():$/;" kind:function line:100 -minus ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^def minus():$/;" kind:function line:91 -minus ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^def minus():$/;" kind:function line:100 -minus ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^def minus():$/;" kind:function line:91 -misc.py ..\\pythonFiles\\autocomp\\misc.py 1;" kind:file line:1 -mpl ..\\pythonFiles\\jupyter\\cells.py /^import matplotlib as mpl$/;" kind:namespace line:4 -mpl ..\\pythonFiles\\jupyter\\cells.py /^import matplotlib as mpl$/;" kind:namespace line:94 -myfunc ..\\pythonFiles\\definition\\decorators.py /^def myfunc():$/;" kind:function line:5 -name ..\\pythonFiles\\autocomp\\misc.py /^ def name(self):$/;" kind:member line:968 -name ..\\pythonFiles\\autocomp\\misc.py /^ def name(self, name):$/;" kind:member line:979 -non_parametrized_username ..\\pythonFiles\\testFiles\\standard\\tests\\test_another_pytest.py /^def non_parametrized_username(request):$/;" kind:function line:10 -non_parametrized_username ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^def non_parametrized_username(request):$/;" kind:function line:33 -non_parametrized_username ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^def non_parametrized_username(request):$/;" kind:function line:33 -non_parametrized_username ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_another_pytest.py /^def non_parametrized_username(request):$/;" kind:function line:10 -non_parametrized_username ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^def non_parametrized_username(request):$/;" kind:function line:33 -normalvariate ..\\pythonFiles\\autocomp\\misc.py /^ def normalvariate(self, mu, sigma):$/;" kind:member line:1633 -notify ..\\pythonFiles\\autocomp\\misc.py /^ def notify(self, n=1):$/;" kind:member line:373 -notifyAll ..\\pythonFiles\\autocomp\\misc.py /^ def notifyAll(self):$/;" kind:member line:400 -notify_all ..\\pythonFiles\\autocomp\\misc.py /^ notify_all = notifyAll$/;" kind:variable line:409 -np ..\\pythonFiles\\jupyter\\cells.py /^import numpy as np$/;" kind:namespace line:34 -np ..\\pythonFiles\\jupyter\\cells.py /^import numpy as np$/;" kind:namespace line:5 -np ..\\pythonFiles\\jupyter\\cells.py /^import numpy as np$/;" kind:namespace line:63 -np ..\\pythonFiles\\jupyter\\cells.py /^import numpy as np$/;" kind:namespace line:78 -np ..\\pythonFiles\\jupyter\\cells.py /^import numpy as np$/;" kind:namespace line:97 -obj ..\\pythonFiles\\autocomp\\one.py /^obj = Class1()$/;" kind:variable line:30 -obj ..\\pythonFiles\\definition\\one.py /^obj = Class1()$/;" kind:variable line:30 -onRefactor ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def onRefactor(self):$/;" kind:member line:109 -onRefactor ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def onRefactor(self):$/;" kind:member line:131 -onRefactor ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def onRefactor(self):$/;" kind:member line:149 -onRefactor ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def onRefactor(self):$/;" kind:member line:94 -one ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^def one():$/;" kind:function line:134 -one ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^def one():$/;" kind:function line:150 -one ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^def one():$/;" kind:function line:134 -one ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^def one():$/;" kind:function line:150 -one ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^def one():$/;" kind:function line:134 -one ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^def one():$/;" kind:function line:150 -one.py ..\\pythonFiles\\autocomp\\one.py 1;" kind:file line:1 -one.py ..\\pythonFiles\\autoimport\\one.py 1;" kind:file line:1 -one.py ..\\pythonFiles\\definition\\one.py 1;" kind:file line:1 -one.py ..\\pythonFiles\\docstrings\\one.py 1;" kind:file line:1 -original.1.py ..\\pythonFiles\\sorting\\withconfig\\original.1.py 1;" kind:file line:1 -original.py ..\\pythonFiles\\sorting\\noconfig\\original.py 1;" kind:file line:1 -original.py ..\\pythonFiles\\sorting\\withconfig\\original.py 1;" kind:file line:1 -p1 ..\\pythonFiles\\jupyter\\cells.py /^p1 = figure(title="Legend Example", tools=TOOLS)$/;" kind:variable line:70 -parametrized_username ..\\pythonFiles\\testFiles\\standard\\tests\\test_another_pytest.py /^def parametrized_username():$/;" kind:function line:6 -parametrized_username ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^def parametrized_username():$/;" kind:function line:29 -parametrized_username ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^def parametrized_username():$/;" kind:function line:29 -parametrized_username ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_another_pytest.py /^def parametrized_username():$/;" kind:function line:6 -parametrized_username ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^def parametrized_username():$/;" kind:function line:29 -paretovariate ..\\pythonFiles\\autocomp\\misc.py /^ def paretovariate(self, alpha):$/;" kind:member line:1880 -pd ..\\pythonFiles\\jupyter\\cells.py /^import pandas as pd$/;" kind:namespace line:77 -pep484.py ..\\pythonFiles\\autocomp\\pep484.py 1;" kind:file line:1 -pep526.py ..\\pythonFiles\\autocomp\\pep526.py 1;" kind:file line:1 -plain.py ..\\pythonFiles\\shebang\\plain.py 1;" kind:file line:1 -plt ..\\pythonFiles\\jupyter\\cells.py /^from matplotlib import pyplot as plt$/;" kind:unknown line:80 -plt ..\\pythonFiles\\jupyter\\cells.py /^import matplotlib.pyplot as plt$/;" kind:namespace line:3 -plt ..\\pythonFiles\\jupyter\\cells.py /^import matplotlib.pyplot as plt$/;" kind:namespace line:33 -plt ..\\pythonFiles\\jupyter\\cells.py /^import matplotlib.pyplot as plt$/;" kind:namespace line:93 -print_hello ..\\pythonFiles\\hover\\stringFormat.py /^def print_hello(name):$/;" kind:function line:2 -put ..\\pythonFiles\\autocomp\\misc.py /^ def put(self, item):$/;" kind:member line:1260 -randint ..\\pythonFiles\\autocomp\\misc.py /^ def randint(self, a, b):$/;" kind:member line:1477 -randrange ..\\pythonFiles\\autocomp\\misc.py /^ def randrange(self, start, stop=None, step=1, _int=int):$/;" kind:member line:1433 -refactor ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def refactor(self):$/;" kind:member line:87 -refactor.py ..\\pythonFiles\\refactoring\\standAlone\\refactor.py 1;" kind:file line:1 -release ..\\pythonFiles\\autocomp\\misc.py /^ def release(self):$/;" kind:member line:187 -release ..\\pythonFiles\\autocomp\\misc.py /^ def release(self):$/;" kind:member line:479 -release ..\\pythonFiles\\autocomp\\misc.py /^ def release(self):$/;" kind:member line:525 -rnd ..\\pythonFiles\\autocomp\\hoverTest.py /^rnd = random.Random()$/;" kind:variable line:7 -rnd2 ..\\pythonFiles\\autocomp\\hoverTest.py /^rnd2 = misc.Random()$/;" kind:variable line:12 -run ..\\pythonFiles\\autocomp\\misc.py /^ def run(self):$/;" kind:member line:1289 -run ..\\pythonFiles\\autocomp\\misc.py /^ def run(self):$/;" kind:member line:1305 -run ..\\pythonFiles\\autocomp\\misc.py /^ def run(self):$/;" kind:member line:1079 -run ..\\pythonFiles\\autocomp\\misc.py /^ def run(self):$/;" kind:member line:752 -sample ..\\pythonFiles\\autocomp\\misc.py /^ def sample(self, population, k):$/;" kind:member line:1543 -scatter ..\\pythonFiles\\jupyter\\cells.py /^scatter = ax.scatter(np.random.normal(size=N),$/;" kind:variable line:43 -seed ..\\pythonFiles\\autocomp\\misc.py /^ def seed(self, a=None, version=2):$/;" kind:member line:1356 -set ..\\pythonFiles\\autocomp\\misc.py /^ def set(self):$/;" kind:member line:576 -setDaemon ..\\pythonFiles\\autocomp\\misc.py /^ def setDaemon(self, daemonic):$/;" kind:member line:1035 -setName ..\\pythonFiles\\autocomp\\misc.py /^ def setName(self, name):$/;" kind:member line:1041 -setprofile ..\\pythonFiles\\autocomp\\misc.py /^def setprofile(func):$/;" kind:function line:90 -setstate ..\\pythonFiles\\autocomp\\misc.py /^ def setstate(self, state):$/;" kind:member line:1392 -settrace ..\\pythonFiles\\autocomp\\misc.py /^def settrace(func):$/;" kind:function line:100 -shebang.py ..\\pythonFiles\\shebang\\shebang.py 1;" kind:file line:1 -shebangEnv.py ..\\pythonFiles\\shebang\\shebangEnv.py 1;" kind:file line:1 -shebangInvalid.py ..\\pythonFiles\\shebang\\shebangInvalid.py 1;" kind:file line:1 -showMessage ..\\pythonFiles\\autocomp\\four.py /^def showMessage():$/;" kind:function line:19 -showMessage ..\\pythonFiles\\definition\\four.py /^def showMessage():$/;" kind:function line:19 -shuffle ..\\pythonFiles\\autocomp\\misc.py /^ def shuffle(self, x, random=None):$/;" kind:member line:1521 -start ..\\pythonFiles\\autocomp\\misc.py /^ def start(self):$/;" kind:member line:726 -stop ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def stop(self):$/;" kind:member line:84 -stringFormat.py ..\\pythonFiles\\hover\\stringFormat.py 1;" kind:file line:1 -t ..\\pythonFiles\\autocomp\\hoverTest.py /^t = misc.Thread()$/;" kind:variable line:15 -test ..\\pythonFiles\\definition\\await.test.py /^ async def test(self):$/;" kind:member line:7 -test ..\\pythonFiles\\sorting\\noconfig\\after.py /^def test():$/;" kind:function line:15 -test ..\\pythonFiles\\sorting\\noconfig\\before.py /^def test():$/;" kind:function line:12 -test ..\\pythonFiles\\sorting\\noconfig\\original.py /^def test():$/;" kind:function line:12 -test ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^ def test():$/;" kind:member line:201 -test ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^def test():$/;" kind:function line:62 -test ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^ def test():$/;" kind:member line:201 -test ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^def test():$/;" kind:function line:62 -test ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^ def test():$/;" kind:member line:201 -test ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^def test():$/;" kind:function line:62 -test2 ..\\pythonFiles\\definition\\await.test.py /^ async def test2(self):$/;" kind:member line:10 -test_1_1_1 ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_one.py /^ def test_1_1_1(self):$/;" kind:member line:4 -test_1_1_1 ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_two.py /^ def test_1_1_1(self):$/;" kind:member line:4 -test_1_1_2 ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_one.py /^ def test_1_1_2(self):$/;" kind:member line:7 -test_1_1_2 ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_two.py /^ def test_1_1_2(self):$/;" kind:member line:7 -test_1_1_3 ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_one.py /^ def test_1_1_3(self):$/;" kind:member line:11 -test_1_1_3 ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_two.py /^ def test_1_1_3(self):$/;" kind:member line:11 -test_1_2_1 ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_one.py /^ def test_1_2_1(self):$/;" kind:member line:15 -test_222A2 ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_two.py /^ def test_222A2(self):$/;" kind:member line:18 -test_222A2 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_two.py /^ def test_222A2(self):$/;" kind:member line:18 -test_222A2wow ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_two.py /^ def test_222A2wow(self):$/;" kind:member line:25 -test_222A2wow ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_two.py /^ def test_222A2wow(self):$/;" kind:member line:25 -test_222B2 ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_two.py /^ def test_222B2(self):$/;" kind:member line:21 -test_222B2 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_two.py /^ def test_222B2(self):$/;" kind:member line:21 -test_222B2wow ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_two.py /^ def test_222B2wow(self):$/;" kind:member line:28 -test_222B2wow ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_two.py /^ def test_222B2wow(self):$/;" kind:member line:28 -test_2_1_1 ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_two.py /^ def test_2_1_1(self):$/;" kind:member line:15 -test_A ..\\pythonFiles\\testFiles\\single\\tests\\test_one.py /^ def test_A(self):$/;" kind:member line:7 -test_A ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_one.py /^ def test_A(self):$/;" kind:member line:7 -test_A ..\\pythonFiles\\testFiles\\standard\\tests\\unittest_three_test.py /^ def test_A(self):$/;" kind:member line:5 -test_A ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_unittest_one.py /^ def test_A(self):$/;" kind:member line:7 -test_A ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_one.py /^ def test_A(self):$/;" kind:member line:7 -test_A ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\unittest_three_test.py /^ def test_A(self):$/;" kind:member line:5 -test_A2 ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_two.py /^ def test_A2(self):$/;" kind:member line:4 -test_A2 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_two.py /^ def test_A2(self):$/;" kind:member line:4 -test_B ..\\pythonFiles\\testFiles\\single\\tests\\test_one.py /^ def test_B(self):$/;" kind:member line:10 -test_B ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_one.py /^ def test_B(self):$/;" kind:member line:10 -test_B ..\\pythonFiles\\testFiles\\standard\\tests\\unittest_three_test.py /^ def test_B(self):$/;" kind:member line:8 -test_B ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_unittest_one.py /^ def test_B(self):$/;" kind:member line:10 -test_B ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_one.py /^ def test_B(self):$/;" kind:member line:10 -test_B ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\unittest_three_test.py /^ def test_B(self):$/;" kind:member line:8 -test_B2 ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_two.py /^ def test_B2(self):$/;" kind:member line:7 -test_B2 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_two.py /^ def test_B2(self):$/;" kind:member line:7 -test_C2 ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_two.py /^ def test_C2(self):$/;" kind:member line:10 -test_C2 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_two.py /^ def test_C2(self):$/;" kind:member line:10 -test_D2 ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_two.py /^ def test_D2(self):$/;" kind:member line:13 -test_D2 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_two.py /^ def test_D2(self):$/;" kind:member line:13 -test_Root_A ..\\pythonFiles\\testFiles\\single\\test_root.py /^ def test_Root_A(self):$/;" kind:member line:7 -test_Root_A ..\\pythonFiles\\testFiles\\standard\\test_root.py /^ def test_Root_A(self):$/;" kind:member line:7 -test_Root_A ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\test_root.py /^ def test_Root_A(self):$/;" kind:member line:7 -test_Root_B ..\\pythonFiles\\testFiles\\single\\test_root.py /^ def test_Root_B(self):$/;" kind:member line:10 -test_Root_B ..\\pythonFiles\\testFiles\\standard\\test_root.py /^ def test_Root_B(self):$/;" kind:member line:10 -test_Root_B ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\test_root.py /^ def test_Root_B(self):$/;" kind:member line:10 -test_Root_c ..\\pythonFiles\\testFiles\\single\\test_root.py /^ def test_Root_c(self):$/;" kind:member line:14 -test_Root_c ..\\pythonFiles\\testFiles\\standard\\test_root.py /^ def test_Root_c(self):$/;" kind:member line:14 -test_Root_c ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\test_root.py /^ def test_Root_c(self):$/;" kind:member line:14 -test_another_pytest.py ..\\pythonFiles\\testFiles\\standard\\tests\\test_another_pytest.py 1;" kind:file line:1 -test_another_pytest.py ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_another_pytest.py 1;" kind:file line:1 -test_c ..\\pythonFiles\\testFiles\\single\\tests\\test_one.py /^ def test_c(self):$/;" kind:member line:14 -test_c ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_one.py /^ def test_c(self):$/;" kind:member line:14 -test_c ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_unittest_one.py /^ def test_c(self):$/;" kind:member line:14 -test_c ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_one.py /^ def test_c(self):$/;" kind:member line:14 -test_complex_check ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^ def test_complex_check(self):$/;" kind:member line:10 -test_complex_check ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^ def test_complex_check(self):$/;" kind:member line:10 -test_complex_check ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^ def test_complex_check(self):$/;" kind:member line:10 -test_complex_check2 ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^ def test_complex_check2(self):$/;" kind:member line:24 -test_complex_check2 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^ def test_complex_check2(self):$/;" kind:member line:24 -test_complex_check2 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^ def test_complex_check2(self):$/;" kind:member line:24 -test_cwd ..\\pythonFiles\\testFiles\\cwd\\src\\tests\\test_cwd.py /^ def test_cwd(self):$/;" kind:member line:7 -test_cwd.py ..\\pythonFiles\\testFiles\\cwd\\src\\tests\\test_cwd.py 1;" kind:file line:1 -test_d ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^ def test_d(self):$/;" kind:member line:17 -test_d ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^ def test_d(self):$/;" kind:member line:17 -test_d ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^ def test_d(self):$/;" kind:member line:17 -test_nested_class_methodB ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^ def test_nested_class_methodB(self):$/;" kind:member line:14 -test_nested_class_methodB ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^ def test_nested_class_methodB(self):$/;" kind:member line:14 -test_nested_class_methodB ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^ def test_nested_class_methodB(self):$/;" kind:member line:14 -test_nested_class_methodC ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^ def test_nested_class_methodC(self):$/;" kind:member line:19 -test_nested_class_methodC ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^ def test_nested_class_methodC(self):$/;" kind:member line:19 -test_nested_class_methodC ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^ def test_nested_class_methodC(self):$/;" kind:member line:19 -test_one.py ..\\pythonFiles\\testFiles\\single\\tests\\test_one.py 1;" kind:file line:1 -test_parametrized_username ..\\pythonFiles\\testFiles\\standard\\tests\\test_another_pytest.py /^def test_parametrized_username(non_parametrized_username):$/;" kind:function line:16 -test_parametrized_username ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^def test_parametrized_username(non_parametrized_username):$/;" kind:function line:39 -test_parametrized_username ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^def test_parametrized_username(non_parametrized_username):$/;" kind:function line:39 -test_parametrized_username ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_another_pytest.py /^def test_parametrized_username(non_parametrized_username):$/;" kind:function line:16 -test_parametrized_username ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^def test_parametrized_username(non_parametrized_username):$/;" kind:function line:39 -test_pytest.py ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py 1;" kind:file line:1 -test_pytest.py ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py 1;" kind:file line:1 -test_pytest.py ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py 1;" kind:file line:1 -test_root.py ..\\pythonFiles\\testFiles\\single\\test_root.py 1;" kind:file line:1 -test_root.py ..\\pythonFiles\\testFiles\\standard\\test_root.py 1;" kind:file line:1 -test_root.py ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\test_root.py 1;" kind:file line:1 -test_simple_check ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^ def test_simple_check(self):$/;" kind:member line:8 -test_simple_check ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^ def test_simple_check(self):$/;" kind:member line:8 -test_simple_check ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^ def test_simple_check(self):$/;" kind:member line:8 -test_simple_check2 ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^ def test_simple_check2(self):$/;" kind:member line:22 -test_simple_check2 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^ def test_simple_check2(self):$/;" kind:member line:22 -test_simple_check2 ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^ def test_simple_check2(self):$/;" kind:member line:22 -test_unittest_one.py ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_one.py 1;" kind:file line:1 -test_unittest_one.py ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_one.py 1;" kind:file line:1 -test_unittest_one.py ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_unittest_one.py 1;" kind:file line:1 -test_unittest_one.py ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_one.py 1;" kind:file line:1 -test_unittest_two.py ..\\pythonFiles\\testFiles\\specificTest\\tests\\test_unittest_two.py 1;" kind:file line:1 -test_unittest_two.py ..\\pythonFiles\\testFiles\\standard\\tests\\test_unittest_two.py 1;" kind:file line:1 -test_unittest_two.py ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_unittest_two.py 1;" kind:file line:1 -test_username ..\\pythonFiles\\testFiles\\standard\\tests\\test_another_pytest.py /^def test_username(parametrized_username):$/;" kind:function line:13 -test_username ..\\pythonFiles\\testFiles\\standard\\tests\\test_pytest.py /^def test_username(parametrized_username):$/;" kind:function line:36 -test_username ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\other\\test_pytest.py /^def test_username(parametrized_username):$/;" kind:function line:36 -test_username ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_another_pytest.py /^def test_username(parametrized_username):$/;" kind:function line:13 -test_username ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\test_pytest.py /^def test_username(parametrized_username):$/;" kind:function line:36 -testthis ..\\pythonFiles\\definition\\await.test.py /^async def testthis():$/;" kind:function line:13 -three.py ..\\pythonFiles\\autocomp\\three.py 1;" kind:file line:1 -three.py ..\\pythonFiles\\autoimport\\two\\three.py 1;" kind:file line:1 -three.py ..\\pythonFiles\\definition\\three.py 1;" kind:file line:1 -triangular ..\\pythonFiles\\autocomp\\misc.py /^ def triangular(self, low=0.0, high=1.0, mode=None):$/;" kind:member line:1611 -tryBlocks2.py ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py 1;" kind:file line:1 -tryBlocks4.py ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py 1;" kind:file line:1 -tryBlocksTab.py ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py 1;" kind:file line:1 -ts ..\\pythonFiles\\jupyter\\cells.py /^ts = pd.Series(np.random.randn(1000),$/;" kind:variable line:82 -ts ..\\pythonFiles\\jupyter\\cells.py /^ts = ts.cumsum()$/;" kind:variable line:84 -two ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^ def two():$/;" kind:member line:308 -two ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^def two():$/;" kind:function line:169 -two ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^ def two():$/;" kind:member line:308 -two ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^def two():$/;" kind:function line:169 -two ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^ def two():$/;" kind:member line:308 -two ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^def two():$/;" kind:function line:169 -two ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^def two():$/;" kind:function line:166 -two ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^def two():$/;" kind:function line:177 -two ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^def two():$/;" kind:function line:166 -two ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^def two():$/;" kind:function line:177 -two ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^def two():$/;" kind:function line:166 -two ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^def two():$/;" kind:function line:177 -two.py ..\\pythonFiles\\autocomp\\two.py 1;" kind:file line:1 -two.py ..\\pythonFiles\\definition\\two.py 1;" kind:file line:1 -uniform ..\\pythonFiles\\autocomp\\misc.py /^ def uniform(self, a, b):$/;" kind:member line:1605 -unittest_three_test.py ..\\pythonFiles\\testFiles\\standard\\tests\\unittest_three_test.py 1;" kind:file line:1 -unittest_three_test.py ..\\pythonFiles\\testFiles\\unittestsWithConfigs\\tests\\unittest_three_test.py 1;" kind:file line:1 -user_options ..\\pythonFiles\\autocomp\\one.py /^ user_options = []$/;" kind:variable line:12 -user_options ..\\pythonFiles\\definition\\one.py /^ user_options = []$/;" kind:variable line:12 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^var = 100$/;" kind:variable line:1 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^var = 100$/;" kind:variable line:15 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^var = 100$/;" kind:variable line:29 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^var = 100$/;" kind:variable line:339 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocks2.py /^var = 100$/;" kind:variable line:353 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^ var = 100$/;" kind:variable line:339 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^var = 100$/;" kind:variable line:1 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^var = 100$/;" kind:variable line:15 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocks4.py /^var = 100$/;" kind:variable line:29 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^ var = 100$/;" kind:variable line:339 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^var = 100$/;" kind:variable line:1 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^var = 100$/;" kind:variable line:15 -var ..\\pythonFiles\\typeFormatFiles\\elseBlocksTab.py /^var = 100$/;" kind:variable line:29 -vonmisesvariate ..\\pythonFiles\\autocomp\\misc.py /^ def vonmisesvariate(self, mu, kappa):$/;" kind:member line:1689 -wait ..\\pythonFiles\\autocomp\\misc.py /^ def wait(self, timeout=None):$/;" kind:member line:309 -wait ..\\pythonFiles\\autocomp\\misc.py /^ def wait(self, timeout=None):$/;" kind:member line:603 -watch ..\\pythonFiles\\refactoring\\standAlone\\refactor.py /^ def watch(self):$/;" kind:member line:234 -weibullvariate ..\\pythonFiles\\autocomp\\misc.py /^ def weibullvariate(self, alpha, beta):$/;" kind:member line:1889 -workspace2File.py ..\\pythonFiles\\symbolFiles\\workspace2File.py 1;" kind:file line:1 -x ..\\pythonFiles\\jupyter\\cells.py /^x = Gaussian(2.0, 1.0)$/;" kind:variable line:131 -x ..\\pythonFiles\\jupyter\\cells.py /^x = np.linspace(0, 20, 100)$/;" kind:variable line:7 -x ..\\pythonFiles\\jupyter\\cells.py /^x = np.linspace(0, 4 * np.pi, 100)$/;" kind:variable line:65 -y ..\\pythonFiles\\jupyter\\cells.py /^y = np.sin(x)$/;" kind:variable line:66 -zero ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^def zero():$/;" kind:function line:110 -zero ..\\pythonFiles\\typeFormatFiles\\tryBlocks2.py /^def zero():$/;" kind:function line:122 -zero ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^def zero():$/;" kind:function line:110 -zero ..\\pythonFiles\\typeFormatFiles\\tryBlocks4.py /^def zero():$/;" kind:function line:122 -zero ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^def zero():$/;" kind:function line:110 -zero ..\\pythonFiles\\typeFormatFiles\\tryBlocksTab.py /^def zero():$/;" kind:function line:122 diff --git a/src/test/common.ts b/src/test/common.ts index f9e9480493f1..4d5ab04d71aa 100644 --- a/src/test/common.ts +++ b/src/test/common.ts @@ -36,7 +36,6 @@ export enum OSType { } export type PythonSettingKeys = - | 'workspaceSymbols.enabled' | 'pythonPath' | 'languageServer' | 'linting.lintOnSave' diff --git a/src/test/common/configSettings.test.ts b/src/test/common/configSettings.test.ts index b104ff2fd1e1..6125d343f2c4 100644 --- a/src/test/common/configSettings.test.ts +++ b/src/test/common/configSettings.test.ts @@ -2,7 +2,6 @@ import * as assert from 'assert'; import * as path from 'path'; import * as vscode from 'vscode'; import { IS_WINDOWS } from '../../client/common/platform/constants'; -import { IWorkspaceSymbolSettings } from '../../client/common/types'; import { SystemVariables } from '../../client/common/variables/systemVariables'; import { getExtensionSettings } from '../common'; import { initialize } from './../initialize'; @@ -34,24 +33,6 @@ suite('Configuration Settings', () => { pythonSettingValue.toUpperCase(), `Setting ${key} not the same`, ); - } else if (key === 'workspaceSymbols' && IS_WINDOWS) { - const workspaceSettings = (pythonSettingValue as {}) as IWorkspaceSymbolSettings; - const workspaceSttings = (settingValue as {}) as IWorkspaceSymbolSettings; - assert.equal( - workspaceSettings.tagFilePath.toUpperCase(), - workspaceSttings.tagFilePath.toUpperCase(), - `Setting ${key} not the same`, - ); - - const workspaceSettingsWithoutPath = { ...workspaceSettings }; - workspaceSettingsWithoutPath.tagFilePath = ''; - const pythonSettingValueWithoutPath = { ...((pythonSettingValue as {}) as IWorkspaceSymbolSettings) }; - pythonSettingValueWithoutPath.tagFilePath = ''; - assert.deepEqual( - workspaceSettingsWithoutPath, - pythonSettingValueWithoutPath, - `Setting ${key} not the same`, - ); } }); diff --git a/src/test/common/configSettings/configSettings.unit.test.ts b/src/test/common/configSettings/configSettings.unit.test.ts index 1f9e4439a14b..0db9e654757f 100644 --- a/src/test/common/configSettings/configSettings.unit.test.ts +++ b/src/test/common/configSettings/configSettings.unit.test.ts @@ -21,7 +21,6 @@ import { ILoggingSettings, ISortImportSettings, ITerminalSettings, - IWorkspaceSymbolSettings, } from '../../../client/common/types'; import { noop } from '../../../client/common/utils/misc'; import * as EnvFileTelemetry from '../../../client/telemetry/envFileTelemetry'; @@ -104,9 +103,6 @@ suite('Python Settings', async () => { config.setup((c) => c.get('sortImports')).returns(() => sourceSettings.sortImports); config.setup((c) => c.get('formatting')).returns(() => sourceSettings.formatting); config.setup((c) => c.get('autoComplete')).returns(() => sourceSettings.autoComplete); - config - .setup((c) => c.get('workspaceSymbols')) - .returns(() => sourceSettings.workspaceSymbols); config.setup((c) => c.get('testing')).returns(() => sourceSettings.testing); config.setup((c) => c.get('terminal')).returns(() => sourceSettings.terminal); config.setup((c) => c.get('experiments')).returns(() => sourceSettings.experiments); diff --git a/src/test/common/installer.test.ts b/src/test/common/installer.test.ts index 93d498fbc594..49c6238e390f 100644 --- a/src/test/common/installer.test.ts +++ b/src/test/common/installer.test.ts @@ -45,10 +45,8 @@ import { import { InstallationChannelManager } from '../../client/common/installer/channelManager'; import { ProductInstaller } from '../../client/common/installer/productInstaller'; import { - CTagsProductPathService, FormatterProductPathService, LinterProductPathService, - RefactoringLibraryProductPathService, TestFrameworkProductPathService, } from '../../client/common/installer/productPath'; import { ProductService } from '../../client/common/installer/productService'; @@ -178,11 +176,6 @@ suite('Installer', () => { ioc.registerMockProcessTypes(); ioc.serviceManager.addSingletonInstance(IsWindows, false); ioc.serviceManager.addSingletonInstance(IProductService, new ProductService()); - ioc.serviceManager.addSingleton( - IProductPathService, - CTagsProductPathService, - ProductType.WorkspaceSymbols, - ); ioc.serviceManager.addSingleton( IProductPathService, FormatterProductPathService, @@ -198,11 +191,6 @@ suite('Installer', () => { TestFrameworkProductPathService, ProductType.TestFramework, ); - ioc.serviceManager.addSingleton( - IProductPathService, - RefactoringLibraryProductPathService, - ProductType.RefactoringLibrary, - ); ioc.serviceManager.addSingleton(IActiveResourceService, ActiveResourceService); ioc.serviceManager.addSingleton(IInterpreterPathService, InterpreterPathService); ioc.serviceManager.addSingleton( @@ -331,7 +319,7 @@ suite('Installer', () => { new MockModuleInstaller('two', true), ); ioc.serviceManager.addSingletonInstance(ITerminalHelper, instance(mock(TerminalHelper))); - if (prod.value === Product.ctags || prod.value === Product.unittest || prod.value === Product.isort) { + if (prod.value === Product.unittest || prod.value === Product.isort) { return undefined; } await testCheckingIfProductIsInstalled(prod.value); @@ -369,7 +357,7 @@ suite('Installer', () => { new MockModuleInstaller('two', true), ); ioc.serviceManager.addSingletonInstance(ITerminalHelper, instance(mock(TerminalHelper))); - if (prod.value === Product.unittest || prod.value === Product.ctags || prod.value === Product.isort) { + if (prod.value === Product.unittest || prod.value === Product.isort) { return undefined; } await testInstallingProduct(prod.value); diff --git a/src/test/common/installer/installer.invalidPath.unit.test.ts b/src/test/common/installer/installer.invalidPath.unit.test.ts index bcafbd69be50..bbbd7936091b 100644 --- a/src/test/common/installer/installer.invalidPath.unit.test.ts +++ b/src/test/common/installer/installer.invalidPath.unit.test.ts @@ -80,8 +80,6 @@ suite('Module Installer - Invalid Paths', () => { switch (product.value) { case Product.isort: - case Product.ctags: - case Product.rope: case Product.unittest: { return; } diff --git a/src/test/common/installer/installer.unit.test.ts b/src/test/common/installer/installer.unit.test.ts index 38f002c028f2..559acd1a6de5 100644 --- a/src/test/common/installer/installer.unit.test.ts +++ b/src/test/common/installer/installer.unit.test.ts @@ -18,8 +18,6 @@ import { Commands } from '../../../client/common/constants'; import { ExperimentService } from '../../../client/common/experiments/service'; import '../../../client/common/extensions'; import { - CTagsInstallationScript, - CTagsInstaller, FormatterInstaller, LinterInstaller, ProductInstaller, @@ -33,7 +31,6 @@ import { IProductPathService, IProductService, } from '../../../client/common/installer/types'; -import { IPlatformService } from '../../../client/common/platform/types'; import { ExecutionResult, IProcessService, @@ -41,7 +38,6 @@ import { IPythonExecutionFactory, IPythonExecutionService, } from '../../../client/common/process/types'; -import { ITerminalService, ITerminalServiceFactory } from '../../../client/common/terminal/types'; import { IConfigurationService, IDisposableRegistry, @@ -193,114 +189,6 @@ suite('Module Installer only', () => { case Product.isort: { return; } - case Product.ctags: { - test(`If platform is Windows, for module installer ${product.name} (${ - resource ? 'With a resource' : 'without a resource' - }), print the instructions to install Ctags into the output channel`, async () => { - const platformService = TypeMoq.Mock.ofType(); - serviceContainer - .setup((c) => c.get(TypeMoq.It.isValue(IPlatformService))) - .returns(() => platformService.object); - platformService.setup((p) => p.isWindows).returns(() => true); - outputChannel.setup((o) => o.appendLine(TypeMoq.It.isAny())).returns(() => undefined); - outputChannel - .setup((o) => - o.appendLine( - 'Install Universal Ctags Win32 to enable support for Workspace Symbols', - ), - ) - .returns(() => undefined) - .verifiable(TypeMoq.Times.once()); - outputChannel - .setup((o) => o.show()) - .returns(() => undefined) - .verifiable(TypeMoq.Times.once()); - const response = await installer.install(product.value, resource); - expect(response).to.be.equal(InstallerResponse.Ignore); - outputChannel.verifyAll(); - }); - test(`If platform is not Windows, for module installer ${product.name} (${ - resource ? 'With a resource' : 'without a resource' - }), install Ctags using the corresponding script`, async () => { - const platformService = TypeMoq.Mock.ofType(); - serviceContainer - .setup((c) => c.get(TypeMoq.It.isValue(IPlatformService))) - .returns(() => platformService.object); - platformService.setup((p) => p.isWindows).returns(() => false); - const terminalService = TypeMoq.Mock.ofType(); - const terminalServiceFactory = TypeMoq.Mock.ofType(); - serviceContainer - .setup((c) => c.get(TypeMoq.It.isValue(ITerminalServiceFactory))) - .returns(() => terminalServiceFactory.object); - terminalServiceFactory - .setup((p) => p.getTerminalService({ resource })) - .returns(() => terminalService.object); - terminalService - .setup((t) => t.sendCommand(CTagsInstallationScript, [])) - .returns(() => Promise.resolve()) - .verifiable(TypeMoq.Times.once()); - const response = await installer.install(product.value, resource); - expect(response).to.be.equal(InstallerResponse.Ignore); - terminalService.verifyAll(); - }); - test(`If platform is not Windows, for module installer ${product.name} (${ - resource ? 'With a resource' : 'without a resource' - }), but installing Ctags fails with Error, log error and return`, async () => { - const platformService = TypeMoq.Mock.ofType(); - serviceContainer - .setup((c) => c.get(TypeMoq.It.isValue(IPlatformService))) - .returns(() => platformService.object); - platformService.setup((p) => p.isWindows).returns(() => false); - const terminalService = TypeMoq.Mock.ofType(); - const terminalServiceFactory = TypeMoq.Mock.ofType(); - serviceContainer - .setup((c) => c.get(TypeMoq.It.isValue(ITerminalServiceFactory))) - .returns(() => terminalServiceFactory.object); - terminalServiceFactory - .setup((p) => p.getTerminalService({ resource })) - .returns(() => terminalService.object); - terminalService - .setup((t) => t.sendCommand(CTagsInstallationScript, [])) - .returns(() => Promise.reject(new Error('Kaboom'))) - .verifiable(TypeMoq.Times.once()); - const response = await installer.install(product.value, resource); - expect(response).to.be.equal(InstallerResponse.Ignore); - terminalService.verifyAll(); - }); - test(`If 'Yes' is selected on the install prompt for the the module installer ${ - product.name - } (${ - resource ? 'With a resource' : 'without a resource' - }), install module and return response`, async () => { - app.setup((a) => - a.showErrorMessage(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny()), - ) - .returns(() => Promise.resolve('Yes')) - .verifiable(TypeMoq.Times.once()); - const install = sinon.stub(CTagsInstaller.prototype, 'install'); - install.resolves(InstallerResponse.Installed); - const response = await installer.promptToInstall(product.value, resource); - expect(response).to.be.equal(InstallerResponse.Installed); - app.verifyAll(); - assert.ok(install.calledOnceWith(product.value, resource)); - }); - test(`If 'No' is selected on the install prompt for the module installer ${product.name} (${ - resource ? 'With a resource' : 'without a resource' - }), return ignore response`, async () => { - app.setup((a) => - a.showErrorMessage(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny()), - ) - .returns(() => Promise.resolve('No')) - .verifiable(TypeMoq.Times.once()); - const install = sinon.stub(CTagsInstaller.prototype, 'install'); - install.resolves(InstallerResponse.Installed); - const response = await installer.promptToInstall(product.value, resource); - expect(response).to.be.equal(InstallerResponse.Ignore); - app.verifyAll(); - assert.ok(install.notCalled); - }); - return; - } case Product.unittest: { test(`Ensure resource info is passed into the module installer ${product.name} (${ resource ? 'With a resource' : 'without a resource' diff --git a/src/test/common/installer/productPath.unit.test.ts b/src/test/common/installer/productPath.unit.test.ts index a01fd5a40c0f..82755ed16d37 100644 --- a/src/test/common/installer/productPath.unit.test.ts +++ b/src/test/common/installer/productPath.unit.test.ts @@ -12,10 +12,8 @@ import '../../../client/common/extensions'; import { ProductInstaller } from '../../../client/common/installer/productInstaller'; import { BaseProductPathsService, - CTagsProductPathService, FormatterProductPathService, LinterProductPathService, - RefactoringLibraryProductPathService, TestFrameworkProductPathService, } from '../../../client/common/installer/productPath'; import { ProductService } from '../../../client/common/installer/productService'; @@ -25,7 +23,6 @@ import { IFormattingSettings, IInstaller, IPythonSettings, - IWorkspaceSymbolSettings, Product, ProductType, } from '../../../client/common/types'; @@ -49,7 +46,6 @@ suite('Product Path', () => { let serviceContainer: TypeMoq.IMock; let formattingSettings: TypeMoq.IMock; let unitTestSettings: TypeMoq.IMock; - let workspaceSymnbolSettings: TypeMoq.IMock; let configService: TypeMoq.IMock; let productInstaller: ProductInstaller; setup(function () { @@ -60,7 +56,6 @@ suite('Product Path', () => { configService = TypeMoq.Mock.ofType(); formattingSettings = TypeMoq.Mock.ofType(); unitTestSettings = TypeMoq.Mock.ofType(); - workspaceSymnbolSettings = TypeMoq.Mock.ofType(); productInstaller = new ProductInstaller( serviceContainer.object, @@ -69,7 +64,6 @@ suite('Product Path', () => { const pythonSettings = TypeMoq.Mock.ofType(); pythonSettings.setup((p) => p.formatting).returns(() => formattingSettings.object); pythonSettings.setup((p) => p.testing).returns(() => unitTestSettings.object); - pythonSettings.setup((p) => p.workspaceSymbols).returns(() => workspaceSymnbolSettings.object); configService .setup((s) => s.getSettings(TypeMoq.It.isValue(resource))) .returns(() => pythonSettings.object); @@ -79,7 +73,6 @@ suite('Product Path', () => { serviceContainer .setup((s) => s.get(TypeMoq.It.isValue(IInstaller), TypeMoq.It.isAny())) .returns(() => productInstaller); - serviceContainer .setup((c) => c.get(TypeMoq.It.isValue(IProductService), TypeMoq.It.isAny())) .returns(() => new ProductService()); @@ -170,35 +163,6 @@ suite('Product Path', () => { }); break; } - case ProductType.RefactoringLibrary: { - test(`Ensure path is returned for ${product.name} (${ - resource ? 'With a resource' : 'without a resource' - })`, async () => { - const productPathService = new RefactoringLibraryProductPathService(serviceContainer.object); - - const value = productPathService.getExecutableNameFromSettings(product.value, resource); - const moduleName = productInstaller.translateProductToModuleName(product.value); - expect(value).to.be.equal(moduleName); - }); - break; - } - case ProductType.WorkspaceSymbols: { - test(`Ensure path is returned for ${product.name} (${ - resource ? 'With a resource' : 'without a resource' - })`, async () => { - const productPathService = new CTagsProductPathService(serviceContainer.object); - const expectedPath = 'Some Path'; - workspaceSymnbolSettings - .setup((w) => w.ctagsPath) - .returns(() => expectedPath) - .verifiable(TypeMoq.Times.atLeastOnce()); - - const value = productPathService.getExecutableNameFromSettings(product.value, resource); - expect(value).to.be.equal(expectedPath); - workspaceSymnbolSettings.verifyAll(); - }); - break; - } case ProductType.TestFramework: { test(`Ensure path is returned for ${product.name} (${ resource ? 'With a resource' : 'without a resource' diff --git a/src/test/common/installer/serviceRegistry.unit.test.ts b/src/test/common/installer/serviceRegistry.unit.test.ts index fdd2550a611b..08648c713f5e 100644 --- a/src/test/common/installer/serviceRegistry.unit.test.ts +++ b/src/test/common/installer/serviceRegistry.unit.test.ts @@ -11,10 +11,8 @@ import { PipEnvInstaller } from '../../../client/common/installer/pipEnvInstalle import { PipInstaller } from '../../../client/common/installer/pipInstaller'; import { PoetryInstaller } from '../../../client/common/installer/poetryInstaller'; import { - CTagsProductPathService, FormatterProductPathService, LinterProductPathService, - RefactoringLibraryProductPathService, TestFrameworkProductPathService, } from '../../../client/common/installer/productPath'; import { ProductService } from '../../../client/common/installer/productService'; @@ -67,13 +65,6 @@ suite('Common installer Service Registry', () => { ).once(); verify(serviceManager.addSingleton(IProductService, ProductService)).once(); - verify( - serviceManager.addSingleton( - IProductPathService, - CTagsProductPathService, - ProductType.WorkspaceSymbols, - ), - ).once(); verify( serviceManager.addSingleton( IProductPathService, @@ -95,12 +86,5 @@ suite('Common installer Service Registry', () => { ProductType.TestFramework, ), ).once(); - verify( - serviceManager.addSingleton( - IProductPathService, - RefactoringLibraryProductPathService, - ProductType.RefactoringLibrary, - ), - ).once(); }); }); diff --git a/src/test/linters/common.ts b/src/test/linters/common.ts index 6e1b27152787..793f2127611e 100644 --- a/src/test/linters/common.ts +++ b/src/test/linters/common.ts @@ -262,7 +262,7 @@ export class BaseTestFixture { // linting - this.linterManager = new LinterManager(this.serviceContainer.object, this.workspaceService.object!); + this.linterManager = new LinterManager(this.configService.object); this.serviceContainer .setup((c) => c.get(TypeMoq.It.isValue(ILinterManager), TypeMoq.It.isAny())) .returns(() => this.linterManager); diff --git a/src/test/linters/lint.args.test.ts b/src/test/linters/lint.args.test.ts index 0e21a31a12e3..e398818db031 100644 --- a/src/test/linters/lint.args.test.ts +++ b/src/test/linters/lint.args.test.ts @@ -132,7 +132,7 @@ suite('Linting - Arguments', () => { const platformService = TypeMoq.Mock.ofType(); serviceManager.addSingletonInstance(IPlatformService, platformService.object); - lm = new LinterManager(serviceContainer, workspaceService.object); + lm = new LinterManager(configService.object); serviceManager.addSingletonInstance(ILinterManager, lm); document = TypeMoq.Mock.ofType(); }); diff --git a/src/test/linters/lint.manager.unit.test.ts b/src/test/linters/lint.manager.unit.test.ts deleted file mode 100644 index 6229c983b59f..000000000000 --- a/src/test/linters/lint.manager.unit.test.ts +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -'use strict'; - -import { expect } from 'chai'; -import * as TypeMoq from 'typemoq'; -import { Uri } from 'vscode'; -import { IWorkspaceService } from '../../client/common/application/types'; -import { IConfigurationService, IPythonSettings } from '../../client/common/types'; -import { IServiceContainer } from '../../client/ioc/types'; -import { LinterManager } from '../../client/linters/linterManager'; - -const workspaceService = TypeMoq.Mock.ofType(); - -// setup class instance -class TestLinterManager extends LinterManager { - public enableUnconfiguredLintersCallCount: number = 0; - - protected async enableUnconfiguredLinters(_resource?: Uri): Promise { - this.enableUnconfiguredLintersCallCount += 1; - } -} - -function getServiceContainerMockForLinterManagerTests(): TypeMoq.IMock { - // setup test mocks - const serviceContainerMock = TypeMoq.Mock.ofType(); - - const pythonSettingsMock = TypeMoq.Mock.ofType(); - const configMock = TypeMoq.Mock.ofType(); - configMock.setup((cm) => cm.getSettings(TypeMoq.It.isAny())).returns(() => pythonSettingsMock.object); - serviceContainerMock.setup((c) => c.get(IConfigurationService)).returns(() => configMock.object); - - const pythonConfig = { - inspect: () => {}, - }; - workspaceService - .setup((x) => x.getConfiguration('python', TypeMoq.It.isAny())) - - .returns(() => pythonConfig as any); - serviceContainerMock.setup((c) => c.get(IWorkspaceService)).returns(() => workspaceService.object); - - return serviceContainerMock; -} - -suite('Lint Manager Unit Tests', () => { - test('Linter manager isLintingEnabled checks availability when silent = false.', async () => { - // set expectations - const expectedCallCount = 1; - const silentFlag = false; - - // get setup - const serviceContainerMock = getServiceContainerMockForLinterManagerTests(); - - // make the call - const lm = new TestLinterManager(serviceContainerMock.object, workspaceService.object); - await lm.isLintingEnabled(silentFlag); - - // test expectations - expect(lm.enableUnconfiguredLintersCallCount).to.equal(expectedCallCount); - }); - - test('Linter manager isLintingEnabled does not check availability when silent = true.', async () => { - // set expectations - const expectedCallCount = 0; - const silentFlag = true; - - // get setup - const serviceContainerMock = getServiceContainerMockForLinterManagerTests(); - - // make the call - const lm: TestLinterManager = new TestLinterManager(serviceContainerMock.object, workspaceService.object); - await lm.isLintingEnabled(silentFlag); - - // test expectations - expect(lm.enableUnconfiguredLintersCallCount).to.equal(expectedCallCount); - }); - - test('Linter manager getActiveLinters checks availability when silent = false.', async () => { - // set expectations - const expectedCallCount = 1; - const silentFlag = false; - - // get setup - const serviceContainerMock = getServiceContainerMockForLinterManagerTests(); - - // make the call - const lm: TestLinterManager = new TestLinterManager(serviceContainerMock.object, workspaceService.object); - await lm.getActiveLinters(silentFlag); - - // test expectations - expect(lm.enableUnconfiguredLintersCallCount).to.equal(expectedCallCount); - }); - - test('Linter manager getActiveLinters checks availability when silent = true.', async () => { - // set expectations - const expectedCallCount = 0; - const silentFlag = true; - - // get setup - const serviceContainerMock = getServiceContainerMockForLinterManagerTests(); - - // make the call - const lm: TestLinterManager = new TestLinterManager(serviceContainerMock.object, workspaceService.object); - await lm.getActiveLinters(silentFlag); - - // test expectations - expect(lm.enableUnconfiguredLintersCallCount).to.equal(expectedCallCount); - }); -}); diff --git a/src/test/linters/lint.multilinter.test.ts b/src/test/linters/lint.multilinter.test.ts index deb39ceb0803..b71478505530 100644 --- a/src/test/linters/lint.multilinter.test.ts +++ b/src/test/linters/lint.multilinter.test.ts @@ -17,7 +17,7 @@ import { deleteFile, IExtensionTestApi, PythonSettingKeys, rootWorkspaceUri } fr import { closeActiveWindows, initialize, initializeTest, IS_MULTI_ROOT_TEST } from '../initialize'; const workspaceUri = Uri.file(path.join(__dirname, '..', '..', '..', 'src', 'test')); -const pythoFilesPath = path.join(__dirname, '..', '..', '..', 'src', 'test', 'pythonFiles', 'linting'); +const pythonFilesPath = path.join(__dirname, '..', '..', '..', 'src', 'test', 'pythonFiles', 'linting'); // Mocked out python tool execution (all we need is mocked linter return values). class MockPythonToolExecService extends PythonToolExecutionService { @@ -90,7 +90,7 @@ suite('Linting - Multiple Linters Enabled Test', () => { test('Multiple linters', async () => { await closeActiveWindows(); - const document = await workspace.openTextDocument(path.join(pythoFilesPath, 'print.py')); + const document = await workspace.openTextDocument(path.join(pythonFilesPath, 'print.py')); await window.showTextDocument(document); await configService.updateSetting( 'languageServer', diff --git a/src/test/linters/lint.multiroot.test.ts b/src/test/linters/lint.multiroot.test.ts index 0c088d4c28cb..1e64d91ff4af 100644 --- a/src/test/linters/lint.multiroot.test.ts +++ b/src/test/linters/lint.multiroot.test.ts @@ -4,10 +4,8 @@ import { CancellationTokenSource, ConfigurationTarget, OutputChannel, Uri, works import { LanguageServerType } from '../../client/activation/types'; import { PythonSettings } from '../../client/common/configSettings'; import { - CTagsProductPathService, FormatterProductPathService, LinterProductPathService, - RefactoringLibraryProductPathService, TestFrameworkProductPathService, } from '../../client/common/installer/productPath'; import { ProductService } from '../../client/common/installer/productService'; @@ -53,11 +51,6 @@ suite('Multiroot Linting', () => { await ioc.registerMockInterpreterTypes(); ioc.registerInterpreterStorageTypes(); ioc.serviceManager.addSingletonInstance(IProductService, new ProductService()); - ioc.serviceManager.addSingleton( - IProductPathService, - CTagsProductPathService, - ProductType.WorkspaceSymbols, - ); ioc.serviceManager.addSingleton( IProductPathService, FormatterProductPathService, @@ -73,11 +66,6 @@ suite('Multiroot Linting', () => { TestFrameworkProductPathService, ProductType.TestFramework, ); - ioc.serviceManager.addSingleton( - IProductPathService, - RefactoringLibraryProductPathService, - ProductType.RefactoringLibrary, - ); } async function createLinter(product: Product): Promise { diff --git a/src/test/linters/lint.provider.test.ts b/src/test/linters/lint.provider.test.ts index 4318b2703afc..680dfecc0277 100644 --- a/src/test/linters/lint.provider.test.ts +++ b/src/test/linters/lint.provider.test.ts @@ -120,7 +120,7 @@ suite('Linting - Provider', () => { ICommandManager, TypeMoq.Mock.ofType().object, ); - lm = new LinterManager(serviceContainer, workspaceService.object); + lm = new LinterManager(configService.object); serviceManager.addSingletonInstance(ILinterManager, lm); emitter = new vscode.EventEmitter(); document = TypeMoq.Mock.ofType(); diff --git a/src/test/linters/lint.test.ts b/src/test/linters/lint.test.ts index 7c64480e5777..c9e1826030ea 100644 --- a/src/test/linters/lint.test.ts +++ b/src/test/linters/lint.test.ts @@ -4,13 +4,10 @@ import * as assert from 'assert'; import { ConfigurationTarget } from 'vscode'; -import { WorkspaceService } from '../../client/common/application/workspace'; import { Product } from '../../client/common/installer/productInstaller'; import { - CTagsProductPathService, FormatterProductPathService, LinterProductPathService, - RefactoringLibraryProductPathService, TestFrameworkProductPathService, } from '../../client/common/installer/productPath'; import { ProductService } from '../../client/common/installer/productService'; @@ -54,14 +51,9 @@ suite('Linting Settings', () => { ioc.registerLinterTypes(); ioc.registerVariableTypes(); ioc.registerPlatformTypes(); - linterManager = new LinterManager(ioc.serviceContainer, new WorkspaceService()); configService = ioc.serviceContainer.get(IConfigurationService); + linterManager = new LinterManager(configService); ioc.serviceManager.addSingletonInstance(IProductService, new ProductService()); - ioc.serviceManager.addSingleton( - IProductPathService, - CTagsProductPathService, - ProductType.WorkspaceSymbols, - ); ioc.serviceManager.addSingleton( IProductPathService, FormatterProductPathService, @@ -77,11 +69,6 @@ suite('Linting Settings', () => { TestFrameworkProductPathService, ProductType.TestFramework, ); - ioc.serviceManager.addSingleton( - IProductPathService, - RefactoringLibraryProductPathService, - ProductType.RefactoringLibrary, - ); } async function resetSettings(lintingEnabled = true) { diff --git a/src/test/linters/lintengine.test.ts b/src/test/linters/lintengine.test.ts index 79f3d4badc4e..961d298bd444 100644 --- a/src/test/linters/lintengine.test.ts +++ b/src/test/linters/lintengine.test.ts @@ -73,10 +73,7 @@ suite('Linting - LintingEngine', () => { try { lintingEngine.lintDocument(doc, 'auto').ignoreErrors(); } catch { - lintManager.verify( - (l) => l.isLintingEnabled(TypeMoq.It.isAny(), TypeMoq.It.isValue(doc.uri)), - TypeMoq.Times.once(), - ); + lintManager.verify((l) => l.isLintingEnabled(TypeMoq.It.isValue(doc.uri)), TypeMoq.Times.once()); } }); test('Ensure document.uri is passed into createLinter', () => { diff --git a/src/test/linters/linterCommands.unit.test.ts b/src/test/linters/linterCommands.unit.test.ts index cd345db31ba1..794bbbfa3587 100644 --- a/src/test/linters/linterCommands.unit.test.ts +++ b/src/test/linters/linterCommands.unit.test.ts @@ -57,7 +57,7 @@ suite('Linting - Linter Commands', () => { currentState: boolean, selectedState: 'Enable' | 'Disable' | undefined, ) { - when(manager.isLintingEnabled(true, anything())).thenResolve(currentState); + when(manager.isLintingEnabled(anything())).thenResolve(currentState); const expectedQuickPickOptions = { matchOnDetail: true, matchOnDescription: true, @@ -101,7 +101,7 @@ suite('Linting - Linter Commands', () => { test('Set Linter should display a quickpick', async () => { when(manager.getAllLinterInfos()).thenReturn([]); - when(manager.getActiveLinters(true, anything())).thenResolve([]); + when(manager.getActiveLinters(anything())).thenResolve([]); when(shell.showQuickPick(anything(), anything())).thenResolve(); const expectedQuickPickOptions = { matchOnDetail: true, @@ -120,7 +120,7 @@ suite('Linting - Linter Commands', () => { const linterId = 'Hello World'; const activeLinters: ILinterInfo[] = [{ id: linterId } as any]; when(manager.getAllLinterInfos()).thenReturn([]); - when(manager.getActiveLinters(true, anything())).thenResolve(activeLinters); + when(manager.getActiveLinters(anything())).thenResolve(activeLinters); when(shell.showQuickPick(anything(), anything())).thenResolve(); const expectedQuickPickOptions = { matchOnDetail: true, @@ -138,7 +138,7 @@ suite('Linting - Linter Commands', () => { test('Set Linter should display a quickpick and with message about multiple linters being enabled', async () => { const activeLinters: ILinterInfo[] = [{ id: 'linterId' } as any, { id: 'linterId2' } as any]; when(manager.getAllLinterInfos()).thenReturn([]); - when(manager.getActiveLinters(true, anything())).thenResolve(activeLinters); + when(manager.getActiveLinters(anything())).thenResolve(activeLinters); when(shell.showQuickPick(anything(), anything())).thenResolve(); const expectedQuickPickOptions = { matchOnDetail: true, @@ -157,7 +157,7 @@ suite('Linting - Linter Commands', () => { const linters: ILinterInfo[] = [{ id: '1' }, { id: '2' }, { id: '3', product: 'Three' }] as any; const activeLinters: ILinterInfo[] = [{ id: '1' }, { id: '3' }] as any; when(manager.getAllLinterInfos()).thenReturn(linters); - when(manager.getActiveLinters(true, anything())).thenResolve(activeLinters); + when(manager.getActiveLinters(anything())).thenResolve(activeLinters); when(shell.showQuickPick(anything(), anything())).thenResolve('3' as any); when(shell.showWarningMessage(anything(), 'Yes', 'No')).thenResolve('Yes' as any); const expectedQuickPickOptions = { diff --git a/src/test/linters/linterManager.unit.test.ts b/src/test/linters/linterManager.unit.test.ts index 85409edd05d7..9fe79c87887e 100644 --- a/src/test/linters/linterManager.unit.test.ts +++ b/src/test/linters/linterManager.unit.test.ts @@ -39,9 +39,6 @@ suite('Linting - Linter Manager', () => { class LinterManagerTest extends LinterManager { // Override base class property to make it public. public linters!: ILinterInfo[]; - public async enableUnconfiguredLinters(resource?: Uri) { - await super.enableUnconfiguredLinters(resource); - } } setup(() => { const svcContainer = mock(ServiceContainer); @@ -57,7 +54,7 @@ suite('Linting - Linter Manager', () => { when(svcContainer.get(ILintingEngine)).thenReturn(instance(lintingEngine)); when(svcContainer.get(IConfigurationService)).thenReturn(instance(configService)); when(svcContainer.get(IWorkspaceService)).thenReturn(instance(workspaceService)); - linterManager = new LinterManagerTest(instance(svcContainer), instance(workspaceService)); + linterManager = new LinterManagerTest(instance(configService)); }); test('Get all linters will return a list of all linters', () => { @@ -109,27 +106,11 @@ suite('Linting - Linter Manager', () => { linterManager.linters = [instanceOfLinterInfo]; when(linterInfo.isEnabled(resource)).thenReturn(true); - const linters = await linterManager.getActiveLinters(true, resource); + const linters = await linterManager.getActiveLinters(resource); verify(linterInfo.isEnabled(resource)).once(); expect(linters[0]).to.deep.equal(instanceOfLinterInfo); }); - test(`getActiveLinters will check if linter is enabled and not in silent mode ${testResourceSuffix}`, async () => { - const linterInfo = mock(LinterInfo); - const instanceOfLinterInfo = instance(linterInfo); - linterManager.linters = [instanceOfLinterInfo]; - when(linterInfo.isEnabled(resource)).thenReturn(true); - let enableUnconfiguredLintersInvoked = false; - linterManager.enableUnconfiguredLinters = async () => { - enableUnconfiguredLintersInvoked = true; - }; - - const linters = await linterManager.getActiveLinters(false, resource); - - verify(linterInfo.isEnabled(resource)).once(); - expect(linters[0]).to.deep.equal(instanceOfLinterInfo); - expect(enableUnconfiguredLintersInvoked).to.equal(true, 'not invoked'); - }); test(`setActiveLintersAsync with invalid products does nothing ${testResourceSuffix}`, async () => { let getActiveLintersInvoked = false; @@ -138,7 +119,7 @@ suite('Linting - Linter Manager', () => { return []; }; - await linterManager.setActiveLintersAsync([Product.ctags, Product.pytest], resource); + await linterManager.setActiveLintersAsync([Product.pytest], resource); expect(getActiveLintersInvoked).to.be.equal(false, 'Should not be invoked'); }); diff --git a/src/test/linters/linterinfo.unit.test.ts b/src/test/linters/linterinfo.unit.test.ts deleted file mode 100644 index 31c3b4d18499..000000000000 --- a/src/test/linters/linterinfo.unit.test.ts +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -'use strict'; - -import { expect } from 'chai'; -import * as sinon from 'sinon'; -import { anything, instance, mock, when } from 'ts-mockito'; -import { LanguageServerType } from '../../client/activation/types'; -import { WorkspaceService } from '../../client/common/application/workspace'; -import { ConfigurationService } from '../../client/common/configuration/service'; -import { PylintLinterInfo } from '../../client/linters/linterInfo'; - -suite('Linter Info - Pylint', () => { - const workspace = mock(WorkspaceService); - const config = mock(ConfigurationService); - - test('Test disabled when Pylint is explicitly disabled', async () => { - const linterInfo = new PylintLinterInfo(instance(config), instance(workspace), []); - - when(config.getSettings(anything())).thenReturn({ - linting: { pylintEnabled: false }, - languageServer: LanguageServerType.Jedi, - } as any); - - expect(linterInfo.isEnabled()).to.be.false; - }); - test('Test disabled when Jedi is enabled and Pylint is explicitly disabled', async () => { - const linterInfo = new PylintLinterInfo(instance(config), instance(workspace), []); - - when(config.getSettings(anything())).thenReturn({ - linting: { pylintEnabled: false }, - languageServer: LanguageServerType.Jedi, - } as any); - - expect(linterInfo.isEnabled()).to.be.false; - }); - test('Test enabled when Jedi is enabled and Pylint is explicitly enabled', async () => { - const linterInfo = new PylintLinterInfo(instance(config), instance(workspace), []); - - when(config.getSettings(anything())).thenReturn({ - linting: { pylintEnabled: true }, - languageServer: LanguageServerType.Jedi, - } as any); - - expect(linterInfo.isEnabled()).to.be.true; - }); - test('Test disabled when using language server and Pylint is not configured', async () => { - const linterInfo = new PylintLinterInfo(instance(config), instance(workspace), []); - - when(config.getSettings(anything())).thenReturn({ - linting: { pylintEnabled: true }, - languageServer: LanguageServerType.Microsoft, - } as any); - - const pythonConfig = { - inspect: () => {}, - }; - when(workspace.getConfiguration('python', anything())).thenReturn(pythonConfig as any); - - expect(linterInfo.isEnabled()).to.be.false; - }); - test('Should inspect the value of linting.pylintEnabled when using language server', async () => { - const linterInfo = new PylintLinterInfo(instance(config), instance(workspace), []); - const inspectStub = sinon.stub(); - const pythonConfig = { - inspect: inspectStub, - }; - - when(config.getSettings(anything())).thenReturn({ - linting: { pylintEnabled: true }, - languageServer: LanguageServerType.Microsoft, - } as any); - when(workspace.getConfiguration('python', anything())).thenReturn(pythonConfig as any); - - expect(linterInfo.isEnabled()).to.be.false; - expect(inspectStub.calledOnceWith('linting.pylintEnabled')).to.be.true; - }); - const testsForisEnabled = [ - { - testName: 'When workspaceFolder setting is provided', - inspection: { workspaceFolderValue: true }, - }, - { - testName: 'When workspace setting is provided', - inspection: { workspaceValue: true }, - }, - { - testName: 'When global setting is provided', - inspection: { globalValue: true }, - }, - ]; - - suite('Test is enabled when using Language Server and Pylint is configured', () => { - testsForisEnabled.forEach((testParams) => { - test(testParams.testName, async () => { - const config = mock(ConfigurationService); - const workspaceService = mock(WorkspaceService); - const linterInfo = new PylintLinterInfo(instance(config), instance(workspaceService), []); - - const pythonConfig = { - inspect: () => testParams.inspection, - }; - when(config.getSettings(anything())).thenReturn({ - linting: { pylintEnabled: true }, - languageServer: LanguageServerType.Microsoft, - } as any); - when(workspaceService.getConfiguration('python', anything())).thenReturn(pythonConfig as any); - - expect(linterInfo.isEnabled()).to.be.true; - }); - }); - }); -}); diff --git a/src/test/linters/pylint.test.ts b/src/test/linters/pylint.test.ts index e0be3f77bdc2..0973df35d854 100644 --- a/src/test/linters/pylint.test.ts +++ b/src/test/linters/pylint.test.ts @@ -84,7 +84,7 @@ suite('Linting - Pylint', () => { workspace.setup((w) => w.getConfiguration('python')).returns(() => workspaceConfig.object); serviceManager.addSingletonInstance(IConfigurationService, config.object); - const linterManager = new LinterManager(serviceContainer, workspace.object); + const linterManager = new LinterManager(config.object); serviceManager.addSingletonInstance(ILinterManager, linterManager); const installer = TypeMoq.Mock.ofType(); serviceManager.addSingletonInstance(IInstaller, installer.object); diff --git a/src/test/linters/pylint.unit.test.ts b/src/test/linters/pylint.unit.test.ts index 2bb3f17a29ba..46321f9787e2 100644 --- a/src/test/linters/pylint.unit.test.ts +++ b/src/test/linters/pylint.unit.test.ts @@ -27,7 +27,12 @@ suite('Pylint - Function runLinter()', () => { const doc = { uri: vscode.Uri.file('path/to/doc'), }; - + const args = [ + "--msg-template='{line},{column},{category},{symbol}:{msg}'", + '--reports=n', + '--output-format=text', + doc.uri.fsPath, + ]; class PylintTest extends Pylint { public async run( _args: string[], @@ -85,6 +90,25 @@ suite('Pylint - Function runLinter()', () => { sinon.restore(); }); + test('Test pylint with default settings.', async () => { + const settings = { + linting: { + pylintEnabled: true, + }, + }; + configService.setup((c) => c.getSettings(doc.uri)).returns(() => settings as any); + _info.setup((info) => info.linterArgs(doc.uri)).returns(() => []); + run = sinon.stub(PylintTest.prototype, 'run'); + run.callsFake(() => Promise.resolve([])); + parseMessagesSeverity = sinon.stub(PylintTest.prototype, 'parseMessagesSeverity'); + parseMessagesSeverity.callsFake(() => 'Severity'); + const pylint = new PylintTest(output.object, serviceContainer.object); + await pylint.runLinter(doc as any, mock(vscode.CancellationTokenSource).token); + assert.deepEqual(run.args[0][0], args); + assert.ok(parseMessagesSeverity.notCalled); + assert.ok(run.calledOnce); + }); + test('Message returned by runLinter() is as expected', async () => { const message = [ { @@ -97,7 +121,11 @@ suite('Pylint - Function runLinter()', () => { severity: 'LintMessageSeverity', }, ]; - const settings = { linting: {} }; + const settings = { + linting: { + pylintEnabled: true, + }, + }; configService.setup((c) => c.getSettings(doc.uri)).returns(() => settings as any); _info.setup((info) => info.linterArgs(doc.uri)).returns(() => []); run = sinon.stub(PylintTest.prototype, 'run'); diff --git a/src/test/multiRootWkspc/disableLinters/.vscode/tags b/src/test/multiRootWkspc/disableLinters/.vscode/tags deleted file mode 100644 index 4739b4629cfb..000000000000 --- a/src/test/multiRootWkspc/disableLinters/.vscode/tags +++ /dev/null @@ -1,19 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ -!_TAG_PROGRAM_AUTHOR Universal Ctags Team // -!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ -!_TAG_PROGRAM_URL https://ctags.io/ /official site/ -!_TAG_PROGRAM_VERSION 0.0.0 /f9e6e3c1/ -Foo ..\\file.py /^class Foo(object):$/;" kind:class line:5 -__init__ ..\\file.py /^ def __init__(self):$/;" kind:member line:8 -__revision__ ..\\file.py /^__revision__ = None$/;" kind:variable line:3 -file.py ..\\file.py 1;" kind:file line:1 -meth1 ..\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth2 ..\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth3 ..\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth4 ..\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth5 ..\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth6 ..\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth7 ..\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth8 ..\\file.py /^ def meth8(self):$/;" kind:member line:80 diff --git a/src/test/multiRootWkspc/multi.code-workspace b/src/test/multiRootWkspc/multi.code-workspace index 6a9901d9df65..5c90439e5546 100644 --- a/src/test/multiRootWkspc/multi.code-workspace +++ b/src/test/multiRootWkspc/multi.code-workspace @@ -25,6 +25,5 @@ "python.linting.pylintEnabled": false, "python.linting.pycodestyleEnabled": true, "python.linting.prospectorEnabled": true, - "python.workspaceSymbols.enabled": true } } diff --git a/src/test/multiRootWkspc/parent/child/.vscode/settings.json b/src/test/multiRootWkspc/parent/child/.vscode/settings.json index 656ad4032082..0967ef424bce 100644 --- a/src/test/multiRootWkspc/parent/child/.vscode/settings.json +++ b/src/test/multiRootWkspc/parent/child/.vscode/settings.json @@ -1,3 +1 @@ -{ - "python.workspaceSymbols.enabled": true -} +{} diff --git a/src/test/multiRootWkspc/parent/child/.vscode/tags b/src/test/multiRootWkspc/parent/child/.vscode/tags deleted file mode 100644 index e6791c755b0f..000000000000 --- a/src/test/multiRootWkspc/parent/child/.vscode/tags +++ /dev/null @@ -1,24 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ -!_TAG_PROGRAM_AUTHOR Universal Ctags Team // -!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ -!_TAG_PROGRAM_URL https://ctags.io/ /official site/ -!_TAG_PROGRAM_VERSION 0.0.0 /f9e6e3c1/ -Child2Class ..\\childFile.py /^class Child2Class(object):$/;" kind:class line:5 -Foo ..\\file.py /^class Foo(object):$/;" kind:class line:5 -__init__ ..\\childFile.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\file.py /^ def __init__(self):$/;" kind:member line:8 -__revision__ ..\\childFile.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\file.py /^__revision__ = None$/;" kind:variable line:3 -childFile.py ..\\childFile.py 1;" kind:file line:1 -file.py ..\\file.py 1;" kind:file line:1 -meth1 ..\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1OfChild ..\\childFile.py /^ def meth1OfChild(self, arg):$/;" kind:member line:11 -meth2 ..\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth3 ..\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth4 ..\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth5 ..\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth6 ..\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth7 ..\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth8 ..\\file.py /^ def meth8(self):$/;" kind:member line:80 diff --git a/src/test/multiRootWkspc/workspace1/.vscode/tags b/src/test/multiRootWkspc/workspace1/.vscode/tags deleted file mode 100644 index 4739b4629cfb..000000000000 --- a/src/test/multiRootWkspc/workspace1/.vscode/tags +++ /dev/null @@ -1,19 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ -!_TAG_PROGRAM_AUTHOR Universal Ctags Team // -!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ -!_TAG_PROGRAM_URL https://ctags.io/ /official site/ -!_TAG_PROGRAM_VERSION 0.0.0 /f9e6e3c1/ -Foo ..\\file.py /^class Foo(object):$/;" kind:class line:5 -__init__ ..\\file.py /^ def __init__(self):$/;" kind:member line:8 -__revision__ ..\\file.py /^__revision__ = None$/;" kind:variable line:3 -file.py ..\\file.py 1;" kind:file line:1 -meth1 ..\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth2 ..\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth3 ..\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth4 ..\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth5 ..\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth6 ..\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth7 ..\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth8 ..\\file.py /^ def meth8(self):$/;" kind:member line:80 diff --git a/src/test/multiRootWkspc/workspace2/.vscode/settings.json b/src/test/multiRootWkspc/workspace2/.vscode/settings.json index 385728982cfa..0967ef424bce 100644 --- a/src/test/multiRootWkspc/workspace2/.vscode/settings.json +++ b/src/test/multiRootWkspc/workspace2/.vscode/settings.json @@ -1,4 +1 @@ -{ - "python.workspaceSymbols.tagFilePath": "${workspaceRoot}/workspace2.tags.file", - "python.workspaceSymbols.enabled": true -} +{} diff --git a/src/test/multiRootWkspc/workspace2/workspace2.tags.file b/src/test/multiRootWkspc/workspace2/workspace2.tags.file deleted file mode 100644 index 2d54e7ed7c7b..000000000000 --- a/src/test/multiRootWkspc/workspace2/workspace2.tags.file +++ /dev/null @@ -1,24 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ -!_TAG_PROGRAM_AUTHOR Universal Ctags Team // -!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ -!_TAG_PROGRAM_URL https://ctags.io/ /official site/ -!_TAG_PROGRAM_VERSION 0.0.0 /f9e6e3c1/ -Foo C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\file.py /^class Foo(object):$/;" kind:class line:5 -Workspace2Class C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\workspace2File.py /^class Workspace2Class(object):$/;" kind:class line:5 -__init__ C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\workspace2File.py /^ def __init__(self):$/;" kind:member line:8 -__revision__ C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\workspace2File.py /^__revision__ = None$/;" kind:variable line:3 -file.py C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\file.py 1;" kind:file line:1 -meth1 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1OfWorkspace2 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\workspace2File.py /^ def meth1OfWorkspace2(self, arg):$/;" kind:member line:11 -meth2 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth3 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth4 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth5 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth6 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth7 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth8 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\file.py /^ def meth8(self):$/;" kind:member line:80 -workspace2File.py C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace2\\workspace2File.py 1;" kind:file line:1 diff --git a/src/test/multiRootWkspc/workspace3/.vscode/settings.json b/src/test/multiRootWkspc/workspace3/.vscode/settings.json index 8779a0c08efe..0967ef424bce 100644 --- a/src/test/multiRootWkspc/workspace3/.vscode/settings.json +++ b/src/test/multiRootWkspc/workspace3/.vscode/settings.json @@ -1,3 +1 @@ -{ - "python.workspaceSymbols.tagFilePath": "${workspaceRoot}/workspace3.tags.file" -} +{} diff --git a/src/test/multiRootWkspc/workspace3/workspace3.tags.file b/src/test/multiRootWkspc/workspace3/workspace3.tags.file deleted file mode 100644 index 9a141392d6ae..000000000000 --- a/src/test/multiRootWkspc/workspace3/workspace3.tags.file +++ /dev/null @@ -1,19 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ -!_TAG_PROGRAM_AUTHOR Universal Ctags Team // -!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ -!_TAG_PROGRAM_URL https://ctags.io/ /official site/ -!_TAG_PROGRAM_VERSION 0.0.0 /f9e6e3c1/ -Foo C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace3\\file.py /^class Foo(object):$/;" kind:class line:5 -__init__ C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace3\\file.py /^ def __init__(self):$/;" kind:member line:8 -__revision__ C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace3\\file.py /^__revision__ = None$/;" kind:variable line:3 -file.py C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace3\\file.py 1;" kind:file line:1 -meth1 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace3\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth2 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace3\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth3 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace3\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth4 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace3\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth5 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace3\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth6 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace3\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth7 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace3\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth8 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\test\\multiRootWkspc\\workspace3\\file.py /^ def meth8(self):$/;" kind:member line:80 diff --git a/src/test/pythonFiles/refactoring/source folder/.vscode/.ropeproject/config.py b/src/test/pythonFiles/refactoring/source folder/.vscode/.ropeproject/config.py new file mode 100644 index 000000000000..dee2d1ae9a6b --- /dev/null +++ b/src/test/pythonFiles/refactoring/source folder/.vscode/.ropeproject/config.py @@ -0,0 +1,114 @@ +# The default ``config.py`` +# flake8: noqa + + +def set_prefs(prefs): + """This function is called before opening the project""" + + # Specify which files and folders to ignore in the project. + # Changes to ignored resources are not added to the history and + # VCSs. Also they are not returned in `Project.get_files()`. + # Note that ``?`` and ``*`` match all characters but slashes. + # '*.pyc': matches 'test.pyc' and 'pkg/test.pyc' + # 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc' + # '.svn': matches 'pkg/.svn' and all of its children + # 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o' + # 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o' + prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject', + '.hg', '.svn', '_svn', '.git', '.tox'] + + # Specifies which files should be considered python files. It is + # useful when you have scripts inside your project. Only files + # ending with ``.py`` are considered to be python files by + # default. + # prefs['python_files'] = ['*.py'] + + # Custom source folders: By default rope searches the project + # for finding source folders (folders that should be searched + # for finding modules). You can add paths to that list. Note + # that rope guesses project source folders correctly most of the + # time; use this if you have any problems. + # The folders should be relative to project root and use '/' for + # separating folders regardless of the platform rope is running on. + # 'src/my_source_folder' for instance. + # prefs.add('source_folders', 'src') + + # You can extend python path for looking up modules + # prefs.add('python_path', '~/python/') + + # Should rope save object information or not. + prefs['save_objectdb'] = True + prefs['compress_objectdb'] = False + + # If `True`, rope analyzes each module when it is being saved. + prefs['automatic_soa'] = True + # The depth of calls to follow in static object analysis + prefs['soa_followed_calls'] = 0 + + # If `False` when running modules or unit tests "dynamic object + # analysis" is turned off. This makes them much faster. + prefs['perform_doa'] = True + + # Rope can check the validity of its object DB when running. + prefs['validate_objectdb'] = True + + # How many undos to hold? + prefs['max_history_items'] = 32 + + # Shows whether to save history across sessions. + prefs['save_history'] = True + prefs['compress_history'] = False + + # Set the number spaces used for indenting. According to + # :PEP:`8`, it is best to use 4 spaces. Since most of rope's + # unit-tests use 4 spaces it is more reliable, too. + prefs['indent_size'] = 4 + + # Builtin and c-extension modules that are allowed to be imported + # and inspected by rope. + prefs['extension_modules'] = [] + + # Add all standard c-extensions to extension_modules list. + prefs['import_dynload_stdmods'] = True + + # If `True` modules with syntax errors are considered to be empty. + # The default value is `False`; When `False` syntax errors raise + # `rope.base.exceptions.ModuleSyntaxError` exception. + prefs['ignore_syntax_errors'] = False + + # If `True`, rope ignores unresolvable imports. Otherwise, they + # appear in the importing namespace. + prefs['ignore_bad_imports'] = False + + # If `True`, rope will insert new module imports as + # `from import ` by default. + prefs['prefer_module_from_imports'] = False + + # If `True`, rope will transform a comma list of imports into + # multiple separate import statements when organizing + # imports. + prefs['split_imports'] = False + + # If `True`, rope will remove all top-level import statements and + # reinsert them at the top of the module when making changes. + prefs['pull_imports_to_top'] = True + + # If `True`, rope will sort imports alphabetically by module name instead + # of alphabetically by import statement, with from imports after normal + # imports. + prefs['sort_imports_alphabetically'] = False + + # Location of implementation of + # rope.base.oi.type_hinting.interfaces.ITypeHintingFactory In general + # case, you don't have to change this value, unless you're an rope expert. + # Change this value to inject you own implementations of interfaces + # listed in module rope.base.oi.type_hinting.providers.interfaces + # For example, you can add you own providers for Django Models, or disable + # the search type-hinting in a class hierarchy, etc. + prefs['type_hinting_factory'] = ( + 'rope.base.oi.type_hinting.factory.default_type_hinting_factory') + + +def project_opened(project): + """This function is called after opening the project""" + # Do whatever you like here! diff --git a/src/test/pythonFiles/refactoring/source folder/.vscode/.ropeproject/objectdb b/src/test/pythonFiles/refactoring/source folder/.vscode/.ropeproject/objectdb new file mode 100644 index 000000000000..0a47446c0ad2 Binary files /dev/null and b/src/test/pythonFiles/refactoring/source folder/.vscode/.ropeproject/objectdb differ diff --git a/src/test/pythonFiles/refactoring/source folder/with empty line.py b/src/test/pythonFiles/refactoring/source folder/with empty line.py deleted file mode 100644 index 01ed75727900..000000000000 --- a/src/test/pythonFiles/refactoring/source folder/with empty line.py +++ /dev/null @@ -1,8 +0,0 @@ -import os - -def one(): - return True - -def two(): - if one(): - print("A" + one()) diff --git a/src/test/pythonFiles/refactoring/source folder/without empty line.py b/src/test/pythonFiles/refactoring/source folder/without empty line.py deleted file mode 100644 index a449eb106f5c..000000000000 --- a/src/test/pythonFiles/refactoring/source folder/without empty line.py +++ /dev/null @@ -1,8 +0,0 @@ -import os - -def one(): - return True - -def two(): - if one(): - print("A" + one()) \ No newline at end of file diff --git a/src/test/pythonFiles/refactoring/standAlone/refactor.py b/src/test/pythonFiles/refactoring/standAlone/refactor.py deleted file mode 100644 index ee941dd45ebf..000000000000 --- a/src/test/pythonFiles/refactoring/standAlone/refactor.py +++ /dev/null @@ -1,245 +0,0 @@ -# Arguments are: -# 1. Working directory. -# 2. Rope folder - -import io -import sys -import json -import traceback -import rope - -from rope.base import libutils -from rope.refactor.rename import Rename -from rope.refactor.extract import ExtractMethod, ExtractVariable -import rope.base.project -import rope.base.taskhandle - -WORKSPACE_ROOT = sys.argv[1] -ROPE_PROJECT_FOLDER = sys.argv[2] - - -class RefactorProgress(): - """ - Refactor progress information - """ - - def __init__(self, name='Task Name', message=None, percent=0): - self.name = name - self.message = message - self.percent = percent - - -class ChangeType(): - """ - Change Type Enum - """ - EDIT = 0 - NEW = 1 - DELETE = 2 - - -class Change(): - """ - """ - EDIT = 0 - NEW = 1 - DELETE = 2 - - def __init__(self, filePath, fileMode=ChangeType.EDIT, diff=""): - self.filePath = filePath - self.diff = diff - self.fileMode = fileMode - - -class BaseRefactoring(object): - """ - Base class for refactorings - """ - - def __init__(self, project, resource, name="Refactor", progressCallback=None): - self._progressCallback = progressCallback - self._handle = rope.base.taskhandle.TaskHandle(name) - self._handle.add_observer(self._update_progress) - self.project = project - self.resource = resource - self.changes = [] - - def _update_progress(self): - jobset = self._handle.current_jobset() - if jobset and not self._progressCallback is None: - progress = RefactorProgress() - # getting current job set name - if jobset.get_name() is not None: - progress.name = jobset.get_name() - # getting active job name - if jobset.get_active_job_name() is not None: - progress.message = jobset.get_active_job_name() - # adding done percent - percent = jobset.get_percent_done() - if percent is not None: - progress.percent = percent - if not self._progressCallback is None: - self._progressCallback(progress) - - def stop(self): - self._handle.stop() - - def refactor(self): - try: - self.onRefactor() - except rope.base.exceptions.InterruptedTaskError: - # we can ignore this exception, as user has cancelled refactoring - pass - - def onRefactor(self): - """ - To be implemented by each base class - """ - pass - - -class RenameRefactor(BaseRefactoring): - - def __init__(self, project, resource, name="Rename", progressCallback=None, startOffset=None, newName="new_Name"): - BaseRefactoring.__init__(self, project, resource, - name, progressCallback) - self._newName = newName - self.startOffset = startOffset - - def onRefactor(self): - renamed = Rename(self.project, self.resource, self.startOffset) - changes = renamed.get_changes(self._newName, task_handle=self._handle) - for item in changes.changes: - if isinstance(item, rope.base.change.ChangeContents): - self.changes.append( - Change(item.resource.real_path, ChangeType.EDIT, item.get_description())) - else: - raise Exception('Unknown Change') - - -class ExtractVariableRefactor(BaseRefactoring): - - def __init__(self, project, resource, name="Extract Variable", progressCallback=None, startOffset=None, endOffset=None, newName="new_Name", similar=False, global_=False): - BaseRefactoring.__init__(self, project, resource, - name, progressCallback) - self._newName = newName - self._startOffset = startOffset - self._endOffset = endOffset - self._similar = similar - self._global = global_ - - def onRefactor(self): - renamed = ExtractVariable( - self.project, self.resource, self._startOffset, self._endOffset) - changes = renamed.get_changes( - self._newName, self._similar, self._global) - for item in changes.changes: - if isinstance(item, rope.base.change.ChangeContents): - self.changes.append( - Change(item.resource.real_path, ChangeType.EDIT, item.get_description())) - else: - raise Exception('Unknown Change') - - -class ExtractMethodRefactor(ExtractVariableRefactor): - - def __init__(self, project, resource, name="Extract Method", progressCallback=None, startOffset=None, endOffset=None, newName="new_Name", similar=False, global_=False): - ExtractVariableRefactor.__init__(self, project, resource, - name, progressCallback, startOffset=startOffset, endOffset=endOffset, newName=newName, similar=similar, global_=global_) - def onRefactor(self): - renamed = ExtractMethod( - self.project, self.resource, self._startOffset, self._endOffset) - changes = renamed.get_changes( - self._newName, self._similar, self._global) - for item in changes.changes: - if isinstance(item, rope.base.change.ChangeContents): - self.changes.append( - Change(item.resource.real_path, ChangeType.EDIT, item.get_description())) - else: - raise Exception('Unknown Change') - - -class RopeRefactoring(object): - - def __init__(self): - self.default_sys_path = sys.path - self._input = io.open(sys.stdin.fileno(), encoding='utf-8') - - def _extractVariable(self, filePath, start, end, newName): - """ - Extracts a variable - """ - project = rope.base.project.Project(WORKSPACE_ROOT, ropefolder=ROPE_PROJECT_FOLDER, save_history=False) - resourceToRefactor = libutils.path_to_resource(project, filePath) - refactor = ExtractVariableRefactor(project, resourceToRefactor, startOffset=start, endOffset=end, newName=newName) - refactor.refactor() - changes = refactor.changes - project.close() - valueToReturn = [] - for change in changes: - valueToReturn.append({'diff':change.diff}) - return valueToReturn - - def _extractMethod(self, filePath, start, end, newName): - """ - Extracts a method - """ - project = rope.base.project.Project(WORKSPACE_ROOT, ropefolder=ROPE_PROJECT_FOLDER, save_history=False) - resourceToRefactor = libutils.path_to_resource(project, filePath) - refactor = ExtractMethodRefactor(project, resourceToRefactor, startOffset=start, endOffset=end, newName=newName) - refactor.refactor() - changes = refactor.changes - project.close() - valueToReturn = [] - for change in changes: - valueToReturn.append({'diff':change.diff}) - return valueToReturn - - def _serialize(self, identifier, results): - """ - Serializes the refactor results - """ - return json.dumps({'id': identifier, 'results': results}) - - def _deserialize(self, request): - """Deserialize request from VSCode. - - Args: - request: String with raw request from VSCode. - - Returns: - Python dictionary with request data. - """ - return json.loads(request) - - def _process_request(self, request): - """Accept serialized request from VSCode and write response. - """ - request = self._deserialize(request) - lookup = request.get('lookup', '') - - if lookup == '': - pass - elif lookup == 'extract_variable': - changes = self._extractVariable(request['file'], int(request['start']), int(request['end']), request['name']) - return self._write_response(self._serialize(request['id'], changes)) - elif lookup == 'extract_method': - changes = self._extractMethod(request['file'], int(request['start']), int(request['end']), request['name']) - return self._write_response(self._serialize(request['id'], changes)) - - def _write_response(self, response): - sys.stdout.write(response + '\n') - sys.stdout.flush() - - def watch(self): - self._write_response("STARTED") - while True: - try: - self._process_request(self._input.readline()) - except Exception as ex: - message = ex.message + ' \n' + traceback.format_exc() - sys.stderr.write(str(len(message)) + ':' + message) - sys.stderr.flush() - -if __name__ == '__main__': - RopeRefactoring().watch() diff --git a/src/test/refactor/extension.refactor.extract.method.test.ts b/src/test/refactor/extension.refactor.extract.method.test.ts deleted file mode 100644 index 6fe8b13c57e6..000000000000 --- a/src/test/refactor/extension.refactor.extract.method.test.ts +++ /dev/null @@ -1,201 +0,0 @@ -import * as assert from 'assert'; -import * as fs from 'fs-extra'; -import * as path from 'path'; -import { instance, mock } from 'ts-mockito'; -import { - commands, - Position, - Range, - Selection, - TextEditorCursorStyle, - TextEditorLineNumbersStyle, - TextEditorOptions, - Uri, - window, - workspace, -} from 'vscode'; -import { getTextEditsFromPatch } from '../../client/common/editor'; -import { IPythonExecutionFactory, IPythonExecutionService } from '../../client/common/process/types'; -import { ICondaService, IInterpreterService } from '../../client/interpreter/contracts'; -import { InterpreterService } from '../../client/interpreter/interpreterService'; -import { extractMethod } from '../../client/providers/simpleRefactorProvider'; -import { CondaService } from '../../client/pythonEnvironments/discovery/locators/services/condaService'; -import { RefactorProxy } from '../../client/refactor/proxy'; -import { UnitTestIocContainer } from '../testing/serviceRegistry'; -import { closeActiveWindows, initialize, initializeTest } from './../initialize'; -import { MockOutputChannel } from './../mockClasses'; - -const refactorSourceFile = path.join( - __dirname, - '..', - '..', - '..', - 'src', - 'test', - 'pythonFiles', - 'refactoring', - 'standAlone', - 'refactor.py', -); -const refactorTargetFileDir = path.join( - __dirname, - '..', - '..', - '..', - 'out', - 'test', - 'pythonFiles', - 'refactoring', - 'standAlone', -); - -interface RenameResponse { - results: [{ diff: string }]; -} - -suite('Method Extraction', () => { - // Hack hac hack - const oldExecuteCommand = commands.executeCommand; - const options: TextEditorOptions = { - cursorStyle: TextEditorCursorStyle.Line, - insertSpaces: true, - lineNumbers: TextEditorLineNumbersStyle.Off, - tabSize: 4, - }; - let refactorTargetFile = ''; - let ioc: UnitTestIocContainer; - suiteSetup(initialize); - suiteTeardown(() => { - commands.executeCommand = oldExecuteCommand; - return closeActiveWindows(); - }); - setup(async () => { - await initializeDI(); - refactorTargetFile = path.join(refactorTargetFileDir, `refactor${new Date().getTime()}.py`); - fs.copySync(refactorSourceFile, refactorTargetFile, { overwrite: true }); - await initializeTest(); - (commands as any).executeCommand = (_cmd: any) => Promise.resolve(); - }); - teardown(async () => { - commands.executeCommand = oldExecuteCommand; - try { - await fs.unlink(refactorTargetFile); - } catch {} - await closeActiveWindows(); - }); - async function initializeDI() { - ioc = new UnitTestIocContainer(); - ioc.registerCommonTypes(); - ioc.registerProcessTypes(); - ioc.registerVariableTypes(); - ioc.registerInterpreterStorageTypes(); - await ioc.registerMockInterpreterTypes(); - ioc.serviceManager.rebindInstance(ICondaService, instance(mock(CondaService))); - ioc.serviceManager.rebindInstance(IInterpreterService, instance(mock(InterpreterService))); - } - function createPythonExecGetter(workspaceRoot: string): () => Promise { - return async () => { - const factory = ioc.serviceContainer.get(IPythonExecutionFactory); - return factory.create({ resource: Uri.file(workspaceRoot) }); - }; - } - - async function testingMethodExtraction(shouldError: boolean, startPos: Position, endPos: Position): Promise { - const rangeOfTextToExtract = new Range(startPos, endPos); - const workspaceRoot = path.dirname(refactorTargetFile); - const proxy = new RefactorProxy(workspaceRoot, createPythonExecGetter(workspaceRoot)); - - const DIFF = `--- a/refactor.py\n+++ b/refactor.py\n@@ -237,9 +237,12 @@\n try:\n self._process_request(self._input.readline())\n except Exception as ex:\n- message = ex.message + ' \\n' + traceback.format_exc()\n- sys.stderr.write(str(len(message)) + ':' + message)\n- sys.stderr.flush()\n+ self.myNewMethod(ex)\n+\n+ def myNewMethod(self, ex):\n+ message = ex.message + ' \\n' + traceback.format_exc()\n+ sys.stderr.write(str(len(message)) + ':' + message)\n+ sys.stderr.flush()\n \n if __name__ == '__main__':\n RopeRefactoring().watch()\n`; - const mockTextDoc = await workspace.openTextDocument(refactorTargetFile); - const expectedTextEdits = getTextEditsFromPatch(mockTextDoc.getText(), DIFF); - try { - const response = await proxy.extractMethod( - mockTextDoc, - 'myNewMethod', - refactorTargetFile, - rangeOfTextToExtract, - options, - ); - if (shouldError) { - assert.fail('No error', 'Error', 'Extraction should fail with an error', ''); - } - const textEdits = getTextEditsFromPatch(mockTextDoc.getText(), DIFF); - assert.equal(response.results.length, 1, 'Invalid number of items in response'); - assert.equal(textEdits.length, expectedTextEdits.length, 'Invalid number of Text Edits'); - textEdits.forEach((edit) => { - const foundEdit = expectedTextEdits.filter( - (item) => item.newText === edit.newText && item.range.isEqual(edit.range), - ); - assert.equal(foundEdit.length, 1, 'Edit not found'); - }); - } catch (error) { - if (!shouldError) { - // Wait a minute this shouldn't work, what's going on - assert.equal('Error', 'No error', `${error}`); - } - } - } - - test('Extract Method', async () => { - const startPos = new Position(239, 0); - const endPos = new Position(241, 35); - await testingMethodExtraction(false, startPos, endPos); - }); - - test('Extract Method will fail if complete statements are not selected', async () => { - const startPos = new Position(239, 30); - const endPos = new Position(241, 35); - await testingMethodExtraction(true, startPos, endPos); - }); - - async function testingMethodExtractionEndToEnd( - shouldError: boolean, - startPos: Position, - endPos: Position, - ): Promise { - const ch = new MockOutputChannel('Python'); - const rangeOfTextToExtract = new Range(startPos, endPos); - - const textDocument = await workspace.openTextDocument(refactorTargetFile); - const editor = await window.showTextDocument(textDocument); - - editor.selections = [new Selection(rangeOfTextToExtract.start, rangeOfTextToExtract.end)]; - editor.selection = new Selection(rangeOfTextToExtract.start, rangeOfTextToExtract.end); - - try { - await extractMethod(editor, rangeOfTextToExtract, ch, ioc.serviceContainer); - if (shouldError) { - assert.fail('No error', 'Error', 'Extraction should fail with an error', ''); - } - - const newMethodRefLine = textDocument.lineAt(editor.selection.start); - assert.equal(ch.output.length, 0, 'Output channel is not empty'); - assert.equal( - textDocument - .lineAt(newMethodRefLine.lineNumber + 2) - .text.trim() - .indexOf('def newmethod'), - 0, - 'New Method not created', - ); - assert.equal(newMethodRefLine.text.trim().startsWith('self.newmethod'), true, 'New Method not being used'); - } catch (error) { - if (!shouldError) { - assert.equal('Error', 'No error', `${error}`); - } - } - } - - // This test fails on linux (text document not getting updated in time) - test('Extract Method (end to end)', async () => { - const startPos = new Position(239, 0); - const endPos = new Position(241, 35); - await testingMethodExtractionEndToEnd(false, startPos, endPos); - }); - - test('Extract Method will fail if complete statements are not selected', async () => { - const startPos = new Position(239, 30); - const endPos = new Position(241, 35); - await testingMethodExtractionEndToEnd(true, startPos, endPos); - }); -}); diff --git a/src/test/refactor/extension.refactor.extract.var.test.ts b/src/test/refactor/extension.refactor.extract.var.test.ts deleted file mode 100644 index 737d1eae8026..000000000000 --- a/src/test/refactor/extension.refactor.extract.var.test.ts +++ /dev/null @@ -1,202 +0,0 @@ -import * as assert from 'assert'; -import * as fs from 'fs-extra'; -import * as path from 'path'; -import { - commands, - Position, - Range, - Selection, - TextEditorCursorStyle, - TextEditorLineNumbersStyle, - TextEditorOptions, - Uri, - window, - workspace, -} from 'vscode'; -import { getTextEditsFromPatch } from '../../client/common/editor'; -import { IPythonExecutionFactory, IPythonExecutionService } from '../../client/common/process/types'; -import { extractVariable } from '../../client/providers/simpleRefactorProvider'; -import { RefactorProxy } from '../../client/refactor/proxy'; -import { isPythonVersion } from '../common'; -import { UnitTestIocContainer } from '../testing/serviceRegistry'; -import { closeActiveWindows, initialize, initializeTest, IS_CI_SERVER } from './../initialize'; -import { MockOutputChannel } from './../mockClasses'; - -const refactorSourceFile = path.join( - __dirname, - '..', - '..', - '..', - 'src', - 'test', - 'pythonFiles', - 'refactoring', - 'standAlone', - 'refactor.py', -); -const refactorTargetFileDir = path.join( - __dirname, - '..', - '..', - '..', - 'out', - 'test', - 'pythonFiles', - 'refactoring', - 'standAlone', -); - -interface RenameResponse { - results: [{ diff: string }]; -} - -suite('Variable Extraction', () => { - // Hack hac hack - const oldExecuteCommand = commands.executeCommand; - const options: TextEditorOptions = { - cursorStyle: TextEditorCursorStyle.Line, - insertSpaces: true, - lineNumbers: TextEditorLineNumbersStyle.Off, - tabSize: 4, - }; - let refactorTargetFile = ''; - let ioc: UnitTestIocContainer; - suiteSetup(initialize); - suiteTeardown(() => { - commands.executeCommand = oldExecuteCommand; - return closeActiveWindows(); - }); - setup(async () => { - await initializeDI(); - refactorTargetFile = path.join(refactorTargetFileDir, `refactor${new Date().getTime()}.py`); - fs.copySync(refactorSourceFile, refactorTargetFile, { overwrite: true }); - await initializeTest(); - (commands).executeCommand = (_cmd: any) => Promise.resolve(); - }); - teardown(async () => { - commands.executeCommand = oldExecuteCommand; - try { - await fs.unlink(refactorTargetFile); - } catch {} - await closeActiveWindows(); - }); - async function initializeDI() { - ioc = new UnitTestIocContainer(); - ioc.registerCommonTypes(); - ioc.registerProcessTypes(); - ioc.registerVariableTypes(); - ioc.registerInterpreterStorageTypes(); - await ioc.registerMockInterpreterTypes(); - } - function createPythonExecGetter(workspaceRoot: string): () => Promise { - return async () => { - const factory = ioc.serviceContainer.get(IPythonExecutionFactory); - return factory.create({ resource: Uri.file(workspaceRoot) }); - }; - } - - async function testingVariableExtraction( - shouldError: boolean, - startPos: Position, - endPos: Position, - ): Promise { - const rangeOfTextToExtract = new Range(startPos, endPos); - const workspaceRoot = path.dirname(refactorTargetFile); - const proxy = new RefactorProxy(workspaceRoot, createPythonExecGetter(workspaceRoot)); - - const DIFF = - '--- a/refactor.py\n+++ b/refactor.py\n@@ -232,7 +232,8 @@\n sys.stdout.flush()\n \n def watch(self):\n- self._write_response("STARTED")\n+ myNewVariable = "STARTED"\n+ self._write_response(myNewVariable)\n while True:\n try:\n self._process_request(self._input.readline())\n'; - const mockTextDoc = await workspace.openTextDocument(refactorTargetFile); - const expectedTextEdits = getTextEditsFromPatch(mockTextDoc.getText(), DIFF); - try { - const response = await proxy.extractVariable( - mockTextDoc, - 'myNewVariable', - refactorTargetFile, - rangeOfTextToExtract, - options, - ); - if (shouldError) { - assert.fail('No error', 'Error', 'Extraction should fail with an error', ''); - } - const textEdits = getTextEditsFromPatch(mockTextDoc.getText(), DIFF); - assert.equal(response.results.length, 1, 'Invalid number of items in response'); - assert.equal(textEdits.length, expectedTextEdits.length, 'Invalid number of Text Edits'); - textEdits.forEach((edit) => { - const foundEdit = expectedTextEdits.filter( - (item) => item.newText === edit.newText && item.range.isEqual(edit.range), - ); - assert.equal(foundEdit.length, 1, 'Edit not found'); - }); - } catch (error) { - if (!shouldError) { - assert.equal('Error', 'No error', `${error}`); - } - } - } - - test('Extract Variable', async function () { - if (isPythonVersion('3.7')) { - return this.skip(); - } else { - const startPos = new Position(234, 29); - const endPos = new Position(234, 38); - await testingVariableExtraction(false, startPos, endPos); - } - }); - - test('Extract Variable fails if whole string not selected', async () => { - const startPos = new Position(234, 20); - const endPos = new Position(234, 38); - await testingVariableExtraction(true, startPos, endPos); - }); - - async function testingVariableExtractionEndToEnd( - shouldError: boolean, - startPos: Position, - endPos: Position, - ): Promise { - const ch = new MockOutputChannel('Python'); - const rangeOfTextToExtract = new Range(startPos, endPos); - - const textDocument = await workspace.openTextDocument(refactorTargetFile); - const editor = await window.showTextDocument(textDocument); - - editor.selections = [new Selection(rangeOfTextToExtract.start, rangeOfTextToExtract.end)]; - editor.selection = new Selection(rangeOfTextToExtract.start, rangeOfTextToExtract.end); - try { - await extractVariable(editor, rangeOfTextToExtract, ch, ioc.serviceContainer); - if (shouldError) { - assert.fail('No error', 'Error', 'Extraction should fail with an error', ''); - } - assert.equal(ch.output.length, 0, 'Output channel is not empty'); - - const newVarDefLine = textDocument.lineAt(editor.selection.start); - const newVarRefLine = textDocument.lineAt(newVarDefLine.lineNumber + 1); - - assert.equal(newVarDefLine.text.trim().indexOf('newvariable'), 0, 'New Variable not created'); - assert.equal(newVarDefLine.text.trim().endsWith('= "STARTED"'), true, 'Started Text Assigned to variable'); - assert.equal(newVarRefLine.text.indexOf('(newvariable') >= 0, true, 'New Variable not being used'); - } catch (error) { - if (!shouldError) { - assert.fail('Error', 'No error', `${error}`); - } - } - } - - // This test fails on linux (text document not getting updated in time) - test('Extract Variable (end to end)', async function () { - if (!IS_CI_SERVER) { - return this.skip(); - } - const startPos = new Position(234, 29); - const endPos = new Position(234, 38); - await testingVariableExtractionEndToEnd(false, startPos, endPos); - }); - - test('Extract Variable fails if whole string not selected (end to end)', async () => { - const startPos = new Position(234, 20); - const endPos = new Position(234, 38); - await testingVariableExtractionEndToEnd(true, startPos, endPos); - }); -}); diff --git a/src/test/refactor/rename.test.ts b/src/test/refactor/rename.test.ts deleted file mode 100644 index fd91b6e4dea8..000000000000 --- a/src/test/refactor/rename.test.ts +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -'use strict'; - -import { expect } from 'chai'; -import { EOL } from 'os'; -import * as path from 'path'; -import { anything, instance, mock, when } from 'ts-mockito'; -import * as typeMoq from 'typemoq'; -import { - Range, - TextEditorCursorStyle, - TextEditorLineNumbersStyle, - TextEditorOptions, - Uri, - window, - workspace, -} from 'vscode'; -import { EXTENSION_ROOT_DIR } from '../../client/common/constants'; -import { DiscoveryVariants } from '../../client/common/experiments/groups'; -import '../../client/common/extensions'; -import { BufferDecoder } from '../../client/common/process/decoder'; -import { ProcessService } from '../../client/common/process/proc'; -import { PythonExecutionFactory } from '../../client/common/process/pythonExecutionFactory'; -import { - IProcessLogger, - IProcessServiceFactory, - IPythonExecutionFactory, - IPythonExecutionService, -} from '../../client/common/process/types'; -import { - IConfigurationService, - IExperimentService, - IInterpreterPathProxyService, - IPythonSettings, -} from '../../client/common/types'; -import { IEnvironmentActivationService } from '../../client/interpreter/activation/types'; -import { IInterpreterAutoSelectionService } from '../../client/interpreter/autoSelection/types'; -import { IComponentAdapter, ICondaService, IInterpreterService } from '../../client/interpreter/contracts'; -import { IServiceContainer } from '../../client/ioc/types'; -import { RefactorProxy } from '../../client/refactor/proxy'; -import { PYTHON_PATH } from '../common'; -import { closeActiveWindows, initialize, initializeTest } from '../initialize'; - -type RenameResponse = { - results: [{ diff: string }]; -}; - -suite('Refactor Rename', () => { - const options: TextEditorOptions = { - cursorStyle: TextEditorCursorStyle.Line, - insertSpaces: true, - lineNumbers: TextEditorLineNumbersStyle.Off, - tabSize: 4, - }; - let pythonSettings: typeMoq.IMock; - let serviceContainer: typeMoq.IMock; - suiteSetup(initialize); - setup(async () => { - pythonSettings = typeMoq.Mock.ofType(); - pythonSettings.setup((p) => p.pythonPath).returns(() => PYTHON_PATH); - const configService = typeMoq.Mock.ofType(); - configService.setup((c) => c.getSettings(typeMoq.It.isAny())).returns(() => pythonSettings.object); - const condaService = typeMoq.Mock.ofType(); - const experimentService = typeMoq.Mock.ofType(); - const processServiceFactory = typeMoq.Mock.ofType(); - processServiceFactory - .setup((p) => p.create(typeMoq.It.isAny())) - .returns(() => Promise.resolve(new ProcessService(new BufferDecoder()))); - const interpreterService = typeMoq.Mock.ofType(); - interpreterService.setup((i) => i.hasInterpreters()).returns(() => Promise.resolve(true)); - const envActivationService = typeMoq.Mock.ofType(); - envActivationService - .setup((e) => e.getActivatedEnvironmentVariables(typeMoq.It.isAny())) - .returns(() => Promise.resolve(undefined)); - envActivationService - .setup((e) => e.getActivatedEnvironmentVariables(typeMoq.It.isAny(), typeMoq.It.isAny())) - .returns(() => Promise.resolve(undefined)); - envActivationService - .setup((e) => - e.getActivatedEnvironmentVariables(typeMoq.It.isAny(), typeMoq.It.isAny(), typeMoq.It.isAny()), - ) - .returns(() => Promise.resolve(undefined)); - serviceContainer = typeMoq.Mock.ofType(); - serviceContainer - .setup((s) => s.get(typeMoq.It.isValue(IConfigurationService), typeMoq.It.isAny())) - .returns(() => configService.object); - serviceContainer - .setup((s) => s.get(typeMoq.It.isValue(IProcessServiceFactory), typeMoq.It.isAny())) - .returns(() => processServiceFactory.object); - serviceContainer - .setup((s) => s.get(typeMoq.It.isValue(IInterpreterService), typeMoq.It.isAny())) - .returns(() => interpreterService.object); - serviceContainer - .setup((s) => s.get(typeMoq.It.isValue(IEnvironmentActivationService), typeMoq.It.isAny())) - .returns(() => envActivationService.object); - - const pyenvs: IComponentAdapter = mock(); - - experimentService - .setup((e) => e.inExperiment(DiscoveryVariants.discoverWithFileWatching)) - .returns(() => Promise.resolve(false)); - - const autoSelection = mock(); - const interpreterPathExpHelper = mock(); - when(interpreterPathExpHelper.get(anything())).thenReturn('selected interpreter path'); - - serviceContainer - .setup((s) => s.get(typeMoq.It.isValue(IPythonExecutionFactory), typeMoq.It.isAny())) - .returns( - () => - new PythonExecutionFactory( - serviceContainer.object, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - undefined as any, - processServiceFactory.object, - configService.object, - condaService.object, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - undefined as any, - instance(pyenvs), - experimentService.object, - instance(autoSelection), - instance(interpreterPathExpHelper), - ), - ); - const processLogger = typeMoq.Mock.ofType(); - processLogger - .setup((p) => p.logProcess(typeMoq.It.isAny(), typeMoq.It.isAny(), typeMoq.It.isAny())) - .returns(() => { - /** No body */ - }); - serviceContainer - .setup((s) => s.get(typeMoq.It.isValue(IProcessLogger), typeMoq.It.isAny())) - .returns(() => processLogger.object); - await initializeTest(); - }); - teardown(closeActiveWindows); - suiteTeardown(closeActiveWindows); - function createPythonExecGetter(workspaceRoot: string): () => Promise { - return async () => { - const factory = serviceContainer.object.get(IPythonExecutionFactory); - return factory.create({ resource: Uri.file(workspaceRoot) }); - }; - } - - test('Rename function in source without a trailing empty line', async () => { - const sourceFile = path.join( - EXTENSION_ROOT_DIR, - 'src', - 'test', - 'pythonFiles', - 'refactoring', - 'source folder', - 'without empty line.py', - ); - const expectedDiff = `--- a/${path.basename(sourceFile)}${EOL}+++ b/${path.basename( - sourceFile, - )}${EOL}@@ -1,8 +1,8 @@${EOL} import os${EOL} ${EOL}-def one():${EOL}+def three():${EOL} return True${EOL} ${EOL} def two():${EOL}- if one():${EOL}- print(\"A\" + one())${EOL}+ if three():${EOL}+ print(\"A\" + three())${EOL}`.splitLines( - { removeEmptyEntries: false, trim: false }, - ); - const workspaceRoot = path.dirname(sourceFile); - - const proxy = new RefactorProxy(workspaceRoot, createPythonExecGetter(workspaceRoot)); - const textDocument = await workspace.openTextDocument(sourceFile); - await window.showTextDocument(textDocument); - - const response = await proxy.rename( - textDocument, - 'three', - sourceFile, - new Range(7, 20, 7, 23), - options, - ); - expect(response.results).to.be.lengthOf(1); - expect(response.results[0].diff.splitLines({ removeEmptyEntries: false, trim: false })).to.be.deep.equal( - expectedDiff, - ); - }); - test('Rename function in source with a trailing empty line', async () => { - const sourceFile = path.join( - EXTENSION_ROOT_DIR, - 'src', - 'test', - 'pythonFiles', - 'refactoring', - 'source folder', - 'with empty line.py', - ); - const expectedDiff = `--- a/${path.basename(sourceFile)}${EOL}+++ b/${path.basename( - sourceFile, - )}${EOL}@@ -1,8 +1,8 @@${EOL} import os${EOL} ${EOL}-def one():${EOL}+def three():${EOL} return True${EOL} ${EOL} def two():${EOL}- if one():${EOL}- print(\"A\" + one())${EOL}+ if three():${EOL}+ print(\"A\" + three())${EOL}`.splitLines( - { removeEmptyEntries: false, trim: false }, - ); - const workspaceRoot = path.dirname(sourceFile); - - const proxy = new RefactorProxy(workspaceRoot, createPythonExecGetter(workspaceRoot)); - const textDocument = await workspace.openTextDocument(sourceFile); - await window.showTextDocument(textDocument); - - const response = await proxy.rename( - textDocument, - 'three', - sourceFile, - new Range(7, 20, 7, 23), - options, - ); - expect(response.results).to.be.lengthOf(1); - expect(response.results[0].diff.splitLines({ removeEmptyEntries: false, trim: false })).to.be.deep.equal( - expectedDiff, - ); - }); -}); diff --git a/src/test/workspaceSymbols/common.ts b/src/test/workspaceSymbols/common.ts deleted file mode 100644 index 765c586cc4da..000000000000 --- a/src/test/workspaceSymbols/common.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ConfigurationTarget, Uri, workspace } from 'vscode'; -import { PythonSettings } from '../../client/common/configSettings'; - -export async function enableDisableWorkspaceSymbols( - resource: Uri, - enabled: boolean, - configTarget: ConfigurationTarget, -) { - const settings = workspace.getConfiguration('python', resource); - await settings.update('workspaceSymbols.enabled', enabled, configTarget); - PythonSettings.dispose(); -} diff --git a/src/test/workspaceSymbols/generator.unit.test.ts b/src/test/workspaceSymbols/generator.unit.test.ts deleted file mode 100644 index fdd8785836d3..000000000000 --- a/src/test/workspaceSymbols/generator.unit.test.ts +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -'use strict'; - -import { expect, use } from 'chai'; -import * as chaiAsPromised from 'chai-as-promised'; -import * as path from 'path'; -import { anything, instance, mock, verify, when } from 'ts-mockito'; -import * as typemoq from 'typemoq'; -import { Uri } from 'vscode'; -import { ApplicationShell } from '../../client/common/application/applicationShell'; -import { IApplicationShell } from '../../client/common/application/types'; -import { ConfigurationService } from '../../client/common/configuration/service'; -import { FileSystem } from '../../client/common/platform/fileSystem'; -import { IFileSystem } from '../../client/common/platform/types'; -import { ProcessService } from '../../client/common/process/proc'; -import { IProcessService, IProcessServiceFactory, Output } from '../../client/common/process/types'; -import { IConfigurationService, IOutputChannel, IPythonSettings } from '../../client/common/types'; -import { Generator } from '../../client/workspaceSymbols/generator'; -use(chaiAsPromised); - -suite('Workspace Symbols Generator', () => { - let configurationService: IConfigurationService; - let pythonSettings: typemoq.IMock; - let generator: Generator; - let factory: typemoq.IMock; - let shell: IApplicationShell; - let processService: IProcessService; - let fs: IFileSystem; - const folderUri = Uri.parse(path.join('a', 'b', 'c')); - setup(() => { - pythonSettings = typemoq.Mock.ofType(); - configurationService = mock(ConfigurationService); - factory = typemoq.Mock.ofType(); - shell = mock(ApplicationShell); - fs = mock(FileSystem); - processService = mock(ProcessService); - factory.setup((f) => f.create(typemoq.It.isAny())).returns(() => Promise.resolve(instance(processService))); - when(configurationService.getSettings(anything())).thenReturn(pythonSettings.object); - const outputChannel = typemoq.Mock.ofType(); - generator = new Generator( - folderUri, - outputChannel.object, - instance(shell), - instance(fs), - factory.object, - instance(configurationService), - ); - }); - test('should be disabled', () => { - const workspaceSymbols = { enabled: false } as any; - pythonSettings.setup((p) => p.workspaceSymbols).returns(() => workspaceSymbols); - - expect(generator.enabled).to.be.equal(false, 'not disabled'); - }); - test('should be enabled', () => { - const workspaceSymbols = { enabled: true } as any; - pythonSettings.setup((p) => p.workspaceSymbols).returns(() => workspaceSymbols); - - expect(generator.enabled).to.be.equal(true, 'not enabled'); - }); - test('Check tagFilePath', () => { - const workspaceSymbols = { tagFilePath: '1234' } as any; - pythonSettings.setup((p) => p.workspaceSymbols).returns(() => workspaceSymbols); - - expect(generator.tagFilePath).to.be.equal('1234'); - }); - test('Throw error when generating tags', async () => { - const ctagsPath = 'CTAG_PATH'; - const workspaceSymbols = { - enabled: true, - tagFilePath: '1234', - exclusionPatterns: [], - ctagsPath, - } as any; - pythonSettings.setup((p) => p.workspaceSymbols).returns(() => workspaceSymbols); - when(fs.directoryExists(anything())).thenResolve(true); - const observable = { - out: { - subscribe: (cb: (out: Output) => void, _errorCb: any, done: Function) => { - cb({ source: 'stderr', out: 'KABOOM' }); - done(); - }, - }, - }; - when(processService.execObservable(ctagsPath, anything(), anything())).thenReturn(observable as any); - - const promise = generator.generateWorkspaceTags(); - await expect(promise).to.eventually.be.rejectedWith('KABOOM'); - verify(shell.setStatusBarMessage(anything(), anything())).once(); - }); - test('Does not throw error when generating tags', async () => { - const ctagsPath = 'CTAG_PATH'; - const workspaceSymbols = { - enabled: true, - tagFilePath: '1234', - exclusionPatterns: [], - ctagsPath, - } as any; - pythonSettings.setup((p) => p.workspaceSymbols).returns(() => workspaceSymbols); - when(fs.directoryExists(anything())).thenResolve(true); - const observable = { - out: { - subscribe: (cb: (out: Output) => void, _errorCb: any, done: Function) => { - cb({ source: 'stdout', out: '' }); - done(); - }, - }, - }; - when(processService.execObservable(ctagsPath, anything(), anything())).thenReturn(observable as any); - - await generator.generateWorkspaceTags(); - verify(shell.setStatusBarMessage(anything(), anything())).once(); - }); -}); diff --git a/src/test/workspaceSymbols/main.unit.test.ts b/src/test/workspaceSymbols/main.unit.test.ts deleted file mode 100644 index d6113658aa39..000000000000 --- a/src/test/workspaceSymbols/main.unit.test.ts +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -'use strict'; - -import * as assert from 'assert'; -import { expect, use } from 'chai'; -import * as chaiAsPromised from 'chai-as-promised'; -import { anyString, anything, instance, mock, reset, verify, when } from 'ts-mockito'; -import { EventEmitter, TextDocument, Uri, WorkspaceFolder } from 'vscode'; -import { ApplicationShell } from '../../client/common/application/applicationShell'; -import { CommandManager } from '../../client/common/application/commandManager'; -import { DocumentManager } from '../../client/common/application/documentManager'; -import { - IApplicationShell, - ICommandManager, - IDocumentManager, - IWorkspaceService, -} from '../../client/common/application/types'; -import { WorkspaceService } from '../../client/common/application/workspace'; -import { ConfigurationService } from '../../client/common/configuration/service'; -import { Commands, STANDARD_OUTPUT_CHANNEL } from '../../client/common/constants'; -import { FileSystem } from '../../client/common/platform/fileSystem'; -import { IFileSystem } from '../../client/common/platform/types'; -import { ProcessService } from '../../client/common/process/proc'; -import { ProcessServiceFactory } from '../../client/common/process/processFactory'; -import { IProcessService, IProcessServiceFactory, Output } from '../../client/common/process/types'; -import { IConfigurationService, IOutputChannel } from '../../client/common/types'; -import { sleep } from '../../client/common/utils/async'; -import { ServiceContainer } from '../../client/ioc/container'; -import { IServiceContainer } from '../../client/ioc/types'; -import { WorkspaceSymbols } from '../../client/workspaceSymbols/main'; -import { MockOutputChannel } from '../mockClasses'; - -use(chaiAsPromised); - -suite('Workspace symbols main', () => { - const mockDisposable = { - dispose: () => { - return; - }, - }; - const ctagsPath = 'CTAG_PATH'; - const observable = { - out: { - subscribe: (cb: (out: Output) => void, _errorCb: any, done: Function) => { - cb({ source: 'stdout', out: '' }); - done(); - }, - }, - }; - - let outputChannel: IOutputChannel; - let commandManager: ICommandManager; - let fileSystem: IFileSystem; - let workspaceService: IWorkspaceService; - let processServiceFactory: IProcessServiceFactory; - let processService: IProcessService; - let applicationShell: IApplicationShell; - let configurationService: IConfigurationService; - let documentManager: IDocumentManager; - let serviceContainer: IServiceContainer; - let workspaceFolders: WorkspaceFolder[]; - let workspaceSymbols: WorkspaceSymbols; - let shellOutput: string; - let eventEmitter: EventEmitter; - - setup(() => { - eventEmitter = new EventEmitter(); - shellOutput = ''; - workspaceFolders = [{ name: 'root', index: 0, uri: Uri.file('folder') }]; - - outputChannel = mock(MockOutputChannel); - commandManager = mock(CommandManager); - fileSystem = mock(FileSystem); - workspaceService = mock(WorkspaceService); - processServiceFactory = mock(ProcessServiceFactory); - processService = mock(ProcessService); - applicationShell = mock(ApplicationShell); - configurationService = mock(ConfigurationService); - documentManager = mock(DocumentManager); - serviceContainer = mock(ServiceContainer); - - when(workspaceService.onDidChangeWorkspaceFolders).thenReturn(() => mockDisposable as any); - when(documentManager.onDidSaveTextDocument).thenReturn(eventEmitter.event); - when(commandManager.registerCommand(anything(), anything())).thenReturn(mockDisposable as any); - when(fileSystem.directoryExists(anything())).thenResolve(true); - when(fileSystem.fileExists(anything())).thenResolve(false); - when(processServiceFactory.create()).thenResolve(instance(processService)); - when(processService.execObservable(ctagsPath, anything(), anything())).thenReturn(observable as any); - when(applicationShell.setStatusBarMessage(anyString(), anything())).thenCall((text: string) => { - shellOutput += text; - return mockDisposable; - }); - - when(serviceContainer.get(IOutputChannel, STANDARD_OUTPUT_CHANNEL)).thenReturn( - instance(outputChannel), - ); - when(serviceContainer.get(ICommandManager)).thenReturn(instance(commandManager)); - when(serviceContainer.get(IFileSystem)).thenReturn(instance(fileSystem)); - when(serviceContainer.get(IWorkspaceService)).thenReturn(instance(workspaceService)); - when(serviceContainer.get(IProcessServiceFactory)).thenReturn( - instance(processServiceFactory), - ); - when(serviceContainer.get(IApplicationShell)).thenReturn(instance(applicationShell)); - when(serviceContainer.get(IConfigurationService)).thenReturn( - instance(configurationService), - ); - when(serviceContainer.get(IDocumentManager)).thenReturn(instance(documentManager)); - }); - - teardown(() => { - workspaceSymbols.dispose(); - }); - - test('Should not rebuild on start if the setting is disabled', () => { - when(workspaceService.workspaceFolders).thenReturn(workspaceFolders); - when(configurationService.getSettings(anything())).thenReturn({ - workspaceSymbols: { rebuildOnStart: false }, - } as any); - - workspaceSymbols = new WorkspaceSymbols(instance(serviceContainer)); - - assert.equal(shellOutput, ''); - }); - - test("Should not rebuild on start if we don't have a workspace folder", () => { - when(workspaceService.workspaceFolders).thenReturn([]); - when(configurationService.getSettings(anything())).thenReturn({ - workspaceSymbols: { rebuildOnStart: false }, - } as any); - - workspaceSymbols = new WorkspaceSymbols(instance(serviceContainer)); - - assert.equal(shellOutput, ''); - }); - - test('Should rebuild on start if the setting is enabled and we have a workspace folder', async () => { - when(workspaceService.workspaceFolders).thenReturn(workspaceFolders); - when(configurationService.getSettings(anything())).thenReturn({ - workspaceSymbols: { - ctagsPath, - enabled: true, - exclusionPatterns: [], - rebuildOnStart: true, - tagFilePath: 'foo', - }, - } as any); - - workspaceSymbols = new WorkspaceSymbols(instance(serviceContainer)); - await sleep(1); - - assert.equal(shellOutput, 'Generating Tags'); - }); - - test('Should rebuild on save if the setting is enabled', async () => { - when(workspaceService.workspaceFolders).thenReturn(workspaceFolders); - when(workspaceService.getWorkspaceFolder(anything())).thenReturn(workspaceFolders[0]); - when(configurationService.getSettings(anything())).thenReturn({ - workspaceSymbols: { - ctagsPath, - enabled: true, - exclusionPatterns: [], - rebuildOnFileSave: true, - tagFilePath: 'foo', - }, - } as any); - - workspaceSymbols = new WorkspaceSymbols(instance(serviceContainer)); - eventEmitter.fire({ uri: Uri.file('folder') } as any); - await sleep(1); - - assert.equal(shellOutput, 'Generating Tags'); - }); - - test('Command `Build Workspace symbols` is registered with the correct callback handlers and executing it returns `undefined` list if generating workspace tags fails with error', async () => { - let buildWorkspaceSymbolsHandler!: Function; - when(workspaceService.workspaceFolders).thenReturn(workspaceFolders); - when(workspaceService.getWorkspaceFolder(anything())).thenReturn(workspaceFolders[0]); - when(configurationService.getSettings(anything())).thenReturn({ - workspaceSymbols: { - ctagsPath, - enabled: true, - exclusionPatterns: [], - rebuildOnFileSave: true, - tagFilePath: 'foo', - }, - } as any); - reset(commandManager); - when(commandManager.registerCommand(anything(), anything())).thenCall((commandID, cb) => { - expect(commandID).to.equal(Commands.Build_Workspace_Symbols); - buildWorkspaceSymbolsHandler = cb; - return mockDisposable; - }); - reset(applicationShell); - when(applicationShell.setStatusBarMessage(anyString(), anything())).thenThrow( - new Error('Generating workspace tags failed with Error'), - ); - - workspaceSymbols = new WorkspaceSymbols(instance(serviceContainer)); - expect(buildWorkspaceSymbolsHandler).to.not.equal(undefined, 'Handler not registered'); - const symbols = await buildWorkspaceSymbolsHandler(); - - verify(commandManager.registerCommand(anything(), anything())).once(); - assert.deepEqual(symbols, [undefined]); - }); - - test('Should not rebuild on save if the setting is disabled', () => { - when(workspaceService.workspaceFolders).thenReturn(workspaceFolders); - when(configurationService.getSettings(anything())).thenReturn({ - workspaceSymbols: { - ctagsPath, - enabled: true, - exclusionPatterns: [], - rebuildOnFileSave: false, - tagFilePath: 'foo', - }, - } as any); - - workspaceSymbols = new WorkspaceSymbols(instance(serviceContainer)); - - assert.equal(shellOutput, ''); - }); -}); diff --git a/src/test/workspaceSymbols/provider.unit.test.ts b/src/test/workspaceSymbols/provider.unit.test.ts deleted file mode 100644 index fc179238b53c..000000000000 --- a/src/test/workspaceSymbols/provider.unit.test.ts +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -'use strict'; - -import * as assert from 'assert'; -import { expect, use } from 'chai'; -import * as chaiAsPromised from 'chai-as-promised'; -import * as path from 'path'; -import { anything, instance, mock, verify, when } from 'ts-mockito'; -import { CancellationTokenSource, Uri } from 'vscode'; -import { CommandManager } from '../../client/common/application/commandManager'; -import { ICommandManager } from '../../client/common/application/types'; -import { Commands } from '../../client/common/constants'; -import { FileSystem } from '../../client/common/platform/fileSystem'; -import { IFileSystem } from '../../client/common/platform/types'; -import { Generator } from '../../client/workspaceSymbols/generator'; -import { WorkspaceSymbolProvider } from '../../client/workspaceSymbols/provider'; -use(chaiAsPromised); - -const workspaceUri = Uri.file(path.join(__dirname, '..', '..', '..', 'src', 'test')); - -suite('Workspace Symbols Provider', () => { - let generator: Generator; - let fs: IFileSystem; - let commandManager: ICommandManager; - setup(() => { - fs = mock(FileSystem); - commandManager = mock(CommandManager); - generator = mock(Generator); - }); - test('Returns 0 tags without any generators', async () => { - const provider = new WorkspaceSymbolProvider(instance(fs), instance(commandManager), []); - - const tags = await provider.provideWorkspaceSymbols('', new CancellationTokenSource().token); - - expect(tags).to.be.lengthOf(0); - }); - test("Builds tags when a tag file doesn't exist", async () => { - const provider = new WorkspaceSymbolProvider(instance(fs), instance(commandManager), [instance(generator)]); - const tagFilePath = 'No existing tagFilePath'; - when(generator.tagFilePath).thenReturn(tagFilePath); - when(fs.fileExists(tagFilePath)).thenResolve(false); - when(commandManager.executeCommand(Commands.Build_Workspace_Symbols, true, anything())).thenResolve(); - - const tags = await provider.provideWorkspaceSymbols('', new CancellationTokenSource().token); - - expect(tags).to.be.lengthOf(0); - verify(commandManager.executeCommand(Commands.Build_Workspace_Symbols, true, anything())).once(); - }); - test("Builds tags when a tag file doesn't exist", async () => { - const provider = new WorkspaceSymbolProvider(instance(fs), instance(commandManager), [instance(generator)]); - const tagFilePath = 'No existing tagFilePath'; - when(generator.tagFilePath).thenReturn(tagFilePath); - when(fs.fileExists(tagFilePath)).thenResolve(false); - when(commandManager.executeCommand(Commands.Build_Workspace_Symbols, true, anything())).thenResolve(); - - const tags = await provider.provideWorkspaceSymbols('', new CancellationTokenSource().token); - - expect(tags).to.be.lengthOf(0); - verify(commandManager.executeCommand(Commands.Build_Workspace_Symbols, true, anything())).once(); - }); - test('Symbols should not be returned when disabled', async () => { - const provider = new WorkspaceSymbolProvider(instance(fs), instance(commandManager), [instance(generator)]); - const tagFilePath = 'existing tagFilePath'; - when(generator.tagFilePath).thenReturn(tagFilePath); - when(generator.enabled).thenReturn(false); - when(fs.fileExists(tagFilePath)).thenResolve(true); - when(commandManager.executeCommand(Commands.Build_Workspace_Symbols, true, anything())).thenResolve(); - - const tags = await provider.provideWorkspaceSymbols('', new CancellationTokenSource().token); - - expect(tags).to.be.lengthOf(0); - verify(commandManager.executeCommand(Commands.Build_Workspace_Symbols, true, anything())).never(); - }); - test('symbols should be returned when enabled and vice versa', async () => { - const provider = new WorkspaceSymbolProvider(instance(fs), instance(commandManager), [instance(generator)]); - const tagFilePath = path.join(workspaceUri.fsPath, '.vscode', 'tags'); - when(generator.tagFilePath).thenReturn(tagFilePath); - when(generator.workspaceFolder).thenReturn(workspaceUri); - when(generator.enabled).thenReturn(true); - when(fs.fileExists(tagFilePath)).thenResolve(true); - when(commandManager.executeCommand(Commands.Build_Workspace_Symbols, true, anything())).thenResolve(); - - const tags = await provider.provideWorkspaceSymbols('', new CancellationTokenSource().token); - - expect(tags.length).to.be.greaterThan(99); - verify(commandManager.executeCommand(Commands.Build_Workspace_Symbols, true, anything())).never(); - }); - test('symbols should be filtered correctly', async () => { - const provider = new WorkspaceSymbolProvider(instance(fs), instance(commandManager), [instance(generator)]); - const tagFilePath = path.join(workspaceUri.fsPath, '.vscode', 'tags'); - when(generator.tagFilePath).thenReturn(tagFilePath); - when(generator.workspaceFolder).thenReturn(workspaceUri); - when(generator.enabled).thenReturn(true); - when(fs.fileExists(tagFilePath)).thenResolve(true); - when(commandManager.executeCommand(Commands.Build_Workspace_Symbols, true, anything())).thenResolve(); - - const symbols = await provider.provideWorkspaceSymbols('meth1Of', new CancellationTokenSource().token); - - expect(symbols).to.be.length.greaterThan(0); - verify(commandManager.executeCommand(Commands.Build_Workspace_Symbols, true, anything())).never(); - - assert.equal(symbols.length >= 2, true, 'Incorrect number of symbols returned'); - assert.notEqual( - symbols.findIndex((sym) => sym.location.uri.fsPath.endsWith('childFile.py')), - -1, - 'File with symbol not found in child workspace folder', - ); - assert.notEqual( - symbols.findIndex((sym) => sym.location.uri.fsPath.endsWith('workspace2File.py')), - -1, - 'File with symbol not found in child workspace folder', - ); - - const symbolsForMeth = await provider.provideWorkspaceSymbols('meth', new CancellationTokenSource().token); - assert.equal(symbolsForMeth.length >= 10, true, 'Incorrect number of symbols returned'); - assert.notEqual( - symbolsForMeth.findIndex((sym) => sym.location.uri.fsPath.endsWith('childFile.py')), - -1, - 'Symbols not returned for childFile.py', - ); - assert.notEqual( - symbolsForMeth.findIndex((sym) => sym.location.uri.fsPath.endsWith('workspace2File.py')), - -1, - 'Symbols not returned for workspace2File.py', - ); - assert.notEqual( - symbolsForMeth.findIndex((sym) => sym.location.uri.fsPath.endsWith('file.py')), - -1, - 'Symbols not returned for file.py', - ); - }); -}); diff --git a/src/testMultiRootWkspc/disableLinters/.vscode/tags b/src/testMultiRootWkspc/disableLinters/.vscode/tags deleted file mode 100644 index 4739b4629cfb..000000000000 --- a/src/testMultiRootWkspc/disableLinters/.vscode/tags +++ /dev/null @@ -1,19 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ -!_TAG_PROGRAM_AUTHOR Universal Ctags Team // -!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ -!_TAG_PROGRAM_URL https://ctags.io/ /official site/ -!_TAG_PROGRAM_VERSION 0.0.0 /f9e6e3c1/ -Foo ..\\file.py /^class Foo(object):$/;" kind:class line:5 -__init__ ..\\file.py /^ def __init__(self):$/;" kind:member line:8 -__revision__ ..\\file.py /^__revision__ = None$/;" kind:variable line:3 -file.py ..\\file.py 1;" kind:file line:1 -meth1 ..\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth2 ..\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth3 ..\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth4 ..\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth5 ..\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth6 ..\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth7 ..\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth8 ..\\file.py /^ def meth8(self):$/;" kind:member line:80 diff --git a/src/testMultiRootWkspc/multi.code-workspace b/src/testMultiRootWkspc/multi.code-workspace index 9d64c3f8b53b..1daf409a0836 100644 --- a/src/testMultiRootWkspc/multi.code-workspace +++ b/src/testMultiRootWkspc/multi.code-workspace @@ -37,7 +37,6 @@ "python.linting.pylintEnabled": true, "python.linting.pycodestyleEnabled": false, "python.linting.prospectorEnabled": false, - "python.workspaceSymbols.enabled": false, "python.formatting.provider": "yapf", "python.sortImports.args": [ "-sp", diff --git a/src/testMultiRootWkspc/parent/child/.vscode/settings.json b/src/testMultiRootWkspc/parent/child/.vscode/settings.json index 2c4fa010619f..0967ef424bce 100644 --- a/src/testMultiRootWkspc/parent/child/.vscode/settings.json +++ b/src/testMultiRootWkspc/parent/child/.vscode/settings.json @@ -1,3 +1 @@ -{ - "python.workspaceSymbols.enabled": false -} +{} diff --git a/src/testMultiRootWkspc/parent/child/.vscode/tags b/src/testMultiRootWkspc/parent/child/.vscode/tags deleted file mode 100644 index e6791c755b0f..000000000000 --- a/src/testMultiRootWkspc/parent/child/.vscode/tags +++ /dev/null @@ -1,24 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ -!_TAG_PROGRAM_AUTHOR Universal Ctags Team // -!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ -!_TAG_PROGRAM_URL https://ctags.io/ /official site/ -!_TAG_PROGRAM_VERSION 0.0.0 /f9e6e3c1/ -Child2Class ..\\childFile.py /^class Child2Class(object):$/;" kind:class line:5 -Foo ..\\file.py /^class Foo(object):$/;" kind:class line:5 -__init__ ..\\childFile.py /^ def __init__(self):$/;" kind:member line:8 -__init__ ..\\file.py /^ def __init__(self):$/;" kind:member line:8 -__revision__ ..\\childFile.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ ..\\file.py /^__revision__ = None$/;" kind:variable line:3 -childFile.py ..\\childFile.py 1;" kind:file line:1 -file.py ..\\file.py 1;" kind:file line:1 -meth1 ..\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1OfChild ..\\childFile.py /^ def meth1OfChild(self, arg):$/;" kind:member line:11 -meth2 ..\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth3 ..\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth4 ..\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth5 ..\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth6 ..\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth7 ..\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth8 ..\\file.py /^ def meth8(self):$/;" kind:member line:80 diff --git a/src/testMultiRootWkspc/workspace1/.vscode/.ropeproject/config.py b/src/testMultiRootWkspc/workspace1/.vscode/.ropeproject/config.py new file mode 100644 index 000000000000..dee2d1ae9a6b --- /dev/null +++ b/src/testMultiRootWkspc/workspace1/.vscode/.ropeproject/config.py @@ -0,0 +1,114 @@ +# The default ``config.py`` +# flake8: noqa + + +def set_prefs(prefs): + """This function is called before opening the project""" + + # Specify which files and folders to ignore in the project. + # Changes to ignored resources are not added to the history and + # VCSs. Also they are not returned in `Project.get_files()`. + # Note that ``?`` and ``*`` match all characters but slashes. + # '*.pyc': matches 'test.pyc' and 'pkg/test.pyc' + # 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc' + # '.svn': matches 'pkg/.svn' and all of its children + # 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o' + # 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o' + prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject', + '.hg', '.svn', '_svn', '.git', '.tox'] + + # Specifies which files should be considered python files. It is + # useful when you have scripts inside your project. Only files + # ending with ``.py`` are considered to be python files by + # default. + # prefs['python_files'] = ['*.py'] + + # Custom source folders: By default rope searches the project + # for finding source folders (folders that should be searched + # for finding modules). You can add paths to that list. Note + # that rope guesses project source folders correctly most of the + # time; use this if you have any problems. + # The folders should be relative to project root and use '/' for + # separating folders regardless of the platform rope is running on. + # 'src/my_source_folder' for instance. + # prefs.add('source_folders', 'src') + + # You can extend python path for looking up modules + # prefs.add('python_path', '~/python/') + + # Should rope save object information or not. + prefs['save_objectdb'] = True + prefs['compress_objectdb'] = False + + # If `True`, rope analyzes each module when it is being saved. + prefs['automatic_soa'] = True + # The depth of calls to follow in static object analysis + prefs['soa_followed_calls'] = 0 + + # If `False` when running modules or unit tests "dynamic object + # analysis" is turned off. This makes them much faster. + prefs['perform_doa'] = True + + # Rope can check the validity of its object DB when running. + prefs['validate_objectdb'] = True + + # How many undos to hold? + prefs['max_history_items'] = 32 + + # Shows whether to save history across sessions. + prefs['save_history'] = True + prefs['compress_history'] = False + + # Set the number spaces used for indenting. According to + # :PEP:`8`, it is best to use 4 spaces. Since most of rope's + # unit-tests use 4 spaces it is more reliable, too. + prefs['indent_size'] = 4 + + # Builtin and c-extension modules that are allowed to be imported + # and inspected by rope. + prefs['extension_modules'] = [] + + # Add all standard c-extensions to extension_modules list. + prefs['import_dynload_stdmods'] = True + + # If `True` modules with syntax errors are considered to be empty. + # The default value is `False`; When `False` syntax errors raise + # `rope.base.exceptions.ModuleSyntaxError` exception. + prefs['ignore_syntax_errors'] = False + + # If `True`, rope ignores unresolvable imports. Otherwise, they + # appear in the importing namespace. + prefs['ignore_bad_imports'] = False + + # If `True`, rope will insert new module imports as + # `from import ` by default. + prefs['prefer_module_from_imports'] = False + + # If `True`, rope will transform a comma list of imports into + # multiple separate import statements when organizing + # imports. + prefs['split_imports'] = False + + # If `True`, rope will remove all top-level import statements and + # reinsert them at the top of the module when making changes. + prefs['pull_imports_to_top'] = True + + # If `True`, rope will sort imports alphabetically by module name instead + # of alphabetically by import statement, with from imports after normal + # imports. + prefs['sort_imports_alphabetically'] = False + + # Location of implementation of + # rope.base.oi.type_hinting.interfaces.ITypeHintingFactory In general + # case, you don't have to change this value, unless you're an rope expert. + # Change this value to inject you own implementations of interfaces + # listed in module rope.base.oi.type_hinting.providers.interfaces + # For example, you can add you own providers for Django Models, or disable + # the search type-hinting in a class hierarchy, etc. + prefs['type_hinting_factory'] = ( + 'rope.base.oi.type_hinting.factory.default_type_hinting_factory') + + +def project_opened(project): + """This function is called after opening the project""" + # Do whatever you like here! diff --git a/src/testMultiRootWkspc/workspace1/.vscode/.ropeproject/objectdb b/src/testMultiRootWkspc/workspace1/.vscode/.ropeproject/objectdb new file mode 100644 index 000000000000..0a47446c0ad2 Binary files /dev/null and b/src/testMultiRootWkspc/workspace1/.vscode/.ropeproject/objectdb differ diff --git a/src/testMultiRootWkspc/workspace1/.vscode/tags b/src/testMultiRootWkspc/workspace1/.vscode/tags deleted file mode 100644 index 4739b4629cfb..000000000000 --- a/src/testMultiRootWkspc/workspace1/.vscode/tags +++ /dev/null @@ -1,19 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ -!_TAG_PROGRAM_AUTHOR Universal Ctags Team // -!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ -!_TAG_PROGRAM_URL https://ctags.io/ /official site/ -!_TAG_PROGRAM_VERSION 0.0.0 /f9e6e3c1/ -Foo ..\\file.py /^class Foo(object):$/;" kind:class line:5 -__init__ ..\\file.py /^ def __init__(self):$/;" kind:member line:8 -__revision__ ..\\file.py /^__revision__ = None$/;" kind:variable line:3 -file.py ..\\file.py 1;" kind:file line:1 -meth1 ..\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth2 ..\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth3 ..\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth4 ..\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth5 ..\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth6 ..\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth7 ..\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth8 ..\\file.py /^ def meth8(self):$/;" kind:member line:80 diff --git a/src/testMultiRootWkspc/workspace2/.vscode/settings.json b/src/testMultiRootWkspc/workspace2/.vscode/settings.json index 3705457b09a7..0967ef424bce 100644 --- a/src/testMultiRootWkspc/workspace2/.vscode/settings.json +++ b/src/testMultiRootWkspc/workspace2/.vscode/settings.json @@ -1,4 +1 @@ -{ - "python.workspaceSymbols.tagFilePath": "${workspaceFolder}/workspace2.tags.file", - "python.workspaceSymbols.enabled": false -} +{} diff --git a/src/testMultiRootWkspc/workspace2/workspace2.tags.file b/src/testMultiRootWkspc/workspace2/workspace2.tags.file deleted file mode 100644 index 375785e2a94e..000000000000 --- a/src/testMultiRootWkspc/workspace2/workspace2.tags.file +++ /dev/null @@ -1,24 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ -!_TAG_PROGRAM_AUTHOR Universal Ctags Team // -!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ -!_TAG_PROGRAM_URL https://ctags.io/ /official site/ -!_TAG_PROGRAM_VERSION 0.0.0 /f9e6e3c1/ -Foo C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\file.py /^class Foo(object):$/;" kind:class line:5 -Workspace2Class C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\workspace2File.py /^class Workspace2Class(object):$/;" kind:class line:5 -__init__ C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\file.py /^ def __init__(self):$/;" kind:member line:8 -__init__ C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\workspace2File.py /^ def __init__(self):$/;" kind:member line:8 -__revision__ C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\file.py /^__revision__ = None$/;" kind:variable line:3 -__revision__ C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\workspace2File.py /^__revision__ = None$/;" kind:variable line:3 -file.py C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\file.py 1;" kind:file line:1 -meth1 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth1OfWorkspace2 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\workspace2File.py /^ def meth1OfWorkspace2(self, arg):$/;" kind:member line:11 -meth2 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth3 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth4 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth5 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth6 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth7 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth8 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\file.py /^ def meth8(self):$/;" kind:member line:80 -workspace2File.py C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace2\\workspace2File.py 1;" kind:file line:1 diff --git a/src/testMultiRootWkspc/workspace3/.vscode/settings.json b/src/testMultiRootWkspc/workspace3/.vscode/settings.json index 8779a0c08efe..0967ef424bce 100644 --- a/src/testMultiRootWkspc/workspace3/.vscode/settings.json +++ b/src/testMultiRootWkspc/workspace3/.vscode/settings.json @@ -1,3 +1 @@ -{ - "python.workspaceSymbols.tagFilePath": "${workspaceRoot}/workspace3.tags.file" -} +{} diff --git a/src/testMultiRootWkspc/workspace3/workspace3.tags.file b/src/testMultiRootWkspc/workspace3/workspace3.tags.file deleted file mode 100644 index 3a65841e2aff..000000000000 --- a/src/testMultiRootWkspc/workspace3/workspace3.tags.file +++ /dev/null @@ -1,19 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_OUTPUT_MODE u-ctags /u-ctags or e-ctags/ -!_TAG_PROGRAM_AUTHOR Universal Ctags Team // -!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ -!_TAG_PROGRAM_URL https://ctags.io/ /official site/ -!_TAG_PROGRAM_VERSION 0.0.0 /f9e6e3c1/ -Foo C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace3\\file.py /^class Foo(object):$/;" kind:class line:5 -__init__ C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace3\\file.py /^ def __init__(self):$/;" kind:member line:8 -__revision__ C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace3\\file.py /^__revision__ = None$/;" kind:variable line:3 -file.py C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace3\\file.py 1;" kind:file line:1 -meth1 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace3\\file.py /^ def meth1(self, arg):$/;" kind:member line:11 -meth2 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace3\\file.py /^ def meth2(self, arg):$/;" kind:member line:15 -meth3 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace3\\file.py /^ def meth3(self):$/;" kind:member line:21 -meth4 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace3\\file.py /^ def meth4(self):$/;" kind:member line:28 -meth5 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace3\\file.py /^ def meth5(self):$/;" kind:member line:38 -meth6 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace3\\file.py /^ def meth6(self):$/;" kind:member line:53 -meth7 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace3\\file.py /^ def meth7(self):$/;" kind:member line:68 -meth8 C:\\Users\\dojayama\\.vscode\\extensions\\pythonVSCode\\src\\testMultiRootWkspc\\workspace3\\file.py /^ def meth8(self):$/;" kind:member line:80