@@ -183,11 +183,11 @@ func getTelemetryProperties(out *settings.DecodedOptions) map[string]interface{}
183
183
"lsVersion" : "" ,
184
184
}
185
185
186
- properties ["options.rootModulePaths" ] = len (out .Options .ModulePaths ) > 0
187
- properties ["options.rootModulePaths" ] = len (out .Options .ModulePaths ) > 0
188
- properties ["options.excludeModulePaths" ] = len (out .Options .ExcludeModulePaths ) > 0
186
+ properties ["options.rootModulePaths" ] = len (out .Options .XLegacyModulePaths ) > 0
187
+ properties ["options.excludeModulePaths" ] = len (out .Options .XLegacyExcludeModulePaths ) > 0
189
188
properties ["options.commandPrefix" ] = len (out .Options .CommandPrefix ) > 0
190
- properties ["options.ignoreDirectoryNames" ] = len (out .Options .IgnoreDirectoryNames ) > 0
189
+ properties ["options.indexing.ignoreDirectoryNames" ] = len (out .Options .IgnoreDirectoryNames ) > 0
190
+ properties ["options.indexing.ignorePaths" ] = len (out .Options .IgnorePaths ) > 0
191
191
properties ["options.experimentalFeatures.prefillRequiredFields" ] = out .Options .ExperimentalFeatures .PrefillRequiredFields
192
192
properties ["options.experimentalFeatures.validateOnSave" ] = out .Options .ExperimentalFeatures .ValidateOnSave
193
193
properties ["options.ignoreSingleFileWarning" ] = out .Options .IgnoreSingleFileWarning
@@ -248,14 +248,33 @@ func (svc *service) setupWalker(ctx context.Context, params lsp.InitializeParams
248
248
return err
249
249
}
250
250
251
- var excludeModulePaths []string
252
- for _ , rawPath := range options .ExcludeModulePaths {
251
+ if len (options .XLegacyModulePaths ) != 0 {
252
+ jrpc2 .ServerFromContext (ctx ).Notify (ctx , "window/showMessage" , & lsp.ShowMessageParams {
253
+ Type : lsp .Warning ,
254
+ Message : fmt .Sprintf ("rootModulePaths (%q) is deprecated (no-op), add a folder to workspace " +
255
+ "instead if you'd like it to be indexed" , options .XLegacyModulePaths ),
256
+ })
257
+ }
258
+ if len (options .XLegacyExcludeModulePaths ) != 0 {
259
+ jrpc2 .ServerFromContext (ctx ).Notify (ctx , "window/showMessage" , & lsp.ShowMessageParams {
260
+ Type : lsp .Warning ,
261
+ Message : fmt .Sprintf ("excludeModulePaths (%q) is deprecated (no-op), use indexing.ignorePaths instead" ,
262
+ options .XLegacyExcludeModulePaths ),
263
+ })
264
+ }
265
+
266
+ var ignoredPaths []string
267
+ for _ , rawPath := range options .IgnorePaths {
253
268
modPath , err := resolvePath (root .Path (), rawPath )
254
269
if err != nil {
255
- svc .logger .Printf ("Ignoring excluded module path %s: %s" , rawPath , err )
270
+ jrpc2 .ServerFromContext (ctx ).Notify (ctx , "window/showMessage" , & lsp.ShowMessageParams {
271
+ Type : lsp .Warning ,
272
+ Message : fmt .Sprintf ("Unable to ignore path (unsupported or invalid URI): %s: %s" ,
273
+ rawPath , err ),
274
+ })
256
275
continue
257
276
}
258
- excludeModulePaths = append (excludeModulePaths , modPath )
277
+ ignoredPaths = append (ignoredPaths , modPath )
259
278
}
260
279
261
280
err = svc .stateStore .WalkerPaths .EnqueueDir (root )
@@ -268,7 +287,7 @@ func (svc *service) setupWalker(ctx context.Context, params lsp.InitializeParams
268
287
if ! uri .IsURIValid (folder .URI ) {
269
288
jrpc2 .ServerFromContext (ctx ).Notify (ctx , "window/showMessage" , & lsp.ShowMessageParams {
270
289
Type : lsp .Warning ,
271
- Message : fmt .Sprintf ("Ignoring workspace folder (unsupport or invalid URI) %s." +
290
+ Message : fmt .Sprintf ("Ignoring workspace folder (unsupported or invalid URI) %s." +
272
291
" This is most likely bug, please report it." , folder .URI ),
273
292
})
274
293
continue
@@ -288,10 +307,10 @@ func (svc *service) setupWalker(ctx context.Context, params lsp.InitializeParams
288
307
}
289
308
}
290
309
291
- svc .closedDirWalker .SetIgnoreDirectoryNames (options .IgnoreDirectoryNames )
292
- svc .closedDirWalker .SetExcludeModulePaths ( excludeModulePaths )
293
- svc .openDirWalker .SetIgnoreDirectoryNames (options .IgnoreDirectoryNames )
294
- svc .openDirWalker .SetExcludeModulePaths ( excludeModulePaths )
310
+ svc .closedDirWalker .SetIgnoredDirectoryNames (options .IgnoreDirectoryNames )
311
+ svc .closedDirWalker .SetIgnoredPaths ( ignoredPaths )
312
+ svc .openDirWalker .SetIgnoredDirectoryNames (options .IgnoreDirectoryNames )
313
+ svc .openDirWalker .SetIgnoredPaths ( ignoredPaths )
295
314
296
315
return nil
297
316
}
0 commit comments