Skip to content
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

Detect non-returning functions #58

Open
tmr232 opened this issue Jan 8, 2025 · 1 comment
Open

Detect non-returning functions #58

tmr232 opened this issue Jan 8, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@tmr232
Copy link
Owner

tmr232 commented Jan 8, 2025

This greatly affects the flowgraph, and should be handled.
However, it is something we definitely don't wanna do in our code, as it'll be different per-language.

I think the best way to go about it is to see if we can use the IDE to query this - detect calls and the actual functions that are being called.
Then, if all we need to add is "known non-returning functions", it's not that bad.
But type inference and similar tasks should not be part of this project for now.

@tmr232 tmr232 added the enhancement New feature or request label Jan 8, 2025
@tmr232
Copy link
Owner Author

tmr232 commented Jan 9, 2025

Seems the relevant VSCode API is the built-in command vscode.executeDeclarationProvider:

// Get the active text editor
const editor = vscode.window.activeTextEditor;
if (!editor) {
  vscode.window.showInformationMessage('No editor is active');
  return;
}

// Get the current position of the cursor
const position = editor.selection.active;

// Get the definition at the current position
const definitions = await vscode.commands.executeCommand<vscode.Location[]>(
  'vscode.executeDefinitionProvider',
  editor.document.uri,
  position
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant