4 files changed,
12 insertions(+),
12 deletions(-)
Author:
Oleksandr Smirnov
olexsmir@gmail.com
Committed at:
2026-09-03 13:51:47 +0300
Authored at:
2026-09-02 23:22:58 +0300
Change ID:
kyvqlmuvwmsuwnrnsyrzksuympvslutw
Parent:
17e6766
M
internal/lsp/textdocument_selection_range.go
··· 232 232 if !ok { 233 233 continue 234 234 } 235 - return postingSelection(content, p, li, cursor, postingSel), true 235 + return postingSelection(content, postings[i], li, cursor, postingSel), true 236 236 } 237 237 return protocol.SelectionRange{}, false 238 238 } 239 239 240 -func postingSelection(content string, p *ast.Posting, li *lsputil.LineIndex, cursor int, parent protocol.SelectionRange) protocol.SelectionRange { 240 +func postingSelection(content string, p ast.Posting, li *lsputil.LineIndex, cursor int, parent protocol.SelectionRange) protocol.SelectionRange { 241 241 if p.Status.Value != ast.StatusNone { 242 242 if sel, ok := selectionForSpan(content, li, p.Status.Span, cursor, parent); ok { 243 243 return sel
M
internal/lsp/textdocument_semantic_tokens.go
··· 384 384 emitComment(t.HeaderComments[i], emit) 385 385 } 386 386 for _, p := range t.Postings { 387 - visitPosting(content, &p, emit) 387 + visitPosting(content, p, emit) 388 388 } 389 389 } 390 390 ··· 421 421 emitComment(pt.HeaderComments[i], emit) 422 422 } 423 423 for _, p := range pt.Postings { 424 - visitPosting(content, &p, emit) 424 + visitPosting(content, p, emit) 425 425 } 426 426 } 427 427 ··· 437 437 emitComment(at.HeaderComments[i], emit) 438 438 } 439 439 for _, p := range at.Postings { 440 - visitPosting(content, &p, emit) 440 + visitPosting(content, p, emit) 441 441 } 442 442 } 443 443 444 -func visitPosting(content string, p *ast.Posting, emit semEmitFunc) { 444 +func visitPosting(content string, p ast.Posting, emit semEmitFunc) { 445 445 if p.Status.Value != ast.StatusNone { 446 446 emit(p.Status.Span, semStatus, 0) 447 447 }
M
journal/printer/directives.go
··· 40 40 } 41 41 if c.FormatSub.KeywordSpan.End.Offset == 0 { 42 42 // inline form: "commodity $1,000.00" 43 - p.writeCommodityAmount(&c.FormatSub.Amount) 43 + p.writeCommodityAmount(c.FormatSub.Amount) 44 44 p.writeInlineComment(c.Comment) 45 45 return 46 46 } ··· 49 49 p.buf.WriteByte('\n') 50 50 p.buf.WriteString(p.indent) 51 51 p.buf.WriteString("format ") 52 - p.writeCommodityAmount(&c.FormatSub.Amount) 52 + p.writeCommodityAmount(c.FormatSub.Amount) 53 53 p.writeInlineComment(c.FormatSub.Comment) 54 54 p.writeBlockComments(c.BlockComments) 55 55 } 56 56 57 57 // writeCommodityAmount renders a commodity format amount, preserving the 58 58 // original commodity placement instead of the config's CommodityPos. 59 -func (p *printer) writeCommodityAmount(a *ast.Amount) { 59 +func (p *printer) writeCommodityAmount(a ast.Amount) { 60 60 prec := max(a.QuantityFmt.Precision, 2) 61 61 if a.Commodity == "" { 62 62 p.writeDecimal(a.Quantity, a.QuantityFmt, prec)
M
journal/printer/transaction_postings.go
··· 23 23 24 24 func (p *printer) writePostingsTwoSpaces(postings []ast.Posting, maxAcct int) { 25 25 for _, pt := range postings { 26 - p.writePostingLine(&pt, maxAcct) 26 + p.writePostingLine(pt, maxAcct) 27 27 p.buf.WriteByte('\n') 28 28 for _, c := range pt.Comments { 29 29 p.buf.WriteString(p.indent) ··· 40 40 lp := &printer{cfg: p.cfg, indent: p.indent} 41 41 for _, pt := range postings { 42 42 lp.buf.Reset() 43 - lp.writePostingLine(&pt, maxAcct) 43 + lp.writePostingLine(pt, maxAcct) 44 44 _, _ = fmt.Fprintln(tw, lp.buf.String()) 45 45 for _, c := range pt.Comments { 46 46 lp.buf.Reset() ··· 59 59 p.buf.WriteByte('\n') 60 60 } 61 61 62 -func (p *printer) writePostingLine(pt *ast.Posting, maxAcct int) { 62 +func (p *printer) writePostingLine(pt ast.Posting, maxAcct int) { 63 63 p.buf.WriteString(p.indent) 64 64 65 65 if pt.Status.Value != ast.StatusNone {