Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

Support other dependency mechanisms through the plugin API #279

Open
chrismarx opened this issue May 10, 2013 · 4 comments
Open

Support other dependency mechanisms through the plugin API #279

chrismarx opened this issue May 10, 2013 · 4 comments

Comments

@chrismarx
Copy link

I'm using closure's dependency mechanism, seems like this should be an easy enough candidate for a plugin, so that instead of looking for "requires" it would look for "goog.require", etc.

@kdvolder
Copy link
Contributor

How similar is goog.require to standard AMD require? If it is as simple as just looking for a different name then it would be realtively easy generalize current implementation to recognize goog.require.

But if the algorithms for configuring and resolving differ then it may be more difficult.

Also the dependency resolution is not really plugable at the moment. It is pretty much hard coded to support amd/requirejs and commonjs/node.

Making it plugable would be desirable of course, but probably take quite a bit more engineering/coding work.

@chrismarx
Copy link
Author

hmm... well, actually its a bit different, instead of assuming any kind of file structure, closure reads through all the js files in a directory and looks for goog.provide statements (the modules), and assembles a goog/deps.js which has the module name to file location mapping. hmm... well sounds like this won't be possible in the near future. Is there any way to just specify a directory whose contents would just get added to the auto complete, regardless of what file you're working on?

@cm325
Copy link

cm325 commented May 24, 2013

On the configuration page (https://github.com/scripted-editor/scripted/wiki/Configuration)
I see an option for "search" -

search: {
exclude: [
'/require.js',
'
/*.min.js'
],.....

But it's all about excluding or deemphasizing, could this be a location that is used to configure files that should get processed for content-assist?

@kdvolder
Copy link
Contributor

Sorry for not ansering earlier. It's just not an easy question :-)

Unfortunately I don't think its as simple as just computing a list of files
to be processed.
The harder question is how to process them and how to use the information
derived from them.
I think that really depends on the mechanics of your particular module
system.

Scripted does have some support for 'global' dependencies. I.e. when people
just load
up files via script tags rather than via require / exports mechanism.

I.e. in one fille you write:

function myGlobalFunction() {... }

Then in another file you write

var result = myGlobalFunction()

If all you wanted is this kind of support, then it may be possible to hack
something up that just
reads / processes all the other files for global definitions.

Is that what you wanted? Or does the google module system actually have
some specific
mechanim/syntax for importing / exporting things rather than just use
global defines and global
variables?

Kris

On Fri, May 24, 2013 at 12:08 PM, chris marx [email protected]:

On the configuration page (
https://github.com/scripted-editor/scripted/wiki/Configuration)
I see an option for "search" -

search: {
exclude: [
'/require.js',
'
/*.min.js'
],.....

But it's all about excluding or deemphasizing, could this be a location
that is used to configure files that should get processed for
content-assist?


Reply to this email directly or view it on GitHubhttps://github.com//issues/279#issuecomment-18423975
.

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

No branches or pull requests

3 participants