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

Add convenience method to retrieve ScriptInfo/ModuleInfo from script #389

Open
imagejan opened this issue Jun 16, 2020 · 2 comments · May be fixed by #390
Open

Add convenience method to retrieve ScriptInfo/ModuleInfo from script #389

imagejan opened this issue Jun 16, 2020 · 2 comments · May be fixed by #390
Assignees

Comments

@imagejan
Copy link
Member

As suggested by @ctrueden on gitter, we should add a convenience method to ScriptService that returns a ScriptInfo or ModuleInfo for a given script.

Something like getScriptInfo(String filename, String script) ?

@imagejan
Copy link
Member Author

As we have:

/**
* Gets the cached {@link ScriptInfo} metadata for the script at the given
* file, creating it if it does not already exist.
*/
ScriptInfo getScript(File scriptFile);

already, we might want to keep it consistent and overload the getScript method like this:

/**
 * Creates the {@link ScriptInfo} metadata for the provided script.
 */
ScriptInfo getScript(String languageExtension, String script);

Would you be fine with that, @ctrueden? I can submit a PR updating ScriptService and DefaultScriptService then.

@ctrueden
Copy link
Member

Sounds good, @imagejan! 👍

@imagejan imagejan self-assigned this Jun 19, 2020
imagejan added a commit that referenced this issue Jun 19, 2020
This makes it easier to retrieve a ScriptInfo object from a script string (without going via File).

Closes #389.
imagejan added a commit that referenced this issue Sep 3, 2020
This makes it easier to retrieve a ScriptInfo object from a script string (without going via File).

Closes #389.
imagejan added a commit that referenced this issue Dec 18, 2020
This makes it easier to retrieve a ScriptInfo object from a script string (without going via File).

Closes #389.
imagejan added a commit that referenced this issue Jan 19, 2021
This makes it easier to retrieve a ScriptInfo object from a script string (without going via File).

Closes #389.
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.

2 participants