Closed ubaldot closed 2 months ago
What does the server log say?
EDIT: I am not sure if it is exactly what you asked, but here is the initialization request log:..
For some obscure reasons now it works.
I reopen because whilst it works on Linux, pylsp-mypy does not seem to work on macos. Here is few messages from the server:
pylsp v1.7.4 mypy 1.11.2 (compiled: yes) pylsp-mypy 0.6.9
09/24/24 21:46:49: Received {'method': 'textDocument/publishDiagnostics', 'jsonrpc': '2.0', 'params': {'uri': 'file:///Users/ubaldot/Documents/dymoval/src/dymoval/validation.py', 'diagnostics': []}}
09/24/24 21:46:49: Received {'method': 'textDocument/publishDiagnostics', 'jsonrpc': '2.0', 'params': {'uri': 'file:///Users/ubaldot/Documents/dymoval/src/dymoval/validation.py', 'diagnostics': []}}
'pylsp' Language Server Initialize Request
==========================================
capabilities: {'workspace': {'workspaceFolders': true, 'configuration': true, 'workspaceEdit': {'resourceOperations': ['rename', 'create', 'delete']}, 'symbol': {'dynamicRegistration': false}, 'applyEdit': true}, 'offsetEncoding': ['utf-32', 'utf-16', 'utf-8'], 'window': {}, 'general': {'positionEncodings': ['utf-32', 'utf-16', 'utf-8']}, 'textDocument': {'callHierarchy': {'dynamicRegistration': false}, 'rename': {'prepareSupport': false, 'dynamicRegistration': false}, 'codeAction': {'isPreferredSupport': true, 'disabledSupport': true, 'codeActionLiteralSupport': {'codeActionKind': {'valueSet': ['', 'quickfix', 'refactor', 'refactor.extract', 'refactor.inline', 'refactor.rewrite', 'source', 'source.organizeImports']}}, 'dynamicRegistration': false}, 'completion': {'completionItem': {'insertReplaceSupport': false, 'snippetSupport': false, 'resolveSupport': {'properties': ['detail', 'documentation']}, 'documentationFormat': ['markdown', 'plaintext']}, 'dynamicRegistration': false, 'completionItemKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}}, 'formatting': {'dynamicRegistration': false}, 'codeLens': {'dynamicRegistration': false}, 'inlayHint': {'dynamicRegistration': false}, 'hover': {'dynamicRegistration': false, 'contentFormat': ['markdown', 'plaintext']}, 'rangeFormatting': {'dynamicRegistration': false}, 'declaration': {'dynamicRegistration': false, 'linkSupport': true}, 'references': {'dynamicRegistration': false}, 'selectionRange': {'dynamicRegistration': false}, 'typeHierarchy': {'dynamicRegistration': false}, 'foldingRange': {'rangeLimit': 5000, 'foldingRange': {'collapsedText': true}, 'dynamicRegistration': false, 'foldingRangeKind': {'valueSet': ['comment', 'imports', 'region']}, 'lineFoldingOnly': true}, 'documentSymbol': {'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}, 'dynamicRegistration': false, 'labelSupport': false, 'hierarchicalDocumentSymbolSupport': true}, 'publishDiagnostics': {'dataSupport': true, 'relatedInformation': false, 'codeDescriptionSupport': true, 'versionSupport': true}, 'synchronization': {'didSave': true, 'WillSaveWaitUntil': false, 'willSave': false, 'dynamicRegistration': false}, 'documentHighlight': {'dynamicRegistration': false}, 'implementation': {'dynamicRegistration': false, 'linkSupport': true}, 'typeDefinition': {'dynamicRegistration': false, 'linkSupport': true}, 'semanticTokens': {'serverCancelSupport': false, 'requests': {'full': {'delta': true}, 'range': false}, 'multilineTokenSupport': false, 'dynamicRegistration': false, 'overlappingTokenSupport': false, 'tokenTypes': ['type', 'class', 'enum', 'interface', 'struct', 'typeParameter', 'parameter', 'variable', 'property', 'enumMember', 'event', 'function', 'method', 'macro', 'keyword', 'modifier', 'comment', 'string', 'number', 'regexp', 'operator'], 'tokenModifiers': ['declaration', 'definition', 'readonly', 'static', 'deprecated', 'abstract', 'async', 'modification', 'documentation', 'defaultLibrary'], 'formats': ['relative'], 'augmentsSyntaxTokens': true}, 'signatureHelp': {'signatureInformation': {'activeParameterSupport': true, 'documentationFormat': ['markdown', 'plaintext']}, 'dynamicRegistration': false}, 'definition': {'dynamicRegistration': false, 'linkSupport': true}}}
clientInfo: {'version': '9010727', 'name': 'Vim'}
initializationOptions: {}
processId: 33640
rootPath: '/Users/ubaldot/Documents/dymoval'
rootUri: 'file:///Users/ubaldot/Documents/dymoval/'
trace: 'off'
workspaceFolders: [{'uri': 'file:///Users/ubaldot/Documents/dymoval/', 'name': 'dymoval'}]
'pylsp' Language Server Capabilities
====================================
codeActionProvider: true
codeLensProvider: {'resolveProvider': false}
completionProvider: {'resolveProvider': true, 'triggerCharacters': ['.']}
definitionProvider: true
documentFormattingProvider: true
documentHighlightProvider: true
documentRangeFormattingProvider: true
documentSymbolProvider: true
executeCommandProvider: {'commands': []}
experimental: {}
foldingRangeProvider: true
hoverProvider: true
referencesProvider: true
renameProvider: true
signatureHelpProvider: {'triggerCharacters': ['(', ',', '=']}
textDocumentSync: {'save': {'includeText': true}, 'change': 2, 'openClose': true}
workspace: {'workspaceFolders': {'changeNotifications': true, 'supported': true}}
~additionalInitResult_serverInfo: {'version': '1.7.4', 'name': 'pylsp'}
If you start pylsp
with -vv
you should get debug output. Is any of that from pylsp-mypy
?
I think I found it:
2024-09-25 22:01:42,476 CEST - INFO - pylsp.config.config - Failed to load pylsp entry point 'pylsp_mypy': (typing-extensions 4.5.0 (/opt/homebrew/Caskroom/miniconda/base/envs/dymoval_dev/lib/python3.11/site-packages), Requirement.parse('typing-extensions>=4.6.0'), {'mypy'})
it seems that the plugin requires typing-extensions>=4.6.0 but I have the 4.5.0 installed. EDIT: solved by updating the package.
It is mypy
that requires typing-extensions>=4.6.0
.
I guess there is a check that fires once it is imported by pylsp-mypy
.
How you manged to install mypy
without its dependencies fulfilled, I do not know.
I simply conda install mypy
:)
I am using Vim with lsp and I am using pylsp with the following setting:
I am invoking the lsp with
pylsp ----check-parent-process -v
and in mypyproject.toml
I have the following:All pylsp features work perfectly but
pylsp-mypy
. Runningmypy
fromiTerms
works well.mypy
version is 1.11.2 andpylsp
v1.7.3. I don't have any mypy-related configuration settings in~/.config
and similar.