9
9
"strings"
10
10
11
11
"arduino.cc/builder"
12
+ "arduino.cc/builder/i18n"
12
13
"arduino.cc/builder/types"
13
14
"arduino.cc/builder/utils"
14
15
"github.com/fsnotify/fsnotify"
@@ -87,6 +88,7 @@ func (s *builderServer) Autocomplete(ctx context.Context, args *pb.BuildParams)
87
88
s .ctx .WarningsLevel = args .WarningsLevel
88
89
s .ctx .PrototypesSection = ""
89
90
s .ctx .CodeCompleteAt = args .CodeCompleteAt
91
+ s .ctx .CodeCompletions = ""
90
92
91
93
s .ctx .IncludeFolders = s .ctx .IncludeFolders [0 :0 ]
92
94
s .ctx .LibrariesObjectFiles = s .ctx .LibrariesObjectFiles [0 :0 ]
@@ -96,14 +98,16 @@ func (s *builderServer) Autocomplete(ctx context.Context, args *pb.BuildParams)
96
98
s .ctx .ImportedLibraries = s .ctx .ImportedLibraries [0 :0 ]
97
99
98
100
s .watch ()
101
+ oldlogger := s .ctx .GetLogger ()
102
+ logger := i18n.NoopLogger {}
103
+ s .ctx .SetLogger (logger )
99
104
100
105
err := builder .RunPreprocess (s .ctx )
101
- if err != nil {
102
- return & pb.Response {Line : s .ctx .GetLogger ().Flush ()}, err
103
- }
104
106
105
- // No feature was found, return an unnamed feature
106
- return & pb.Response {Line : s .ctx .GetLogger ().Flush ()}, nil
107
+ response := pb.Response {Line : s .ctx .CodeCompletions }
108
+ s .ctx .SetLogger (oldlogger )
109
+
110
+ return & response , err
107
111
}
108
112
109
113
// GetFeature returns the feature at the given point.
0 commit comments