Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Release Notes

## v0.1.2 (2025-05-15)
- 🐛 Fixed bug with autocompletion not working properly on vscode editor

## v0.1.1 (2025-05-12)
- Fixed issue with autocompletion not working properly in some cases
- 🐛 Fixed bug with autocompletion not working properly in some cases

## v0.1.0 (2025-05-03)
- Added `build.yml` file for GitHub actions to build releases with all LSP binaries
- Added `build.yml` file for GitHub actions to build releases with all LSP binaries

## v0.0.2 (2025-04-25)
- Improved logger
- Add generating `build-version` file to `bin` directory
- Improved logger
- ✨ Added generating `build-version` file to `bin` directory

## v0.0.1 (2025-04-16)
- Added completions for directives
- Added showing hover information for directives
- Added completions for directives
- Added showing hover information for directives

4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ push:
git push
@echo "✅ Pushed to GitHub!"

.PHONE: build
build:
go build main.go

.DEFAULT_GOAL := test
19 changes: 1 addition & 18 deletions analysis/completion.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package analysis

import (
"regexp"
"strings"

"github.com/textwire/lsp/lsp"
Expand All @@ -20,19 +19,6 @@ func (s *State) Completion(id int, uri string, pos lsp.Position) (lsp.Completion
return s.completionResponse(id, nil), nil
}

line := lines[pos.Line]
cursorPos := int(pos.Character)
textBeforeCursor := line[:cursorPos]

directiveRegex := regexp.MustCompile(`(^|[^\\])@(\w*)$`)
directiveMatch := directiveRegex.FindStringSubmatch(textBeforeCursor)

if directiveMatch == nil {
return s.completionResponse(id, []lsp.CompletionItem{}), nil
}

directiveName := directiveMatch[2]

directives, err := completions.GetDirectives("en")
if err != nil {
return lsp.CompletionResponse{}, err
Expand All @@ -41,12 +27,9 @@ func (s *State) Completion(id int, uri string, pos lsp.Position) (lsp.Completion
items := make([]lsp.CompletionItem, 0, len(directives))

for _, dir := range directives {
if !strings.HasPrefix(dir.Insert, directiveName) {
continue
}

items = append(items, lsp.CompletionItem{
Label: dir.Label,
FilterText: dir.Insert,
InsertText: dir.Insert,
Documentation: dir.Documentation,
LabelDetails: &lsp.CompletionItemLabelDetails{
Expand Down
5 changes: 5 additions & 0 deletions lsp/textdocument_completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ type CompletionItem struct {
// be an unqualified name of the completion item.
Label string `json:"label"`

// A string that should be used when filtering a set of
// completion items. When omitted the label is used as the
// filter text for this item.
FilterText string `json:"filterText,omitempty"`

// LabelDetails is additional details for the label.
LabelDetails *CompletionItemLabelDetails `json:"labelDetails,omitempty"`

Expand Down