If the jockey pulleys detent on each cassette gear through the range but you are missing a click at one end or the other, then it's probably the shifter. You might be able to disassemble the shifter to see what's catching to prevent full range. For the detents, they typically use a bearing ball running across a toothed track, and held in place by a leaf spring. Not always easy to re-assemble. It's probably better to just replace it