File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/DDP-Projekt/DDPLS
3
3
go 1.22.2
4
4
5
5
require (
6
- github.com/DDP-Projekt/Kompilierer v0.4.0-alpha.0.20240727075930-9369ebd7971e
6
+ github.com/DDP-Projekt/Kompilierer v0.4.0-alpha.0.20240810130912-13f2cd903dcb
7
7
github.com/tliron/commonlog v0.2.8
8
8
github.com/tliron/glsp v0.2.2-0.20240309182338-ab78d718ad7d
9
9
)
Original file line number Diff line number Diff line change 1
- github.com/DDP-Projekt/Kompilierer v0.4.0-alpha.0.20240727075930-9369ebd7971e h1:7ljq6q/rKTPJZ4um9KNfGeULStZpiXw88zVf+IXVT20 =
2
- github.com/DDP-Projekt/Kompilierer v0.4.0-alpha.0.20240727075930-9369ebd7971e /go.mod h1:vp0zj11n6rP/B+o7BIXmUhhjrpZNO1c7/pf+VPSHIzM =
1
+ github.com/DDP-Projekt/Kompilierer v0.4.0-alpha.0.20240810130912-13f2cd903dcb h1:CZP0ZVHQXduIWCX9UVNOg9DvDTUBDPGwuPBCxOWHkEQ =
2
+ github.com/DDP-Projekt/Kompilierer v0.4.0-alpha.0.20240810130912-13f2cd903dcb /go.mod h1:vp0zj11n6rP/B+o7BIXmUhhjrpZNO1c7/pf+VPSHIzM =
3
3
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k =
4
4
github.com/aymanbagabas/go-osc52/v2 v2.0.1 /go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8 =
5
5
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c =
Original file line number Diff line number Diff line change @@ -365,13 +365,14 @@ func (vis *importVisitor) VisitImportStmt(imprt *ast.ImportStmt) ast.VisitResult
365
365
vis .items = make ([]protocol.CompletionItem , 0 , len (dudenPaths ))
366
366
367
367
incompletePath := filepath .Dir (ast .TrimStringLit (& imprt .FileName ))
368
+ hasDudenPrefix := strings .HasPrefix (incompletePath , "Duden" )
368
369
369
- if incompletePath == "." {
370
+ if incompletePath == "." || hasDudenPrefix {
370
371
addDudenPaths (vis .items )
371
372
}
372
373
373
374
searchPath := filepath .Join (filepath .Dir (vis .modPath ), incompletePath )
374
- if vis . isSlashCompletion && incompletePath == "Duden" {
375
+ if hasDudenPrefix {
375
376
searchPath = ddppath .Duden
376
377
}
377
378
@@ -392,6 +393,7 @@ func (vis *importVisitor) VisitImportStmt(imprt *ast.ImportStmt) ast.VisitResult
392
393
path = incompletePath + "/" + path
393
394
}
394
395
finalPath := strings .TrimPrefix (path , "./" )
396
+ finalPath = strings .TrimPrefix (finalPath , ast .TrimStringLit (& imprt .FileName ))
395
397
vis .items = append (vis .items , pathToCompletionItem (finalPath ))
396
398
}
397
399
}
You can’t perform that action at this time.
0 commit comments