Skip to content

Remove (seemingly incorrect) workaround for old markdown parser - #2930

Merged
rchl merged 1 commit into
mainfrom
fix/remove-workaround
May 25, 2026
Merged

rchl merged 1 commit into
mainfrom
fix/remove-workaround

Conversation

@rchl

@rchl rchl commented May 25, 2026

Copy link
Copy Markdown
Member

Discussion and context in #2928

Fixes #2928

@rchl

rchl commented May 25, 2026 •

Copy link
Copy Markdown
Member Author

Well, it would regress clangd so maybe we should instead make it more specific.

Before

Screenshot 2026-05-25 at 18 04 07

After

Screenshot 2026-05-25 at 18 04 18

Payload

{
  "contents": {
    "kind": "markdown",
    "value": "### instance-method `assign`\n\nprovided by `<vector>`\n\n---\n→ `void`\n\nParameters:\n\n- `_InputIterator __first`\n- `_InputIterator __last`\n\n---\n```cpp\n// In vector<char>\npublic: template <\n    class _InputIterator,\n    __enable_if_t<\n        __has_exactly_input_iterator_category<_InputIterator>::value &&\n            is_constructible<value_type, typename iterator_traits<\n                                             _InputIterator>::reference>::value,\n        int> = 0>\nvoid assign(_InputIterator __first, _InputIterator __last)\n```"
  },
  "range": {
    "end": {
      "character": 12,
      "line": 17
    },
    "start": {
      "character": 6,
      "line": 17
    }
  }
}

@rchl

rchl commented May 25, 2026

Copy link
Copy Markdown
Member Author

We can add a workaround inside LSP-clangd itself. Probably something like result = re.sub('[ ]{2,}\n-', '\n\n-', result)

@rchl
rchl merged commit 5561bfa into main May 25, 2026
19 of 24 checks passed
@rchl
rchl deleted the fix/remove-workaround branch May 25, 2026 18:11
@rwols

rwols commented May 25, 2026

Copy link
Copy Markdown
Member

Why does the code flow not use the CommonMark parser from mdpopups?

@jwortmann

Copy link
Copy Markdown
Member

Why does the code flow not use the CommonMark parser from mdpopups?

It does:

LSP/plugin/core/views.py

Lines 601 to 602 in 5561bfa

if MARKO_MD_PARSER_VERSION:
frontmatter["markdown_parser"] = "marko"

But only if supported by the mdpopups version (i.e. on ST dev build).

@rwols

rwols commented May 26, 2026

Copy link
Copy Markdown
Member

So: it should be auto-fixed when MARKO_MD_PARSER_VERSION becomes true-ish for the majority of users. Then we can remove the workaround.

I will revert this because it breaks my hover info.

rwols added a commit that referenced this pull request May 26, 2026
@rchl

rchl commented May 26, 2026

Copy link
Copy Markdown
Member Author

Wait. I said that I will add this workaround to LSP-clangd instead, where it belongs.

@rchl

rchl commented May 26, 2026

Copy link
Copy Markdown
Member Author

And please follow our convention and only push any meaningful changes to main through a PR.

@rwols

rwols commented May 26, 2026

Copy link
Copy Markdown
Member

Not all users use LSP-* helper packages... so that would only help for a subset of the users.

@rwols

rwols commented May 26, 2026

Copy link
Copy Markdown
Member

And please follow our convention and only push any meaningful changes to main through a PR.

OK, I'll keep it in mind.

@rchl

rchl commented May 26, 2026 •

Copy link
Copy Markdown
Member Author

Not all users use LSP-* helper packages... so that would only help for a subset of the users.

I think this is a pretty weak argument. We don't have numbers of course but why would one not uses dedicated package for it given that it provides all the extra convenience like documented settings and extra features? And also that's the documented way to set up clangd according to our instructions.

It doesn't even use managed server by default so those who have problem with that shouldn't complain either.

I think that if someone is in the minority that is not using that package should also not mind this minor rendering inconvenience.

I don't want to create a conflict about this now but I really think you should revert your revert. It's an issue in clangd so we shouldn't create incorrect and non-compliant workarounds that break rendering in other servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with rendering paragraphs

3 participants