Feat locate triggers #71
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Locate Triggers (CCS)
This implementation uses the
POST namespaces/{ns}/locateTriggersendpoint of the Source Control API to retrieve triggers from the current routine and annotate the result directly in the ObjectScript channel of VS Code.Flow Overview
The command reads the routine name from the open file.
If the selected line or line under the cursor contains
TriggerRule^%CSW1GATCUSTorTriggerInterface^%CSW1GATCUST, the text is sent in the payload asselectedTextwith double quotes to match the format expected by the API.The namespace comes first from the document; if it does not exist, the active namespace of the connection is used.
The request is sent to
namespaces/<namespace>/localizarGatilhoswithroutineNameand, optionally,selectedText.The timeout respects the
Consistem › Request Timeoutsetting.The response is displayed as plain text in the ObjectScript channel, preserving exactly the layout returned by the API.
Each line referencing a routine is analyzed; if the routine exists in the workspace, the complete path is appended to the end of the line to allow Ctrl+Click navigation.
When the routine is not in the workspace, nothing is changed in the line. Navigation is limited to the returned textual content (no extra links are inserted).
File Resolution
C:/workspacecsw/projetos/COMP-7.0/xcustom/, followed by other local files. Only then are remote fallbacks (such as ISFS) used during manual opening.The links included in the Output appear only when the file exists in the workspace; no command description is added.
How to use
Connect to a server and open an ObjectScript routine.
Optional: select the line containing
TriggerRule^%CSW1GATCUSTorTriggerInterface^%CSW1GATCUSTto send theselectedTextin the call.Execute the command Consist: Locate Triggers (palette
vscode-objectscript.ccs.locateTriggers).Check the ObjectScript channel. If a corresponding file exists in the workspace, the routine line will include a path
file:///...; use Ctrl+Click to open the file in that location. Otherwise, the text remains unlinked and can only be consulted as a reference.