@@ -21,7 +21,6 @@ import (
21
21
"os/exec"
22
22
"path/filepath"
23
23
"runtime"
24
- "strings"
25
24
26
25
bldr "github.com/arduino/arduino-cli/arduino/builder"
27
26
"github.com/arduino/arduino-cli/legacy/builder/constants"
@@ -36,7 +35,7 @@ var ArduinoPreprocessorProperties = properties.NewFromHashmap(map[string]string{
36
35
// Ctags
37
36
"tools.arduino-preprocessor.path" : "{runtime.tools.arduino-preprocessor.path}" ,
38
37
"tools.arduino-preprocessor.cmd.path" : "{path}/arduino-preprocessor" ,
39
- "tools.arduino-preprocessor.pattern" : `"{cmd.path}" "{source_file}" "{codecomplete}" -- -std=gnu++11` ,
38
+ "tools.arduino-preprocessor.pattern" : `"{cmd.path}" "{source_file}" -- -std=gnu++11` ,
40
39
41
40
"preproc.macros.flags" : "-w -x c++ -E -CC" ,
42
41
})
@@ -63,14 +62,7 @@ func (s *PreprocessSketchArduino) Run(ctx *types.Context) error {
63
62
}
64
63
}
65
64
66
- var err error
67
- if ctx .CodeCompleteAt != "" {
68
- err = new (OutputCodeCompletions ).Run (ctx )
69
- } else {
70
- err = bldr .SketchSaveItemCpp (ctx .Sketch .MainFile , []byte (ctx .Source ), ctx .SketchBuildPath )
71
- }
72
-
73
- return err
65
+ return bldr .SketchSaveItemCpp (ctx .Sketch .MainFile , []byte (ctx .Source ), ctx .SketchBuildPath )
74
66
}
75
67
76
68
type ArduinoPreprocessorRunner struct {}
@@ -83,21 +75,6 @@ func (s *ArduinoPreprocessorRunner) Run(ctx *types.Context) error {
83
75
toolProps := buildProperties .SubTree ("tools" ).SubTree ("arduino-preprocessor" )
84
76
preprocProperties .Merge (toolProps )
85
77
preprocProperties .SetPath (constants .BUILD_PROPERTIES_SOURCE_FILE , targetFilePath )
86
- if ctx .CodeCompleteAt != "" {
87
- if runtime .GOOS == "windows" {
88
- //use relative filepath to avoid ":" escaping
89
- splt := strings .Split (ctx .CodeCompleteAt , ":" )
90
- if len (splt ) == 3 {
91
- //all right, do nothing
92
- } else {
93
- splt [1 ] = filepath .Base (splt [0 ] + ":" + splt [1 ])
94
- ctx .CodeCompleteAt = strings .Join (splt [1 :], ":" )
95
- }
96
- }
97
- preprocProperties .Set ("codecomplete" , "-output-code-completions=" + ctx .CodeCompleteAt )
98
- } else {
99
- preprocProperties .Set ("codecomplete" , "" )
100
- }
101
78
102
79
pattern := preprocProperties .Get (constants .BUILD_PROPERTIES_PATTERN )
103
80
if pattern == constants .EMPTY_STRING {
@@ -131,21 +108,6 @@ func (s *ArduinoPreprocessorRunner) Run(ctx *types.Context) error {
131
108
result := utils .NormalizeUTF8 (buf )
132
109
133
110
//fmt.Printf("PREPROCESSOR OUTPUT:\n%s\n", output)
134
- if ctx .CodeCompleteAt != "" {
135
- ctx .CodeCompletions = string (result )
136
- } else {
137
- ctx .Source = string (result )
138
- }
139
- return nil
140
- }
141
-
142
- type OutputCodeCompletions struct {}
143
-
144
- func (s * OutputCodeCompletions ) Run (ctx * types.Context ) error {
145
- if ctx .CodeCompletions == "" {
146
- // we assume it is a json, let's make it compliant at least
147
- ctx .CodeCompletions = "[]"
148
- }
149
- ctx .WriteStdout ([]byte (ctx .CodeCompletions ))
111
+ ctx .Source = string (result )
150
112
return nil
151
113
}
0 commit comments