Fix incorrect lsp inlay hint type by MatthewMckee4 · Pull Request #20044 · astral-sh/ruff (original) (raw)

Conversation

@MatthewMckee4

Summary

Previously we just communicated that the inlay hint type was "TYPE", so now we give the correct type

@MatthewMckee4

@github-actions

MichaReiser

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

impl RetriableRequestHandler for InlayHintRequestHandler {}
fn inlay_hint_type(inlay_hint_content: &InlayHintContent) -> lsp_types::InlayHintKind {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Would you mind to also wire it up in wasm and the playground?

#[wasm_bindgen]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct InlayHint {
#[wasm_bindgen(getter_with_clone)]
pub markdown: String,
pub position: Position,
}

and here

hints: inlayHints.map((hint) => ({
label: hint.markdown,
position: {
lineNumber: hint.position.line,
column: hint.position.column,
},
})),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah

@github-actions

mypy_primer results

No ecosystem changes detected ✅
No memory usage changes detected ✅

@MatthewMckee4

@MatthewMckee4

@MatthewMckee4

Not really sure how the ide handles these kinds differently

@MatthewMckee4

MichaReiser

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

second-ed pushed a commit to second-ed/ruff that referenced this pull request

Sep 9, 2025

@MatthewMckee4 @second-ed

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

Labels

server

Related to the LSP server

ty

Multi-file analysis & type inference