Skip to content

Cross file definition not connected #409

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

Open
jrmuizel opened this issue May 18, 2025 · 3 comments
Open

Cross file definition not connected #409

jrmuizel opened this issue May 18, 2025 · 3 comments

Comments

@jrmuizel
Copy link

jrmuizel commented May 18, 2025

Given the following files:

Sqlite.sys.mjs

export function OpenedConnection() {

}

OpenedConnection.prototype = {
  /**
   * The integer schema version of the database.
   *
   * This is 0 if not schema version has been set.
   *
   * @return String
   */
  getSchemaVersion() {
    return "false"
  },
}

db.sys.mjs

/**
 * @import {OpenedConnection} from "./Sqlite.sys.mjs"
 */


/**
 * @param {OpenedConnection} db
 * @return {String}
 */
export function foo(db) {
    return db.getSchemaVersion();
}

getSchemaVersion() in db.sys.mjs should have a definition in Sqlite.sys.mjs but it ends up with a local defintion

Copy link

linear bot commented May 18, 2025

@jrmuizel
Copy link
Author

        &scip.Occurrence{
          Range: []int32{
            10,
            14,
            30,
          },
          Symbol:                "local 3",
          SymbolRoles:           0,
          OverrideDocumentation: []string(nil),
          SyntaxKind:            0,
          Diagnostics:           []*scip.Diagnostic(nil),
          EnclosingRange:        []int32(nil),
        },

@jrmuizel
Copy link
Author

We end up walking up the node parent's in Sqlite.sys.mjs until there's not any more and then fallback to a local symbol here:

// Fallback case: generate a local symbol. It's not a bug when this case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant