Skip to content

read-only fixes - #45

Merged
emuell merged 5 commits into
masterfrom
fix-not-read-only
Sep 22, 2026
Merged

emuell merged 5 commits into
masterfrom
fix-not-read-only

Conversation

@unlessgames

Copy link
Copy Markdown
Collaborator

Fixed indices in the song incorrectly being tagged READ-ONLY, I assume you meant to tag the related observables.

Unified all read-only tags to follow the "post-type" style to make the def files more uniform.

Added read-only flags to more observables along the way.

Fixed a typo.

@emuell

emuell commented Sep 18, 2026

Copy link
Copy Markdown
Member

Yes, only the observables should have been marked as read-only here.

But moving the READ-ONLY tag to the end of the @field will hide existing docs above the field:

---**READ-ONLY** Selected in the instrument box. 
---@field selected_instrument renoise.Instrument

This shows **READ-ONLY** Selected in the instrument box. as doc when hovering.

---Selected in the instrument box. 
---@field selected_instrument renoise.Instrument **READ-ONLY**

This now only shows **READ-ONLY**

@unlessgames

Copy link
Copy Markdown
Collaborator Author

Fixed that and some other cases where the same thing silently omitted available descriptions (mostly when a "Range" was specified after the type). Added a few more missing read-only tags, and narrowed the types for ranges as two item tables instead of just a integer[].

Removed some descriptions that were literally just the name of the field capitalized, more of these remain for another clean-up. There are also cases where the description for one field is treated as a kind of header for multiple fields below it, this makes sense when reading the actual annotation source but less so when rendered in the book. We might want to go through these at some point and clean up as well.

An example of this (still in song.lua)

---Song Comments
---@field artist string
---@field artist_observable renoise.Document.Observable **READ-ONLY**
---@field name string
---@field name_observable renoise.Document.Observable **READ-ONLY**
---Note: All property tables of basic types in the API are temporary copies.
---In other words `comments = { "Hello", "World" }` will work,
---`comments[1] = "Hello"; renoise.song().comments[2] = "World"`
---will *not* work.
---@field comments string[]
---@field comments_observable renoise.Document.ObservableList **READ-ONLY**
---Notifier is called as soon as any paragraph in the comments change.
---**READ-ONLY**
---@field comments_assignment_observable renoise.Document.Observable
---Set this to true to show the comments dialog after loading a song
---@field show_comments_after_loading boolean
---@field show_comments_after_loading_observable renoise.Document.Observable **READ-ONLY**

---Song Comments at the beginning is meant to summarize this whole section but it's actually just the hint for the artist field for the LSP.

@emuell

emuell commented Sep 22, 2026

Copy link
Copy Markdown
Member

Thanks. Works great now.

@emuell
emuell merged commit 3b949fa into master Sep 22, 2026
@emuell
emuell deleted the fix-not-read-only branch September 22, 2026 19:58
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.

2 participants