diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000000..28a804d893
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000000..046714b9e2
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/tools.iml b/.idea/tools.iml
new file mode 100644
index 0000000000..c956989b29
--- /dev/null
+++ b/.idea/tools.iml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000000..94a25f7f4c
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000000..b2cb7a836f
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/internal/lsp/source/options.go b/internal/lsp/source/options.go
index 358d2d7bd7..7d76cd6c1f 100644
--- a/internal/lsp/source/options.go
+++ b/internal/lsp/source/options.go
@@ -251,8 +251,13 @@ func (o *Options) set(name string, value interface{}) OptionResult {
case "completeUnimported":
result.setBool(&o.Completion.Unimported)
case "completionBudget":
- if v, ok := result.asInt(); ok {
- o.Completion.Budget = time.Duration(v) * time.Millisecond
+ if v, ok := result.asString(); ok {
+ d, err := time.ParseDuration(v)
+ if err != nil {
+ result.errorf("failed to parse duration %q: %v", v, err)
+ break
+ }
+ o.Completion.Budget = d
}
case "hoverKind":
@@ -351,11 +356,11 @@ func (r *OptionResult) asBool() (bool, bool) {
return b, true
}
-func (r *OptionResult) asInt() (int, bool) {
- b, ok := r.Value.(int)
+func (r *OptionResult) asString() (string, bool) {
+ b, ok := r.Value.(string)
if !ok {
- r.errorf("Invalid type %T for int option %q", r.Value, r.Name)
- return 0, false
+ r.errorf("Invalid type %T for string option %q", r.Value, r.Name)
+ return "", false
}
return b, true
}