Skip to content

Document links for import statements - #16

Merged
cushycush merged 1 commit into
mainfrom
feat/document-links
Apr 17, 2026
Merged

Document links for import statements#16
cushycush merged 1 commit into
mainfrom
feat/document-links

Conversation

@cushycush

@cushycush cushycush commented Apr 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement textDocument/documentLink so QML import statements are clickable in the editor.
  • Named modules (import QtQuick, import QtQuick.Controls) resolve to the qmldir file discovered during qmltypes scanning.
  • Relative string imports (import "./components") resolve against the current document and prefer the target directory's qmldir when one exists.
  • Dotted module names fall back to parent modules on a miss, so import QtQuick.Particles still opens QtQuick's qmldir when the submodule isn't registered.

Test plan

  • go test -race ./...
  • go vet ./...
  • Verify in editor: open a QML file, hover over import QtQuick, Cmd/Ctrl-click to navigate.

Adds textDocument/documentLink so editors turn `import QtQuick`,
`import QtQuick.Controls`, and `import "./components"` into clickable
targets. Named modules resolve to the qmldir discovered during qmltypes
scanning; relative string imports resolve against the current document
and prefer the target directory's qmldir when one exists. Dotted module
names walk up parent modules on a miss, so `import QtQuick.Particles`
still opens QtQuick's qmldir when the submodule isn't registered.
@cushycush
cushycush merged commit 3490c84 into main Apr 17, 2026
3 checks passed
@cushycush
cushycush deleted the feat/document-links branch April 17, 2026 03:40
cushycush added a commit that referenced this pull request Apr 17, 2026
…-member completion

Reflects features from #16, #17, and this PR in the README so readers
don't have to cross-reference the CHANGELOG.
cushycush added a commit that referenced this pull request Apr 17, 2026
…nt links

The three features shipped in #16, #17, and #18 weren't reflected in the
README. Updates the completions list, broadens the Go to Definition
entry, and adds a Document Links entry.
cushycush added a commit that referenced this pull request Apr 17, 2026
…nt links (#19)

The three features shipped in #16, #17, and #18 weren't reflected in the
README. Updates the completions list, broadens the Go to Definition
entry, and adds a Document Links entry.
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.

1 participant