microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.68k stars 771 forks source link

Some lines in docstrings aren't rendered at all #5431

Closed NewtonChutney closed 5 months ago

NewtonChutney commented 5 months ago

Type: Bug

I was checking the source of the DAG class of Apache Airflow (https://github.com/apache/airflow/blob/main/airflow/models/dag.py#L300), and found that certain lines were completely missing.. Cross checking in my helix-editor, it rendered the missing line italicized. Helix uses python-lsp-server, which in turn uses Jedi, the same as the VSCode extension if I'm not wrong? Where's the difference arising from?

VSCode render: ![image](https://github.com/microsoft/vscode-python/assets/70827815/7f042434-98b4-4137-9292-7c48b2cdd393)
Helix editor render Config: - using the [default pylsp config](https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers#python---pylsp) - `pip install -U 'python-lsp-server[all]'` -> in the log i find jedi: ![image](https://github.com/microsoft/vscode-python/assets/70827815/d5027ad8-b55d-4544-b3f2-8b00c090722f) Render: ![image](https://github.com/microsoft/vscode-python/assets/70827815/4cf1a4a8-36e7-4004-912d-d9239cbb5bd0)

Extension version: 2023.22.1 VS Code version: Code 1.85.2 (8b3775030ed1a69b13e4f4c628c612102e30a681, 2024-01-18T06:40:10.514Z) OS version: Windows_NT x64 10.0.22631 Modes: Remote OS version: Linux x64 5.14.0-362.13.1.el9_3.x86_64

A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:30899288 vscaac:30438847 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 0bi6i642:30951795 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 dsvsc019acf:30951919 3ef8e399:30949928 ```
karthiknadig commented 5 months ago

@NewtonChutney can you share the value of python.languageServer setting?

NewtonChutney commented 5 months ago

It's unmodified at "default", okay, so we're using pylance.. Just checked in the Python Language Server output.. Is pylance under the scope of this extension, or can we move this issue to that repo?

Viicos commented 5 months ago

Afaik Sphinx syntax isn't fully supported out of the box by VSCode, in particular directives as shown in your screenshot. The thing is most of the time, rst syntax is being used in docstrings but as part as Sphinx documentation, so it might be making use of custom directives or extensions, intersphinx could be used when making cross references, etc

NewtonChutney commented 5 months ago

What would be the way forward? As a user-facing platform, we expect it to handle these.. Even if the syntax isn't supported shouldn't it atleast render the lines in plaintext without italicizing? Our team lost the deprecation notices, but luckily I was using another editor..

Viicos commented 5 months ago

(fyi, I'm not part of Microsoft)

It would be great indeed to have directives rendered even in plain text, I also noticed they were skipped in docstrings.

There's this extension: https://marketplace.visualstudio.com/items?itemName=lextudio.restructuredtext which uses https://marketplace.visualstudio.com/items?itemName=swyddfa.esbonio as a LSP. It doesn't support rendering docstring, but that might be feature request they could handle

NewtonChutney commented 5 months ago

(fyi, I'm not part of Microsoft)

It would be great indeed to have directives rendered even in plain text, I also noticed they were skipped in docstrings

Sorry if I came across strong, just was in a hurry to escalate this blatant overlook.. 😞

NewtonChutney commented 5 months ago

@heejaechang could you inform us the way forward? For now at least stopping skipping lines would be appreciated?

NewtonChutney commented 5 months ago

Do we link this to #2251 and close this issue?

heejaechang commented 5 months ago

closed as a dup. another case where our doc string builder can't handle.