-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add auto-completion for batch imports
- Loading branch information
1 parent
fca39a1
commit 60625f8
Showing
6 changed files
with
93 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
snap-studio-index/src/main/java/org/snapscript/studio/index/tree/ImportListIndex.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.snapscript.studio.index.tree; | ||
|
||
import org.snapscript.core.Compilation; | ||
import org.snapscript.core.NoStatement; | ||
import org.snapscript.core.Statement; | ||
import org.snapscript.core.module.Module; | ||
import org.snapscript.core.module.Path; | ||
import org.snapscript.core.scope.Scope; | ||
import org.snapscript.core.variable.Value; | ||
import org.snapscript.studio.index.IndexResult; | ||
import org.snapscript.tree.Qualifier; | ||
|
||
import static org.snapscript.studio.index.IndexType.IMPORT; | ||
|
||
public class ImportListIndex implements Compilation { | ||
|
||
private final Qualifier qualifier; | ||
private final Qualifier[] names; | ||
private final IndexResult[] results; | ||
private final Statement statement; | ||
|
||
public ImportListIndex(Qualifier qualifier, Qualifier... names) { | ||
this.statement = new NoStatement(); | ||
this.results = new IndexResult[names.length]; | ||
this.qualifier = qualifier; | ||
this.names = names; | ||
} | ||
|
||
@Override | ||
public Object compile(Module module, Path path, int line) throws Exception { | ||
String prefix = qualifier.getQualifier(); | ||
|
||
for(int i = 0; i < names.length; i++) { | ||
String name = names[i].getQualifier(); | ||
results[i] = new IndexResult(IMPORT, statement, null, prefix + "." + name, name, path, line); | ||
} | ||
return results; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
snap-studio-service/src/main/java/org/snapscript/studio/service/StudioClientResource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.snapscript.studio.service; | ||
|
||
import lombok.AllArgsConstructor; | ||
import org.simpleframework.http.Request; | ||
import org.simpleframework.http.Response; | ||
import org.simpleframework.http.Status; | ||
import org.snapscript.studio.common.resource.Resource; | ||
import org.snapscript.studio.common.resource.ResourcePath; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@AllArgsConstructor | ||
@ResourcePath("/debugger") | ||
public class StudioClientResource implements Resource { | ||
|
||
private final StudioClientLauncher launcher; | ||
|
||
@Override | ||
public void handle(Request request, Response response) throws Throwable { | ||
response.setStatus(Status.OK); | ||
launcher.debug(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ func start(scale) { | |
} | ||
} | ||
|
||
start(2); | ||
start(4); |