adds semantic comparator to sort ns declaration

- sorts items closer to the current ns first