Skip to content

Trigger on Packages with Known Information#2472

Merged
EagleoutIce merged 26 commits into
mainfrom
2072-trigger-known-packages
Jul 5, 2026
Merged

Trigger on Packages with Known Information#2472
EagleoutIce merged 26 commits into
mainfrom
2072-trigger-known-packages

Conversation

@EagleoutIce

@EagleoutIce EagleoutIce commented May 6, 2026

Copy link
Copy Markdown
Member

Still open:

  • Correctly identify the name of the package that is loaded, not just the lexeme (e.g., with: x <- "foo"; library(x, character.only = TRUE) should recognize that we load foo and not x, likewise with the lapply etc. pattern)
  • Not every exported symbol is a function call => we need information for each symbol, whether it is (not-)callable!
  • We need to follow "re-exports" with import etc. (import(grid)); but we have to check whether already loaded
  • We need to support exportPattern...

In the future, we want to include the information and we have to respect versions.

@EagleoutIce EagleoutIce linked an issue May 6, 2026 that may be closed by this pull request
@lou7202 lou7202 marked this pull request as ready for review June 12, 2026 19:05
Comment thread src/dataflow/environments/environment.ts Outdated
const currentEnv = info.environment.current;
const pack = dependency.name;
const functions = dependency.namespaceInfo.callable;
/*

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove comment blocks / clean up

Comment thread test/functionality/dataflow/main/libraries/link-lib-character-only.test.ts Outdated
Comment thread test/functionality/dataflow/main/libraries/link-lib-character-only.test.ts Outdated
Comment thread test/functionality/dataflow/main/libraries/link-lib-character-only.test.ts Outdated
Comment thread test/functionality/dataflow/main/libraries/link-lib-character-only.test.ts Outdated
Comment thread test/functionality/dataflow/main/libraries/link-lib-character-only.test.ts Outdated
Comment thread test/functionality/dataflow/main/libraries/link-lib-imports.test.ts Outdated
Comment thread src/dataflow/internal/process/functions/call/built-in/built-in-library.ts Outdated
const values = valueSetGuard(resolveIdToValue(nameToLoad.info.id, resolveArgs));
if(values?.type === 'set' && values.elements.length !== 0){
if(values.elements[0].type === 'string' && 'str' in values.elements[0].value){
packetName = values.elements[0].value.str;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there are multiple options we shouldn't just lock in on the first and throw away the rest.

  1. we could log this (log.warn(...))
  2. we could load all these libraries similar to if we would have:
    if(u) {
      library(a)
    } else {
      library(b)
    }
    # ------
    if(u) {
      x <- "a"
    } else {
      x <- "b"
    }
    library(x, character.only=TRUE)

=> please with tests.

Naomi Panda added 5 commits June 19, 2026 19:57
slicecrit in tests, function to create importFunc identifier, use constant for namespace file input
Node for builtinnow also contains name of the dependency. If two packages A,B both export x, there will be two different builtin nodes
when multiple options for the dependency  are possible (see added tests) all the options are loaded

@EagleoutIce EagleoutIce left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supii, dann eigentlich nur noch die konflikte lösen und wr können das mergen :)

Comment thread src/dataflow/internal/process/functions/call/built-in/built-in-library.ts Outdated
Comment thread src/dataflow/environments/environment.ts
Comment thread test/functionality/dataflow/main/libraries/link-libraries.test.ts Outdated
Comment thread test/functionality/dataflow/main/libraries/link-libraries.test.ts Outdated
@EagleoutIce EagleoutIce merged commit d55c9b7 into main Jul 5, 2026
19 checks passed
@EagleoutIce EagleoutIce deleted the 2072-trigger-known-packages branch July 5, 2026 12:07
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.

Trigger known packages!

1 participant