mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-12 19:01:55 +00:00
243f52b58b
The GetRawLine currently returns the full command line used to create the CompletionRequest. So for example for "foo b[tab] --arg" it would return the whole string instead of "foo b". Usually completion code makes the wrong assumption that the cursor is at the end of the line and handing out the complete line will cause that people implement completions that also make this assumption. This patch makes GetRawLine() return only the string until the cursor and hides the suffix (so that the cursor is always at the end of this string) and adds another function GetRawLineWithUnusedSuffix that is specifically the line with the suffix that isn't used by the CompletionRequest for argument parsing etc. There is only one user of this new function that actually needs the suffix and that is the expression command which needs the suffix to detect if it is in the raw or argument part of the command (by looking at the "--" separator).