-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:borkdominik/bigER
- Loading branch information
Showing
20 changed files
with
231 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# matrix build of server (Java) and client (Node) | ||
name: Build | ||
|
||
# run workflow on pushes/pull requests to main or manually | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
# builds the server using Gradle on ubuntu, macos, windows with java 11, 17 | ||
build-server: | ||
strategy: | ||
matrix: | ||
java: [11, 17] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
name: ${{ matrix.os }} with Java ${{ matrix.Java }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: ${{ matrix.Java }} | ||
distribution: 'temurin' | ||
- run: language-server/gradlew -p language-server/ clean | ||
- run: language-server/gradlew -p language-server/ build | ||
# builds the client using yarn on ubuntu, macos, windows with Node.js 16 | ||
build-client: | ||
strategy: | ||
matrix: | ||
node: ['16'] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
name: ${{ matrix.os }} with Node ${{ matrix.node }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: yarn --cwd webview | ||
- run: yarn --cwd extension |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { commands, Selection, window, workspace } from 'vscode'; | ||
export const command = 'erdiagram.model.newSample'; | ||
|
||
export default async function newSampleModel() { | ||
const fileUri = await window.showSaveDialog({ | ||
saveLabel: 'Save as', | ||
filters: { | ||
"ER Diagram file": ["erd"] | ||
} | ||
}); | ||
if (fileUri) { | ||
const sampleModel = [ | ||
"erdiagram Model\n", | ||
"notation=default", | ||
"generate=off\n", | ||
"entity A {", | ||
" id key", | ||
"}\n", | ||
"entity B {", | ||
" id key", | ||
"}\n", | ||
"relationship Rel {", | ||
" A -> B", | ||
"}" | ||
].join("\n"); | ||
const writeData = Buffer.from(sampleModel, 'utf8'); | ||
await workspace.fs.writeFile(fileUri, writeData); | ||
const document = await workspace.openTextDocument(fileUri); | ||
const editor = await window.showTextDocument(fileUri); | ||
editor.selection = new Selection(document.positionAt(10), document.positionAt(16)); | ||
commands.executeCommand('erdiagram.diagram.open'); | ||
} | ||
} |
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
35 changes: 35 additions & 0 deletions
35
...age-server/org.big.erd.ide/src/main/java/org/big/erd/ide/EntityRelationshipIdeModule.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,35 @@ | ||
/* | ||
* generated by Xtext 2.27.0 | ||
*/ | ||
package org.big.erd.ide; | ||
|
||
import org.big.erd.ide.codeActions.ERDCodeActionService; | ||
import org.big.erd.ide.hover.ERDHoverService; | ||
import org.big.erd.ide.symbol.ErDocumentSymbolKindProvider; | ||
import org.big.erd.ide.symbol.ErDocumentSymbolNameProvider; | ||
import org.eclipse.xtext.ide.server.codeActions.ICodeActionService2; | ||
import org.eclipse.xtext.ide.server.hover.HoverService; | ||
import org.eclipse.xtext.ide.server.symbol.DocumentSymbolMapper.DocumentSymbolKindProvider; | ||
import org.eclipse.xtext.ide.server.symbol.DocumentSymbolMapper.DocumentSymbolNameProvider; | ||
|
||
/** | ||
* Use this class to register ide components. | ||
*/ | ||
public class EntityRelationshipIdeModule extends AbstractEntityRelationshipIdeModule { | ||
|
||
public Class<? extends ICodeActionService2> bindICodeActionService2() { | ||
return ERDCodeActionService.class; | ||
} | ||
|
||
public Class<? extends HoverService> bindHoverService() { | ||
return ERDHoverService.class; | ||
} | ||
|
||
public Class<? extends DocumentSymbolNameProvider> bindDocumentSymbolNameProvider() { | ||
return ErDocumentSymbolNameProvider.class; | ||
} | ||
|
||
public Class<? extends DocumentSymbolKindProvider> bindDocumentSymbolKindProvider() { | ||
return ErDocumentSymbolKindProvider.class; | ||
} | ||
} |
36 changes: 0 additions & 36 deletions
36
...ge-server/org.big.erd.ide/src/main/java/org/big/erd/ide/EntityRelationshipIdeModule.xtend
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
...uage-server/org.big.erd.ide/src/main/java/org/big/erd/ide/EntityRelationshipIdeSetup.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,27 @@ | ||
/* | ||
* generated by Xtext 2.27.0 | ||
*/ | ||
package org.big.erd.ide; | ||
|
||
import com.google.inject.Guice; | ||
import com.google.inject.Injector; | ||
import org.big.erd.EntityRelationshipRuntimeModule; | ||
import org.big.erd.EntityRelationshipStandaloneSetup; | ||
import org.big.erd.ide.diagram.DiagramModule; | ||
import org.eclipse.xtext.util.Modules2; | ||
|
||
/** | ||
* Initialization support for running Xtext languages as language servers. | ||
*/ | ||
public class EntityRelationshipIdeSetup extends EntityRelationshipStandaloneSetup { | ||
|
||
@Override | ||
public Injector createInjector() { | ||
return Guice.createInjector( | ||
Modules2.mixin( | ||
new EntityRelationshipRuntimeModule(), | ||
new EntityRelationshipIdeModule(), | ||
new DiagramModule() | ||
)); | ||
} | ||
} |
28 changes: 0 additions & 28 deletions
28
...age-server/org.big.erd.ide/src/main/java/org/big/erd/ide/EntityRelationshipIdeSetup.xtend
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.