File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import (
1616)
1717
1818var (
19- Version = "2.1.79 "
19+ Version = "2.1.80 "
2020 Commit = "none"
2121 Date = "24.10.2025"
2222)
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ func TestRunBridge(t *testing.T) {
2828 hitCount ++
2929 w .Header ().Set ("Content-Type" , "application/json" )
3030 // Echo it to prove it hit the server
31- w .Write ([]byte (`{"jsonrpc":"2.0", "result": ` + string (body ) + `}` ))
31+ _ , _ = w .Write ([]byte (`{"jsonrpc":"2.0", "result": ` + string (body ) + `}` ))
3232 }))
3333 server .Start ()
3434 defer server .Close ()
Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ import (
1616// Only the fields we need to access (mu + free) are declared.
1717type nodeArenaPool struct {
1818 mu sync.Mutex
19- class uint8
20- maxSize int
19+ _ uint8 // class
20+ _ int // maxSize
2121 free []* struct {} // opaque; we just need to nil the slice
2222}
2323
Original file line number Diff line number Diff line change @@ -8,51 +8,24 @@ import (
88 "os"
99 "path/filepath"
1010 "strings"
11- "sync"
12-
1311 "github.com/PuerkitoBio/goquery"
1412 pkgParser "github.com/doITmagic/rag-code-mcp/pkg/parser"
15- "github.com/odvcencio/gotreesitter"
16- "github.com/odvcencio/gotreesitter/grammars"
1713)
1814
1915func init () {
2016 pkgParser .Register (NewAnalyzer ())
2117}
2218
2319// Analyzer implements the pkgParser.Analyzer interface for HTML.
24- // Caches gotreesitter.Parser instances per language to avoid re-allocating expensive lookup tables.
2520type Analyzer struct {
26- ca * CodeAnalyzer
27- mu sync.Mutex
28- parsers map [string ]* gotreesitter.Parser
21+ ca * CodeAnalyzer
2922}
3023
3124// NewAnalyzer creates a new HTML analyzer.
3225func NewAnalyzer () * Analyzer {
3326 return & Analyzer {
34- ca : NewCodeAnalyzer (),
35- parsers : make (map [string ]* gotreesitter.Parser ),
36- }
37- }
38-
39- func (a * Analyzer ) getOrCreateParser (lang * grammars.LangEntry ) * gotreesitter.Parser {
40- a .mu .Lock ()
41- defer a .mu .Unlock ()
42- if cached , ok := a .parsers [lang .Name ]; ok {
43- return cached
27+ ca : NewCodeAnalyzer (),
4428 }
45- p := gotreesitter .NewParser (lang .Language ())
46- a .parsers [lang .Name ] = p
47- return p
48- }
49-
50- // ReleaseResources drops cached tree-sitter parsers so the GC can
51- // reclaim the arena memory they reference.
52- func (a * Analyzer ) ReleaseResources () {
53- a .mu .Lock ()
54- defer a .mu .Unlock ()
55- a .parsers = make (map [string ]* gotreesitter.Parser )
5629}
5730
5831// Name returns "html".
Original file line number Diff line number Diff line change 1+
2+ body {
3+ color : # fff ;
4+ }
5+
You can’t perform that action at this time.
0 commit comments