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

VSCode ref jump feature shows error under the project without operations in project or schema is specified in the ref #1768

Closed
moker-spaghetti opened this issue Jun 27, 2024 · 0 comments · Fixed by #1769

Comments

@moker-spaghetti
Copy link
Contributor

VSCode ref jump featre fails with the situations below.

a) When project lacks operations

[Error - 12:43:20 PM] Request textDocument/definition failed.
  Message: Request textDocument/definition failed with message: Cannot read properties of undefined (reading 'target')
  Code: -32603 

Without operations, graph.operations would be undefined in gatherAllActions() and accessing action.target.name in retrieveLinkedFileName() fails.

return [].concat(graph.tables, graph.operations, graph.assertions, graph.declarations);

const foundCompileAction = allActions.find(action => action.target.name === ref);

b) When schema / project is specified in ref()

[Error - 1:09:02 PM] Request textDocument/definition failed.
  Message: Request textDocument/definition failed with message: Cannot read properties of undefined (reading 'fileName')
  Code: -32603 

Current code does not work when schema / project is specified in ref().

const refRegex = new RegExp(/(?<=ref\(\"|'\s*).*?(?=\s*\"|'\))/g); // tslint:disable-line

Ekrekr pushed a commit that referenced this issue Jul 8, 2024
* make vscode ctrl+click can handle ref with database and schema

* fix linter

* remove unnecessary comments
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 a pull request may close this issue.

1 participant