Skip to content

Conversation

@RicardoASJunior
Copy link
Collaborator

Locate Triggers (CCS)

This implementation uses the POST namespaces/{ns}/locateTriggers endpoint 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

  1. Request Source
  • The command reads the routine name from the open file.

  • If the selected line or line under the cursor contains TriggerRule^%CSW1GATCUST or TriggerInterface^%CSW1GATCUST, the text is sent in the payload as selectedText with 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.

  1. API Call
  • The request is sent to namespaces/<namespace>/localizarGatilhos with routineName and, optionally, selectedText.

  • The timeout respects the Consistem › Request Timeout setting.

  1. Output in Output
  • 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

  • File searches prioritize workspace paths containing 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

  1. Connect to a server and open an ObjectScript routine.

  2. Optional: select the line containing TriggerRule^%CSW1GATCUST or TriggerInterface^%CSW1GATCUST to send the selectedText in the call.

  3. Execute the command Consist: Locate Triggers (palette vscode-objectscript.ccs.locateTriggers).

  4. 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.

@RicardoASJunior RicardoASJunior merged commit d6044fc into master Nov 22, 2025
3 checks passed
@RicardoASJunior RicardoASJunior deleted the feat/localizar-gatilho branch November 28, 2025 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants