Comments (14)
@pappasam Thank you. I verified that this is fixed.
from jedi-language-server.
Strange... which version of jedi-language-server is this being generated by? On version 0.28.4
, if your editor prefers markdown and you haven't explicitly configured your preferred markup as plaintext, jedi-language-server returns the following text wrapped in triple ticks without any language format specified:
See: https://github.com/pappasam/jedi-language-server/pull/72/files
from jedi-language-server.
I will investigate this and move it accordingly. It might take me a couple of days to get to this.
from jedi-language-server.
This is the request and response for hover:
[Trace - 1:28:34 AM] Sending request 'textDocument/hover - (716)'.
Params: {
"textDocument": {
"uri": "file:///c%3A/GIT/jedi-language-server/tests/test_data/hover/hover_test1.py"
},
"position": {
"line": 2,
"character": 14
}
}
[Trace - 1:28:34 AM] Received response 'textDocument/hover - (716)' in 8ms.
Result: {
"contents": {
"kind": "markdown",
"value": "```\nModule doc string for testing\n```\n"
},
"range": {
"start": {
"line": 2,
"character": 7
},
"end": {
"line": 2,
"character": 17
}
}
}
I don't think the text should be wrapper in triple-back ticks.
This is form pylance
, where we wrap only the name of the module in triple-back ticks:
[Trace - 1:35:06 AM] Received response 'textDocument/hover - (16)' in 3ms.
Result: {
"contents": {
"kind": "markdown",
"value": "```python\n(module) somemodule\n```\n---\nModule doc string for testing"
},
"range": {
"start": {
"line": 2,
"character": 8
},
"end": {
"line": 2,
"character": 18
}
}
}
from jedi-language-server.
This is intended to show pre-formatted text from docstrings as such (preserving white spaces and using constant character width).
IMO the issue is with you editor as fenced backticks without info string (language specifier) should not use syntax highlighting, see common markdown specification and test cases. In particular Python docstrings include code blocks of other languages which may not have universally supported code highlighters (e.g. production lists) or which cannot be determined from static analysis.
from jedi-language-server.
But if there are no indents at all AND we can safely assume there it is no code either then the backticks could be removed indeed.
from jedi-language-server.
@karthiknadig Is this Emacs? Cause I'm seeing the same trace from lsp-mode's log. There are two issues here I believe, one is even if the server was initialized with "markupKindPreferred": "plaintext"
, the completion.completionItem.documentationFormat
returned from the server is still "markdown"
. Also, Emacs's lsp-mode is also doing something weird when rendering the completion documentation as well, as I think the docs are getting font-locked twice.
Update
This looks up a emacs lsp-mode problem as the documentationFormat is currently hardcoded as markdown.
from jedi-language-server.
There's also an additional problem: if the client declares capabilities "completion.completionItem.documentationFormat": ["markdown", "plaintext"]
, and the server is initialized to "jedi.markupKindPreferred": "plaintext"
, the client capabilities still wins so there's not really a way to prefer plaintext in user configuation.
But the jls code in choose_markup
seems to prefer the value in jedi.markupKindPreferred
, but the server traces shows the documentation kind is markdown... somewhere the preferred value is lost...
from jedi-language-server.
Ok this is my fault, lsp-jedi's initializationOptions shouldn't be nested inside an extra jedi dict...
from jedi-language-server.
@wyuenho This is from VS Code.
from jedi-language-server.
@karthiknadig I believe this has been resolved in the latest release. Please let me know if you think otherwise.
from jedi-language-server.
I will test this sometime this week.
But we can't take this in the extension. Since we have not yet deprecated 3.6.*. If i understand correctly this now requires python greater than 3.6.2?
from jedi-language-server.
Ah, in that case I'll look into re-adding support for 3.6.0+. Removing support simplified some thing for development dependencies, but since I don't think any regular dependencies are impacted, I can probably find a workaround. Stay tuned!
from jedi-language-server.
@karthiknadig jls 0.33.0 now supports all Python 3.6+!
from jedi-language-server.
Related Issues (20)
- Hover on notebook fails HOT 3
- Exits Immediately on Python 3.12 alpha HOT 2
- Editor opens internal typeshed file instead of real file in venv HOT 1
- [question] a way to ignore sub-directories HOT 5
- Problems with Jedi in VS Code HOT 5
- Can not compile from sources.
- Error due to CompletionOptions HOT 6
- Extracting method issue
- triple-quotes cause completion of files in the current working direcrory HOT 8
- signature helper does not work for variadic functions HOT 5
- `lsp_python_diagnostic` may use invalid `lsprotocol.types.Position.character`
- VSCode - Changing from Pylance to Jedi causes Language Server to crash & not come back until switching back to Pylance HOT 2
- Is there a setting to disable path completion? HOT 2
- how to run jedi to find references using a lsp client? HOT 1
- Query Regarding Wild-card Import Support for "Go to Definition" HOT 1
- Pydantic-core build failures. "Unsupported Python Interpreter: python3.10" HOT 2
- No way to disable follow_imports in goto HOT 9
- LSP values aren't being injected into `nvim-cmp` HOT 5
- Odd `'Workspace' object has no attribute'_root_path'` error with nvim-lspconfig HOT 3
- Make `textDocument/documentSymbol` ignore imported symbols
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jedi-language-server.