VSCode Extenstion how to get Position of last character of line
问题 I am developing a VSCode plugin, and now want to get the position of the last character of a line. Now I want to get it through a known Position object, using "with" method. The official reference is here: https://code.visualstudio.com/api/references/vscode-api#Position You see "with" method has 2 overloads. Now I want to use the "with(change: {line: number, character:number})" method: const endPos = startPos.with({ line: 1, character: -1 }); startPos is a "Position" object. But this code is