I learned from Gary Burton, echoed by Allan Holdsworth, of thinking of it in terms of intervals, not only for the notes for a given scale, but also in terms of transitional movement from one scale or chord to another, making use of common points when possible.
Allan Holdsworth also seems to approach soloing as really just examples of finding melodic lines as subsets of the chords, tempered by the sonic coloration of both the chord and other aspects of the given moment.
Gary Burton also expressed those tendencies, with his preference to play melodic, but wide-interval solo notes when soloing.
Both players frequently use diminished chord arpeggios to move between chords, to add some ethereal quality to the melodic lines they create.
There is also the effects of rhythmic 'pronunciation' - cadence, where variations of sub-divided groups of notes are interspersed in the melodic line, to add emotion, and to create and release tension.
There is a beautiful melodic line that has lots of diminished arpeggios moving through chord progressions, in a song by Bill Bruford called Sample and Hold. Here is a link to a live version:
https://www.youtube.com/watch?v=BXgHPk8j0iQ There is a drum into maybe 19-15 seconds, it's also a live version, but you can clearly hear the different chord forms of the melody lines moving through the diminished chords on the ascension.
Bob Bone