-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/surround with monitor action #223
base: main
Are you sure you want to change the base?
Feature/surround with monitor action #223
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A great change! I really like what we could do this with.. I have some wild ideas for adding more. Love the idea that they're bound to commands. I imagine have shortcuts to surround with a certain block!
client/src/editor.ts
Outdated
return true; | ||
} | ||
else { | ||
for (let i = currentLine; i < document.lineCount; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this check. In modern versions of RPGLE (7.3+), /free
and /end-free
are optional, so if they're not used, then it might always return false
by the looks of it.
client/src/editor.ts
Outdated
if (editor) { | ||
const document = editor.document; | ||
let line = editor.selection.start.line; | ||
if (isFreeRPGLE(document, line)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is interesting, checking if the logic is currently free format. Perhaps instead if the document is not **free
, substring the first 8(?) characters and then surround that? That might be nicer than checking for /free
and /end-free
.
Pretty good feedback @worksofliam , thanks! |
This is a truly late reply, but...
Because |
Changes
Inspired by this discussion: https://github.com/orgs/halcyon-tech/discussions/1345
Added an
RPGLE
submenu and aSurround with monitor
action for rpgle editors.Surrounding will be allowed only for Free RPGLE code. Fixed RPG or mixed RPG will show a warning.
The action will surround the code, based on:
The current cursor position
The current selection
It's not necessary to select the entire code. The action will select the whole line(s).
Checklist