[all-commits] [llvm/llvm-project] b870d4: [clangd][ParseHLSL] Fix register attribute source ...

Maria Fernanda GuimarĂ£es via All-commits all-commits at lists.llvm.org
Thu Aug 6 10:27:12 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b870d4f83b0b98fb469e1ef5baa845f5e2e5f24a
      https://github.com/llvm/llvm-project/commit/b870d4f83b0b98fb469e1ef5baa845f5e2e5f24a
  Author: Maria Fernanda GuimarĂ£es <66797940+mafeguimaraes at users.noreply.github.com>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M clang-tools-extra/clangd/unittests/HoverTests.cpp
    M clang/lib/Parse/ParseHLSL.cpp
    M clang/test/AST/HLSL/resource_binding_attr.hlsl

  Log Message:
  -----------
  [clangd][ParseHLSL] Fix register attribute source range for hover inside arguments (#212881)

Hovering on the slot identifier inside `register(t1)` (e.g. on `t1`)
previously produced no tooltip, only hovering on the `register` keyword
itself worked.

`HLSLResourceBindingAttr`'s `SourceRange` was zero-width: both the start
and end pointed to the start of the `register` keyword.
`ParseHLSLAnnotations` called `Attrs.addNew` with a single
`SourceLocation` instead of a full `SourceRange`. Since clangd's
`SelectionTree` only matches when the cursor falls inside an attribute's
range, a zero-width range never matched positions inside the argument.

Capture the closing `)` location before it's consumed in the
`AT_HLSLResourceBinding` case, and pass a full `SourceRange` (from the
attribute start to the closing paren) to `addNew`.

Fixes #212749



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list