"Add namsepace to interface section uses clause" doesn't work

Oxygene for .NET 7.0.71.1477 in MS VS 2013 Shell 12.0.30110.0

Automatically adding namespaces to interface section uses list doesn’t work any longer (in previous releases it does).

If i choose “Add namespaces to most appropriate section’s uses clause”, it works, but only if the namespace can be added to the uses list in the implementation part of the unit.

If i use a type declared in an different namespace and try to compile, i get (obviously) an “Unkown type error” - If i hit the button for “Potential Fixes”: "Add namespace “System…” according to CC options - nothing happens!

To clarify — adding the namespace to the interface only fails form Fix-It? or also from Code Completion?

Thanks, logged as bugs://67539: “Add namsepace to interface section uses clause” doesn’t work

i cannot reproduce this.

File|New WPF app. Add code as below. Build, i get a Error with FixIt, and applying it inserts System.IO properly in the uses clause:

namespace WPFApplication16;

interface

uses
  System.Collections.Generic,
  System.Linq,
  System.Windows,
  System.Windows.Controls,
  System.Windows.Data,
  System.Windows.Documents,
  System.Windows.Media,
  System.Windows.Navigation,
  System.Windows.Shapes;

type
  Window1 = public partial class(System.Windows.Window)
  private
  public
    constructor;
  end;

implementation

constructor Window1;
begin
  InitializeComponent();
  Directory.Exists('');  // thhis line will err
end;

end.

what am i missing?

closing the issue for now.

Maybe your settings are different?

My settings:

This way the Fix-It doesn’t work…

If i check “Add namespace to most appropriate section’s uses clause”, then the “Fix-It” works… but adds “System.IO” to the uses list of the implementation part.

Yup. Insert Sorted works, Resort entire list does not. thanx!

Hello again,

apparently the current beta of oxygene reintroduced this bug. If the setting is: “Resort entire list” the following result is produced, if a namespace has been added via a Fix-It (Did you mean “System.Drawing.Point”?)
(Yes, there are two “uses-clauses” now…)

uses
  System.Collections.Generic,
  System.Drawing,
  System.Linq,
  System.Text;

uses
  System.Collections.Generic,
  System.Linq,
  System.Text;

If the setting is “Insert sorted”, it seems to work.

Thanks, logged as bugs://73258

bugs://73258 got closed with status fixed.

It (or i) may annoy you…

…but if i now use “Resort entire list” in the current beta, for every namespace inserted there are at least two newlines added after the uses-clause… and that annoys me. :grin:

Thanks, logged as bugs://73591

bugs://73591 got closed with status fixed.