palantir / python-language-server

An implementation of the Language Server Protocol for Python
MIT License
2.61k stars 283 forks source link

self._docs[doc_uri]: KeyError #236

Closed evandrocoan closed 6 years ago

evandrocoan commented 6 years ago

A very similar key error shows up on:

  1. https://github.com/palantir/python-language-server/issues/226 Goto definition does not work, when you want to jump from a package in virtualenv into a submodule

But I did not had used the Go To Feature:

``` [Package Reloader] begin ====================================================== reloading plugin LSP.boot [Package Reloader] reloading |-- LSP [Package Reloader] reloading |-- LSP.boot [Package Reloader] reloading | |-- LSP.plugin [Package Reloader] reloading | |-- LSP.plugin.core [Package Reloader] reloading | |-- LSP.plugin.core.main [Package Reloader] reloading | | |-- LSP.plugin.core.url [Package Reloader] reloading | | |-- LSP.plugin.core.protocol [Package Reloader] reloading | | |-- LSP.plugin.core.settings [Package Reloader] reloading | | |-- LSP.plugin.core.logging [Package Reloader] reloading | | |-- LSP.plugin.core.rpc [Package Reloader] reloading | | |-- LSP.plugin.core.workspace [Package Reloader] reloading | | |-- LSP.plugin.core.configurations [Package Reloader] reloading | | |-- LSP.plugin.core.clients [Package Reloader] reloading | | |-- LSP.plugin.core.events [Package Reloader] reloading | | |-- LSP.plugin.core.documents [Package Reloader] reloading | | |-- LSP.plugin.core.diagnostics [Package Reloader] reloading | | |-- LSP.plugin.core.edit [Package Reloader] reloading | |-- LSP.plugin.core.panels [Package Reloader] reloading | |-- LSP.plugin.completion [Package Reloader] reloading | |-- LSP.plugin.diagnostics [Package Reloader] reloading | |-- LSP.plugin.configuration [Package Reloader] reloading | |-- LSP.plugin.formatting [Package Reloader] reloading | |-- LSP.plugin.highlights [Package Reloader] reloading | |-- LSP.plugin.definition [Package Reloader] reloading | |-- LSP.plugin.hover [Package Reloader] reloading | | |-- LSP.plugin.core.popups [Package Reloader] reloading | |-- LSP.plugin.references [Package Reloader] reloading | |-- LSP.plugin.signature_help [Package Reloader] reloading | |-- LSP.plugin.code_actions [Package Reloader] reloading | |-- LSP.plugin.symbols [Package Reloader] reloading | |-- LSP.plugin.rename LSP: global clients: pyls=True LSP: starting active= F:\SublimeText\Data\Packages\LSP\plugin\core\settings.py other= 0 LSP: starting in F:\SublimeText\Data LSP: starting ['pyls'] LSP: --> initialize [Package Reloader] installing dummy package reloading plugin _dummy_package [Package Reloader] removing dummy package unloading plugin _dummy_package [Package Reloader] end -------------------------------------------------------- reloading /F/SublimeText/Data/debug.txt LSP: --> initialized LSP: --> workspace/didChangeConfiguration LSP: pyls client registered for window 2 LSP: --> textDocument/didOpen LSP: <-- textDocument/publishDiagnostics LSP: --> initialized LSP: --> workspace/didChangeConfiguration LSP: pyls client registered for window 2 Error handling server payload Traceback (most recent call last): File "F:\SublimeText\Data\Packages\LSP\plugin\core\rpc.py", line 133, in read_stdout self.response_handler(payload) File "F:\SublimeText\Data\Packages\LSP\plugin\core\rpc.py", line 178, in response_handler self._response_handlers[handler_id](result) File "F:\SublimeText\Data\Packages\LSP\plugin\core\main.py", line 242, in lambda result: handle_initialize_result(result, client, window, config)) File "F:\SublimeText\Data\Packages\LSP\plugin\core\main.py", line 175, in handle_initialize_result clear_starting_config(window, config.name) File "F:\SublimeText\Data\Packages\LSP\plugin\core\main.py", line 98, in clear_starting_config starting_configs_by_window[window.id()].remove(config_name) KeyError: 'pyls' LSP: --> textDocument/hover : [python_language_server] 18:04:38:0690146 Logging to the file F:/SublimeText/Data/debug.txt: 2018-01-22 18:04:41,285 UTC - ERROR - jsonrpc.manager - API Exception: {'type': 'KeyError', 'args': ('file:///F:/SublimeText/Data/Packages/LSP/plugin/core/settings.py',), 'message': "'file:///F:/SublimeText/Data/Packages/LSP/plugin/core/settings.py'"}: Traceback (most recent call last):: File "F:\Python\lib\site-packages\jsonrpc\manager.py", line 112, in _get_responses: result = method(*request.args, **request.kwargs): File "d:\user\dropbox\softwareversioning\python-language-server\pyls\dispatcher.py", line 19, in wrapped: return func(*args, **kwargs): File "d:\user\dropbox\softwareversioning\python-language-server\pyls\python_ls.py", line 162, in m_text_document__hover: return self.hover(textDocument['uri'], position): File "d:\user\dropbox\softwareversioning\python-language-server\pyls\python_ls.py", line 109, in hover: return self._hook('pyls_hover', doc_uri, position=position) or {'contents': ''}: File "d:\user\dropbox\softwareversioning\python-language-server\pyls\python_ls.py", line 40, in _hook: doc = self.workspace.get_document(doc_uri) if doc_uri else None: File "d:\user\dropbox\softwareversioning\python-language-server\pyls\workspace.py", line 110, in get_document: return self._docs[doc_uri]: KeyError: 'file:///F:/SublimeText/Data/Packages/LSP/plugin/core/settings.py': FuzzyFilePath cached 8314 files in F:/SublimeText/Data FuzzyFilePath cached 8314 files in F:/SublimeText/Data LSP: starting in D:\User\Dropbox\SoftwareVersioning\python-language-server LSP: starting ['pyls'] LSP: --> initialize LSP: pyls not available for view D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\__main__.py in window 3 LSP: --> initialized LSP: --> workspace/didChangeConfiguration LSP: pyls client registered for window 3 LSP: --> textDocument/didOpen LSP: <-- textDocument/publishDiagnostics ```


___ Full console:

``` DPI scale: 1 startup, version: 3156 windows x32 channel: dev executable: /F/SublimeText/sublime_text.exe working dir: /F/SublimeText packages path: /F/SublimeText/Data/Packages state path: /F/SublimeText/Data/Local zip path: /F/SublimeText/Packages zip path: /F/SublimeText/Data/Installed Packages ignored_packages: ["ApplySyntax", "BracketHighlighter", "BuildView", "C++ Completions", "C++ Qt Completions", "C++ Snippets", "CodeIntel", "ColorHelper", "DictionaryAutoComplete", "FileManager", "Find++", "Gist", "Git", "GitGutter", "GotoLastEditEnhanced", "Javatar", "LocalHistory", "MatlabCompletions", "MatlabFilenameAutoComplete", "MySQLSnippets", "ProjectSpecificSyntax", "ScopeAlways", "SublimeLinter-javac", "SyncedSideBar", "TypeScript", "Vintage", "WordHighlight"] pre session restore time: 7.19519 loading dictionary Packages/Language - English and Portuguese/EN_PT.dic startup time: 12.2232 first paint time: 12.2372 Packages/PackageDev/Package/Sublime Text Settings/Sublime Text Settings.sublime-syntax: context scope:source.regexp-replacement#escaped has a scope name, but is unreachable, so the name will never be used reloading plugin Default.arithmetic reloading plugin Default.auto_indent_tag reloading plugin Default.block reloading plugin Default.colors reloading plugin Default.comment reloading plugin Default.convert_color_scheme reloading plugin Default.convert_syntax reloading plugin Default.copy_path reloading plugin Default.delete_word reloading plugin Default.detect_indentation reloading plugin Default.duplicate_line reloading plugin Default.echo reloading plugin Default.exec reloading plugin Default.fold reloading plugin Default.font reloading plugin Default.goto_line reloading plugin Default.history_list reloading plugin Default.indentation reloading plugin Default.install_package_control reloading plugin Default.kill_ring reloading plugin Default.mark reloading plugin Default.new_templates reloading plugin Default.open_context_url reloading plugin Default.open_in_browser reloading plugin Default.pane reloading plugin Default.paragraph reloading plugin Default.paste_from_history reloading plugin Default.profile reloading plugin Default.quick_panel reloading plugin Default.rename reloading plugin Default.run_syntax_tests reloading plugin Default.save_on_focus_lost reloading plugin Default.scroll reloading plugin Default.set_unsaved_view_name reloading plugin Default.settings reloading plugin Default.show_scope_name reloading plugin Default.side_bar reloading plugin Default.sort reloading plugin Default.swap_line reloading plugin Default.switch_file reloading plugin Default.symbol reloading plugin Default.transform reloading plugin Default.transpose reloading plugin Default.trim_trailing_white_space reloading plugin Default.ui reloading plugin CSS.css_completions reloading plugin Diff.diff reloading plugin HTML.encode_html_entities reloading plugin HTML.html_completions reloading plugin ShellScript.ShellScript reloading plugin 0_packages_manager_loader.00-packages_manager reloading plugin 0_packages_manager_loader.01-package_setting_context reloading plugin 0_packages_manager_loader.01-pygments reloading plugin 0_packages_manager_loader.10-PythonDebugTools reloading plugin 0_packages_manager_loader.15-coverage reloading plugin 0_packages_manager_loader.20-EstimatedTimeLeft reloading plugin 0_packages_manager_loader.30-ChannelManager reloading plugin 0_packages_manager_loader.50-backrefs reloading plugin 0_packages_manager_loader.50-markupsafe reloading plugin 0_packages_manager_loader.50-pymdownx reloading plugin 0_packages_manager_loader.50-python-markdown reloading plugin 0_packages_manager_loader.50-pyyaml reloading plugin 0_packages_manager_loader.50-regex reloading plugin 0_packages_manager_loader.51-python-jinja2 reloading plugin 0_packages_manager_loader.55-jsonschema reloading plugin 0_packages_manager_loader.55-mdpopups reloading plugin tests reloading plugin 0_settings_loader.install_package_control_extended reloading plugin 0_settings_loader.synced_side_bar_watcher reloading plugin A File Icon.A File Icon reloading plugin AceJump.ace_jump reloading plugin ActiveViewJumpBack.active_view_jump_back reloading plugin AddFolderToProject.AddFolderToProject reloading plugin AdvancedCSV.csvplugin reloading plugin Alignment.Alignment reloading plugin AlignTab.aligner reloading plugin AlignTab.aligntab reloading plugin AlignTab.hist reloading plugin AlignTab.parser reloading plugin AlignTab.table reloading plugin AlignTab.wclen reloading plugin AllAutocomplete.all_views_completions reloading plugin AltUp.run_multiple_commands reloading plugin Amxmodx.AMXXEditor reloading plugin AmxxChannel.commands reloading plugin AmxxChannel.fix_main_menus reloading plugin AmxxChannel.settings reloading plugin ANSIescape.ansi reloading plugin AutoFileName.autofilename reloading plugin AutoFileName.getimageinfo reloading plugin AutomaticPackageReloader.package_reloader reloading plugin AutoRefresh.AutoRefresh reloading plugin AutoWrap.autowrap reloading plugin BetterCoffeeScript.CoffeeScript reloading plugin BetterFindBuffer.find_results reloading plugin BufferScroll.BufferScroll reloading plugin CaseConversion.case_conversion reloading plugin CaseConversion.case_parse reloading plugin CaseConversion.ToggleTitleCase reloading plugin ChainOfCommand.chain reloading plugin ChangeQuotes.change_quotes reloading plugin ChannelRepositoryTools.ordereddict reloading plugin ChannelRepositoryTools.tests reloading plugin ChannelRepositoryTools.upgrade reloading plugin ClearCursorsCarets.clear_cursors_carets reloading plugin ClickableURLs.clickable_urls reloading plugin ClipboardScopeCopy.clipboard_scope_copy reloading plugin Color Highlighter.color_converter reloading plugin Color Highlighter.color_highlighter reloading plugin Color Highlighter.color_hover_listener reloading plugin Color Highlighter.color_scheme reloading plugin Color Highlighter.color_scheme_color_highlighter reloading plugin Color Highlighter.color_searcher reloading plugin Color Highlighter.color_selection_listener reloading plugin Color Highlighter.colors reloading plugin Color Highlighter.content_listener reloading plugin Color Highlighter.convert_color_command reloading plugin Color Highlighter.css_colors reloading plugin Color Highlighter.dummy_event_listener reloading plugin Color Highlighter.gutter_icons_color_highlighter reloading plugin Color Highlighter.load_resource reloading plugin Color Highlighter.main reloading plugin Color Highlighter.path reloading plugin Color Highlighter.phantoms_color_highlighter reloading plugin Color Highlighter.pick_color_command reloading plugin Color Highlighter.regex_compiler reloading plugin Color Highlighter.regions reloading plugin Color Highlighter.set_setting_command reloading plugin Color Highlighter.settings reloading plugin Color Highlighter.st_helper reloading plugin Color Highlighter.topsort reloading plugin ColorSchemeEditor.ColorSchemeEditor-ST2 reloading plugin ColorSchemeUnit.plugin reloading plugin ColumnSelect.column_select reloading plugin CompareSideBySide.sbs_compare reloading plugin ConvertToUTF8.ConvertToUTF8 reloading plugin CopyFilepathWithLineNumbers.CopyFilepathWithLineNumbers reloading plugin CopyWithLineNumbersReloaded.copy_with_line_numbers reloading plugin DefaultSyntax.default_syntax reloading plugin DeleteCurrentFile.DeleteCurrentFile reloading plugin DistractionFreeWindow.distraction_free_window reloading plugin DocBlockr.jsdocs reloading plugin DocBlockr.test_runner reloading plugin DuplicateSelections.duplicate_selections reloading plugin EditPreferences.__init__ reloading plugin EditPreferences.commands_base reloading plugin EditPreferences.edit_package_files reloading plugin EditPreferences.extract_snippets reloading plugin EditPreferences.helper_commands reloading plugin EditPreferences.helpers reloading plugin EditPreferences.insert_binding_repr reloading plugin EditPreferences.jsonix reloading plugin EditPreferences.list_commands reloading plugin EditPreferences.list_menu_bindings reloading plugin EditPreferences.list_settings reloading plugin EditPreferences.list_shortcut_keys reloading plugin EditPreferences.list_theme_selectors reloading plugin EditPreferences.package_resources reloading plugin EditPreferences.quick_panel_cols reloading plugin EditPreferences.scheduler reloading plugin Emmet.emmet-plugin reloading plugin ExpandRegion.__init__ reloading plugin ExpandRegion.expand_region_handler reloading plugin ExpandRegion.expand_to_indent reloading plugin ExpandRegion.expand_to_line reloading plugin ExpandRegion.expand_to_quotes reloading plugin ExpandRegion.expand_to_regex_set reloading plugin ExpandRegion.expand_to_semantic_unit reloading plugin ExpandRegion.expand_to_subword reloading plugin ExpandRegion.expand_to_symbols reloading plugin ExpandRegion.expand_to_word reloading plugin ExpandRegion.expand_to_word_with_dots reloading plugin ExpandRegion.expand_to_xml_node reloading plugin ExpandRegion.ExpandRegion reloading plugin ExpandRegion.html reloading plugin ExpandRegion.javascript reloading plugin ExpandRegion.latex reloading plugin ExpandRegion.python reloading plugin ExpandRegion.utils reloading plugin ExportHtml.ExportBbcode reloading plugin ExportHtml.ExportHtml reloading plugin ExportHtml.HtmlAnnotations reloading plugin ExportHtml.support reloading plugin ExtendedTabSwitcher.ExtendedSwitcher reloading plugin ExtractText.clean_save_file_modifications reloading plugin ExtractText.extract_to_file reloading plugin FileDiffs.file_diffs reloading plugin FileHistory.file_history reloading plugin FileRename.file_rename reloading plugin FindKeyConflicts.find_key_conflicts reloading plugin FixCommandPalette.fixed_command_palette_input_history reloading plugin FixProjectSwitchRestartBug.fix_project_switch_restart_bug reloading plugin FixSelectionAfterIndent.fix_selection_after_indent reloading plugin ForceRewriteSublimeSettings.force_rewrite_sublime_settings reloading plugin FuzzyFileNav.fuzzy_file_nav reloading plugin FuzzyFileNav.multiconf reloading plugin FuzzyFileNav.notify reloading plugin FuzzyFilePath.command_goto_file reloading plugin FuzzyFilePath.command_insert_path reloading plugin FuzzyFilePath.command_rebuild_cache reloading plugin FuzzyFilePath.command_replace_region reloading plugin FuzzyFilePath.command_show_context reloading plugin FuzzyFilePath.command_show_current_settings reloading plugin FuzzyFilePath.command_show_info reloading plugin FuzzyFilePath.completion reloading plugin FuzzyFilePath.controller reloading plugin FuzzyFilePath.current_state reloading plugin FuzzyFilePath.expression reloading plugin FuzzyFilePath.ProjectListener reloading plugin FuzzyFilePath.query reloading plugin FuzzyFilePath.QueryCompletionListener reloading plugin FuzzyFilePath.TestRunner reloading plugin FuzzyFilePath.ViewListener reloading plugin Glue.__init__ reloading plugin Glue.Glue reloading plugin Glue.GlueBrowser reloading plugin Glue.GlueCmds reloading plugin Glue.GlueIO reloading plugin Glue.GlueSidebarOpener reloading plugin GoogleSpellCheck.google-spell-check reloading plugin HighlightBuildErrors.HighlightBuildErrors reloading plugin HighlightWords.HighlightWords reloading plugin HorizontalScroll.scroll_width reloading plugin HungryBackspace.hungry_backspace reloading plugin Incrementor.incrementor reloading plugin IncrementSelection.IncrementSelection reloading plugin IndentAndBraces.indent-and-braces reloading plugin IndentSize.IndentSizeCommand reloading plugin InsertNums.InsertNums reloading plugin InvertSelection.invertselection reloading plugin JumpAlongIndent.file_scanner reloading plugin JumpAlongIndent.jump_along_indent reloading plugin JumpAlongIndent.view_helper reloading plugin KeepPastedTextSelected.keep_pasted_text_selected reloading plugin LaTeXSmartQuotes.getTeXRoot reloading plugin LaTeXSmartQuotes.smartquotes reloading plugin LaTeXTools.01_reload_submodules reloading plugin LaTeXTools.02_temp_file_cleanup reloading plugin LaTeXTools.03_reset_phantoms reloading plugin LaTeXTools.auto_label reloading plugin LaTeXTools.biblatex_crossref_completions reloading plugin LaTeXTools.biblatex_field_name_completions reloading plugin LaTeXTools.biblatex_name_completions reloading plugin LaTeXTools.biblatex_snippet_completions reloading plugin LaTeXTools.biblatex_syntax_listener reloading plugin LaTeXTools.change_environment reloading plugin LaTeXTools.context_provider reloading plugin LaTeXTools.create_mousemap reloading plugin LaTeXTools.delete_temp_files reloading plugin LaTeXTools.detect_spellcheck reloading plugin LaTeXTools.getTeXRoot reloading plugin LaTeXTools.jumpto_anywhere reloading plugin LaTeXTools.jumpto_tex_file reloading plugin LaTeXTools.jumpToPDF reloading plugin LaTeXTools.kpsewhich reloading plugin LaTeXTools.latex_cite_completions reloading plugin LaTeXTools.latex_cwl_completions reloading plugin LaTeXTools.latex_directive_completions reloading plugin LaTeXTools.latex_env_completions reloading plugin LaTeXTools.latex_fill_all reloading plugin LaTeXTools.latex_glossary_completions reloading plugin LaTeXTools.latex_input_completions reloading plugin LaTeXTools.latex_installed_packages reloading plugin LaTeXTools.latex_own_command_completions reloading plugin LaTeXTools.latex_ref_completions reloading plugin LaTeXTools.latexCommand reloading plugin LaTeXTools.latexDocumentationViewer reloading plugin LaTeXTools.latexEnvCloser reloading plugin LaTeXTools.latexEnvironment reloading plugin LaTeXTools.latextools_cache_listener reloading plugin LaTeXTools.latextools_default_settings reloading plugin LaTeXTools.latextools_plugin reloading plugin LaTeXTools.makePDF reloading plugin LaTeXTools.migrate reloading plugin LaTeXTools.open_detexify reloading plugin LaTeXTools.parseTeXlog reloading plugin LaTeXTools.reveal_folders reloading plugin LaTeXTools.search_commands reloading plugin LaTeXTools.smart_paste reloading plugin LaTeXTools.system_check reloading plugin LaTeXTools.texcount reloading plugin LaTeXTools.texMacro reloading plugin LaTeXTools.texSections reloading plugin LaTeXTools.texSyntaxListener reloading plugin LaTeXTools.toc_quickpanel reloading plugin LaTeXTools.toggle_settings reloading plugin LaTeXWordCount.WordCount reloading plugin LESS.less_completions reloading plugin LineEndingsUnify.LineEndingsUnify reloading plugin LinesMultisets.choose_view reloading plugin LinesMultisets.execute_operation reloading plugin LSP.boot reloading plugin MarkdownPreview.helper reloading plugin MarkdownPreview.markdown_settings reloading plugin MarkdownPreview.markdown_wrapper reloading plugin MarkdownPreview.MarkdownPreview reloading plugin MarkdownToBBCode.MarkdownToBBCode reloading plugin Maven.config_generator reloading plugin Maven.import reloading plugin Maven.maven reloading plugin MaxPane.layouts_doc reloading plugin MaxPane.max_pane reloading plugin MoveText.move_text reloading plugin MultiEditUtils.MultiEditUtils reloading plugin MultiEditUtils.selection_fields reloading plugin NumberKing.king reloading plugin OpenAutoCompletion.open_auto_completion reloading plugin Origami.origami reloading plugin OverrideAudit.override_audit reloading plugin OverrideCommitCompletion.overwrite_commit_completion reloading plugin OverrideEditSettingsDefaultContents.override_edit_settings_default_contents reloading plugin OverrideUnpackedPackages.override_unpacked_packages reloading plugin package_setting_context.__init__ reloading plugin PackageDev._logging reloading plugin PackageDev.main reloading plugin PackageResourceViewer.package_resource_viewer reloading plugin PackageResourceViewer.package_resources reloading plugin PackagesManager.1_reloader reloading plugin PackagesManager.2_bootstrap reloading plugin PackagesManager.PackagesManager reloading plugin PathTranslator.PathTranslator reloading plugin PowerCursors.power_cursors reloading plugin PrettyJSON.PrettyJson reloading plugin PrettyJSON.PrettyJsonListeners reloading plugin PythonDebugTools.setup reloading plugin QuickSettings.quick_settings reloading plugin RandomEverything.__init__ reloading plugin RandomEverything.random reloading plugin REG.jumptoregkey reloading plugin ReIndent.ReIndent reloading plugin REPL.__init__ reloading plugin REPL.completions reloading plugin REPL.lang_integration reloading plugin REPL.run_existing_command reloading plugin REPL.sublimerepl reloading plugin REPL.sublimerepl_build_system_hack reloading plugin REPL.text_transfer reloading plugin ScopeHunter.scope_hunter reloading plugin ScopeHunter.scope_hunter_notify reloading plugin ScopeHunter.support reloading plugin SelectAll.select_all_by_current_scope reloading plugin SelectAllSpellingErrors.select_all_spelling_errors reloading plugin SelectUntil.edit reloading plugin SelectUntil.select-until reloading plugin SemanticLineWrap.semantic_wrap reloading plugin SideBarEnhancements.SideBar reloading plugin SideBarEnhancements.SideBarAPI reloading plugin SideBarEnhancements.SideBarDefaultDisable reloading plugin SideBySideSettings.sxs_settings reloading plugin SQLExec.SQLExec reloading plugin SQLKeywordUppercase.sql_keyword_uppercase reloading plugin SQLTools.SQLTools reloading plugin StickySearch.StickySearch reloading plugin StudioChannel.commands reloading plugin StudioChannel.settings reloading plugin SublimeLinter.busy_indicator_view reloading plugin SublimeLinter.commands reloading plugin SublimeLinter.status_bar_view reloading plugin SublimeLinter.sublime_linter reloading plugin SublimeTutorial.sublime_tutor reloading plugin SyncViewScroll.syncscroll reloading plugin SyntaxManager.syntaxmgr reloading plugin TabsExtra.support reloading plugin TabsExtra.tab_menu reloading plugin TabsExtra.tab_sort_helper reloading plugin TabsExtra.tabs_extra reloading plugin TerminalShortcuts.Terminal reloading plugin TextPastry.text_pastry reloading plugin TextPastry.text_pastry_addons reloading plugin TextPastry.text_pastry_clipboard reloading plugin TextPastry.text_pastry_selection reloading plugin ToggleWords.ToggleWords reloading plugin Trimmer.Trimmer reloading plugin UnitTesting.ut reloading plugin ViewSettingsFreely.view_settings_freely reloading plugin Whitespace.Whitespace reloading plugin WordCount.WordCount reloading plugin WrapPlus.wrap_plus plugins loaded OverrideAudit: Initializing OverrideAudit: Sublime version is unchanged; skipping automatic report Loaded LaTeXTools plugins ['pdf_builder'] from path F:\SublimeText\Data\Packages\LaTeXTools\builders\pdfBuilder.py Loaded LaTeXTools plugins ['basic_builder', 'script_builder', 'simple_builder', 'traditional_builder'] from path F:\SublimeText\Data\Packages\LaTeXTools\builders LSP: global clients: pyls=True LSP: starting active= D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\config\config.py other= 0 LSP: starting in D:\User\Dropbox\SoftwareVersioning\python-language-server LSP: starting ['pyls'] LSP: --> initialize Loaded LaTeXTools plugins ['base_viewer'] from path F:\SublimeText\Data\Packages\LaTeXTools\viewers\base_viewer.py Loaded LaTeXTools plugins ['skim_viewer', 'evince_viewer', 'sumatra_viewer', 'command_viewer', 'preview_viewer', 'zathura_viewer', 'okular_viewer'] from path F:\SublimeText\Data\Packages\LaTeXTools\viewers syncScroll starting Loaded LaTeXTools plugins ['traditional_bibliography', 'new_bibliography'] from path F:\SublimeText\Data\Packages\LaTeXTools\bibliography_plugins Loading LaTeXTools plugins... Emmet: No need to update PyV8 FuzzyFilePath cached 63 files in D:/User/Dropbox/SoftwareVersioning/python-language-server reloading plugin AmxxChannel.commands FuzzyFilePath cached 63 files in D:/User/Dropbox/SoftwareVersioning/python-language-server reloading plugin StudioChannel.commands reloading settings Packages/User/BufferScroll.sublime-settings Loaded LaTeXTools plugins [] from path F:\SublimeText\Data\Packages\LaTeXTools\builders\pdfBuilder.py Loaded LaTeXTools plugins [] from path F:\SublimeText\Data\Packages\LaTeXTools\builders Loaded LaTeXTools plugins [] from path F:\SublimeText\Data\Packages\LaTeXTools\viewers\base_viewer.py Loaded LaTeXTools plugins [] from path F:\SublimeText\Data\Packages\LaTeXTools\viewers Loaded LaTeXTools plugins [] from path F:\SublimeText\Data\Packages\LaTeXTools\bibliography_plugins LSP: Already starting on this window: pyls LSP: Already starting on this window: pyls LSP: Already starting on this window: pyls LSP: Already starting on this window: pyls LSP: Already starting on this window: pyls LSP: Already starting on this window: pyls [copy_default_package.py] 18:03:17:028.570890 2.60e+01 main:64 Entering on CopyFilesThread(1) [copy_default_package.py] 18:03:17:036.077023 7.59e-03 run:75 Entering on run(1) [copy_default_package.py] 18:03:17:106.643915 7.09e-02 run:80 run, package_path: F:\SublimeText\Packages\Default.sublime-package [copy_default_package.py] 18:03:17:108.145952 1.22e-03 run:81 run, output_folder: F:\SublimeText\Data\Default.sublime-package LSP: Already starting on this window: pyls [copy_default_package.py] 18:03:17:556.570053 4.48e-01 extract_package:150 The file 'F:\SublimeText\Packages\Default.sublime-package' was successfully extracted. [copy_default_package.py] 18:03:17:557.569981 1.45e-03 create_git_ignore_file:112 Writing to gitignore_file: F:\SublimeText\Data\Default.sublime-package\.gitignore Traceback (most recent call last):: File "F:\Python\Scripts\pyls-script.py", line 11, in : load_entry_point('python-language-server', 'console_scripts', 'pyls')(): File "F:\Python\lib\site-packages\pkg_resources\__init__.py", line 570, in load_entry_point: return get_distribution(dist).load_entry_point(group, name): File "F:\Python\lib\site-packages\pkg_resources\__init__.py", line 2751, in load_entry_point: return ep.load(): File "F:\Python\lib\site-packages\pkg_resources\__init__.py", line 2405, in load: return self.resolve(): File "F:\Python\lib\site-packages\pkg_resources\__init__.py", line 2411, in resolve: module = __import__(self.module_name, fromlist=['__name__'], level=0): File "d:\user\dropbox\softwareversioning\python-language-server\pyls\__main__.py", line 14, in : loger.setup_logger("F:/SublimeText/Data/debug.txt", function=False, tick=False): AttributeError: 'Debugger' object has no attribute 'setup_logger': LSP: LSP stderr process ended. LSP: LSP stdout process ended. LSP: Already starting on this window: pyls LSP: pyls not available for view D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\config\config.py in window 3 indexing [job 5]: no files were indexed out of the 11 queued, abandoning crawl indexing [job 6]: no files were indexed out of the 110 queued, abandoning crawl indexing [job 7]: no files were indexed out of the 110 queued, abandoning crawl LSP: Already starting on this window: pyls PackagesManager: No updated packages LSP: Already starting on this window: pyls LSP: pyls not available for view D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\__main__.py in window 3 LSP: pyls not available for view D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\__main__.py in window 3 LSP: Already starting on this window: pyls LSP: pyls not available for view D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\__main__.py in window 3 LSP: pyls not available for view D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\__main__.py in window 3 LSP: pyls not available for view D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\__main__.py in window 3 LSP: Already starting on this window: pyls LSP: pyls not available for view D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\__main__.py in window 3 LSP: pyls not available for view D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\__main__.py in window 3 LSP: pyls not available for view D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\__main__.py in window 3 LSP: starting active= D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\__main__.py other= 0 LSP: Already starting on this window: pyls LSP: Already starting on this window: pyls LSP: starting in F:\SublimeText\Data LSP: starting ['pyls'] LSP: --> initialize LSP: pyls not available for view F:\SublimeText\Data\Packages\LSP\plugin\core\settings.py in window 2 LSP: pyls not available for view F:\SublimeText\Data\Packages\LSP\plugin\core\settings.py in window 2 LSP: pyls not available for view F:\SublimeText\Data\Packages\LSP\plugin\core\settings.py in window 2 LSP: Already starting on this window: pyls [Package Reloader] begin ====================================================== reloading plugin LSP.boot [Package Reloader] reloading |-- LSP [Package Reloader] reloading |-- LSP.boot [Package Reloader] reloading | |-- LSP.plugin [Package Reloader] reloading | |-- LSP.plugin.core [Package Reloader] reloading | |-- LSP.plugin.core.main [Package Reloader] reloading | | |-- LSP.plugin.core.url [Package Reloader] reloading | | |-- LSP.plugin.core.protocol [Package Reloader] reloading | | |-- LSP.plugin.core.settings [Package Reloader] reloading | | |-- LSP.plugin.core.logging [Package Reloader] reloading | | |-- LSP.plugin.core.rpc [Package Reloader] reloading | | |-- LSP.plugin.core.workspace [Package Reloader] reloading | | |-- LSP.plugin.core.configurations [Package Reloader] reloading | | |-- LSP.plugin.core.clients [Package Reloader] reloading | | |-- LSP.plugin.core.events [Package Reloader] reloading | | |-- LSP.plugin.core.documents [Package Reloader] reloading | | |-- LSP.plugin.core.diagnostics [Package Reloader] reloading | | |-- LSP.plugin.core.edit [Package Reloader] reloading | |-- LSP.plugin.core.panels [Package Reloader] reloading | |-- LSP.plugin.completion [Package Reloader] reloading | |-- LSP.plugin.diagnostics [Package Reloader] reloading | |-- LSP.plugin.configuration [Package Reloader] reloading | |-- LSP.plugin.formatting [Package Reloader] reloading | |-- LSP.plugin.highlights [Package Reloader] reloading | |-- LSP.plugin.definition [Package Reloader] reloading | |-- LSP.plugin.hover [Package Reloader] reloading | | |-- LSP.plugin.core.popups [Package Reloader] reloading | |-- LSP.plugin.references [Package Reloader] reloading | |-- LSP.plugin.signature_help [Package Reloader] reloading | |-- LSP.plugin.code_actions [Package Reloader] reloading | |-- LSP.plugin.symbols [Package Reloader] reloading | |-- LSP.plugin.rename LSP: global clients: pyls=True LSP: starting active= F:\SublimeText\Data\Packages\LSP\plugin\core\settings.py other= 0 LSP: starting in F:\SublimeText\Data LSP: starting ['pyls'] LSP: --> initialize [Package Reloader] installing dummy package reloading plugin _dummy_package [Package Reloader] removing dummy package unloading plugin _dummy_package [Package Reloader] end -------------------------------------------------------- reloading /F/SublimeText/Data/debug.txt LSP: --> initialized LSP: --> workspace/didChangeConfiguration LSP: pyls client registered for window 2 LSP: --> textDocument/didOpen LSP: <-- textDocument/publishDiagnostics LSP: --> initialized LSP: --> workspace/didChangeConfiguration LSP: pyls client registered for window 2 Error handling server payload Traceback (most recent call last): File "F:\SublimeText\Data\Packages\LSP\plugin\core\rpc.py", line 133, in read_stdout self.response_handler(payload) File "F:\SublimeText\Data\Packages\LSP\plugin\core\rpc.py", line 178, in response_handler self._response_handlers[handler_id](result) File "F:\SublimeText\Data\Packages\LSP\plugin\core\main.py", line 242, in lambda result: handle_initialize_result(result, client, window, config)) File "F:\SublimeText\Data\Packages\LSP\plugin\core\main.py", line 175, in handle_initialize_result clear_starting_config(window, config.name) File "F:\SublimeText\Data\Packages\LSP\plugin\core\main.py", line 98, in clear_starting_config starting_configs_by_window[window.id()].remove(config_name) KeyError: 'pyls' LSP: --> textDocument/hover : [python_language_server] 18:04:38:0690146 Logging to the file F:/SublimeText/Data/debug.txt: 2018-01-22 18:04:41,285 UTC - ERROR - jsonrpc.manager - API Exception: {'type': 'KeyError', 'args': ('file:///F:/SublimeText/Data/Packages/LSP/plugin/core/settings.py',), 'message': "'file:///F:/SublimeText/Data/Packages/LSP/plugin/core/settings.py'"}: Traceback (most recent call last):: File "F:\Python\lib\site-packages\jsonrpc\manager.py", line 112, in _get_responses: result = method(*request.args, **request.kwargs): File "d:\user\dropbox\softwareversioning\python-language-server\pyls\dispatcher.py", line 19, in wrapped: return func(*args, **kwargs): File "d:\user\dropbox\softwareversioning\python-language-server\pyls\python_ls.py", line 162, in m_text_document__hover: return self.hover(textDocument['uri'], position): File "d:\user\dropbox\softwareversioning\python-language-server\pyls\python_ls.py", line 109, in hover: return self._hook('pyls_hover', doc_uri, position=position) or {'contents': ''}: File "d:\user\dropbox\softwareversioning\python-language-server\pyls\python_ls.py", line 40, in _hook: doc = self.workspace.get_document(doc_uri) if doc_uri else None: File "d:\user\dropbox\softwareversioning\python-language-server\pyls\workspace.py", line 110, in get_document: return self._docs[doc_uri]: KeyError: 'file:///F:/SublimeText/Data/Packages/LSP/plugin/core/settings.py': FuzzyFilePath cached 8314 files in F:/SublimeText/Data FuzzyFilePath cached 8314 files in F:/SublimeText/Data LSP: starting in D:\User\Dropbox\SoftwareVersioning\python-language-server LSP: starting ['pyls'] LSP: --> initialize LSP: pyls not available for view D:\User\Dropbox\SoftwareVersioning\python-language-server\pyls\__main__.py in window 3 LSP: --> initialized LSP: --> workspace/didChangeConfiguration LSP: pyls client registered for window 3 LSP: --> textDocument/didOpen LSP: <-- textDocument/publishDiagnostics FuzzyFilePath cached 63 files in D:/User/Dropbox/SoftwareVersioning/python-language-server FuzzyFilePath cached 8314 files in F:/SublimeText/Data reloading /F/SublimeText/Data/debug.txt ```


gatesn commented 6 years ago

@evandrocoan could you run pyls with -vv to enable debug logs?

evandrocoan commented 6 years ago

Sure, I enabled debug now, but his exception did not show up when i tried doing the same thing this time.

I will let it enabled, to see if this can happen again.

tomv564 commented 6 years ago

From the log I see this is an example of using Package Reloader (not really an end-user flow), probably with two Sublime windows open. There are known problems with LSP sharing language server state between multiple windows during startup - the first KeyError seen is already tracked as https://github.com/tomv564/LSP/issues/253.

It's likely that didOpen for one window was sent to the wrong language server at startup, then the subsequent hover for that window fails.

I recommend closing this issue as few people will reproduce it, especially when the LSP behaviour is fixed.