mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-18 23:15:26 +02:00
fix: Overall improvements
This commit is contained in:
parent
1a909a6d2d
commit
04fe0d2dc8
@ -114,6 +114,7 @@ func (v KeyEnumAssignmentValue) FetchEnumCompletions() []protocol.CompletionItem
|
||||
kind := protocol.CompletionItemKindField
|
||||
val := v.Values[enumKey]
|
||||
description := val.GetTypeDescription()
|
||||
insertText := enumKey.InsertText + v.Separator
|
||||
|
||||
var documentation string
|
||||
|
||||
@ -125,6 +126,7 @@ func (v KeyEnumAssignmentValue) FetchEnumCompletions() []protocol.CompletionItem
|
||||
|
||||
completions = append(completions, protocol.CompletionItem{
|
||||
Label: enumKey.InsertText,
|
||||
InsertText: &insertText,
|
||||
InsertTextFormat: &textFormat,
|
||||
Kind: &kind,
|
||||
Documentation: documentation,
|
||||
|
@ -211,6 +211,11 @@ func (p *FstabParser) AddLine(line string, lineNumber int) error {
|
||||
case 6:
|
||||
value := fields[5]
|
||||
start := uint32(strings.Index(line, value))
|
||||
|
||||
if start == 0 {
|
||||
start = uint32(len(line))
|
||||
}
|
||||
|
||||
pass = &Field{
|
||||
Value: fields[5],
|
||||
Start: start,
|
||||
@ -221,6 +226,10 @@ func (p *FstabParser) AddLine(line string, lineNumber int) error {
|
||||
value := fields[4]
|
||||
start := uint32(strings.Index(line, value))
|
||||
|
||||
if start == 0 {
|
||||
start = uint32(len(line))
|
||||
}
|
||||
|
||||
freq = &Field{
|
||||
Value: value,
|
||||
Start: start,
|
||||
@ -231,6 +240,10 @@ func (p *FstabParser) AddLine(line string, lineNumber int) error {
|
||||
value := fields[3]
|
||||
start := uint32(strings.Index(line, value))
|
||||
|
||||
if start == 0 {
|
||||
start = uint32(len(line))
|
||||
}
|
||||
|
||||
options = &Field{
|
||||
Value: value,
|
||||
Start: start,
|
||||
@ -241,6 +254,10 @@ func (p *FstabParser) AddLine(line string, lineNumber int) error {
|
||||
value := fields[2]
|
||||
start := uint32(strings.Index(line, value))
|
||||
|
||||
if start == 0 {
|
||||
start = uint32(len(line))
|
||||
}
|
||||
|
||||
filesystemType = &Field{
|
||||
Value: value,
|
||||
Start: start,
|
||||
@ -251,6 +268,10 @@ func (p *FstabParser) AddLine(line string, lineNumber int) error {
|
||||
value := fields[1]
|
||||
start := uint32(strings.Index(line, value))
|
||||
|
||||
if start == 0 {
|
||||
start = uint32(len(line))
|
||||
}
|
||||
|
||||
mountPoint = &Field{
|
||||
Value: value,
|
||||
Start: start,
|
||||
|
@ -3,7 +3,6 @@ package fstab
|
||||
import (
|
||||
docvalues "config-lsp/doc-values"
|
||||
fstabdocumentation "config-lsp/handlers/fstab/documentation"
|
||||
"fmt"
|
||||
|
||||
"github.com/tliron/glsp"
|
||||
protocol "github.com/tliron/glsp/protocol_3_16"
|
||||
|
Loading…
x
Reference in New Issue
Block a user