Skip to content

Commit

Permalink
creation partially working
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellourbani committed Nov 25, 2018
1 parent cf2806b commit aa4ad75
Show file tree
Hide file tree
Showing 12 changed files with 449 additions and 87 deletions.
54 changes: 24 additions & 30 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,28 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "npm: watch"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "npm: watch"
}
]
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/out/**/*.js"],
"preLaunchTask": "npm: watch"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test"
],
"outFiles": ["${workspaceFolder}/out/test/**/*.js"],
"preLaunchTask": "npm: watch"
}
]
}
44 changes: 31 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
"command": "abapfs.search",
"title": "Search for ABAP object"
},
{
"command": "abapfs.create",
"title": "Create ABAP object"
},
{
"command": "abapfs.activate",
"title": "Activate the current ABAP object",
Expand All @@ -82,6 +86,11 @@
}
],
"explorer/context": [
{
"command": "abapfs.create",
"when": "resourceScheme == adt",
"group": "2_workspace@1"
},
{
"command": "abapfs.search",
"when": "resourceScheme == adt",
Expand Down
4 changes: 2 additions & 2 deletions src/adt/AdtObjectFinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ export class AdtObjectFinder {
return results
}

async findObjectPath(o: SearchResult) {
async findObjectPath(objPath: string) {
const uri = this.conn.createUri(
"/sap/bc/adt/repository/nodepath",
"uri=" + encodeURIComponent(o.uri)
"uri=" + encodeURIComponent(objPath)
)
const raw = await this.conn
.request(uri, "POST")
Expand Down
11 changes: 9 additions & 2 deletions src/adt/AdtServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { selectTransport } from "./AdtTransports"
import { AdtObjectActivator } from "./AdtObjectActivator"
import { pick } from "../functions"
import { AdtObjectFinder } from "./AdtObjectFinder"
import { AdtObjectCreator } from "./create/AdtObjectCreator"
export const ADTBASEURL = "/sap/bc/adt/repository/nodestructure"

// visual studio paths are hierarchic, adt ones aren't
Expand All @@ -30,6 +31,7 @@ export class AdtServer {
private readonly activator: AdtObjectActivator
readonly root: MetaFolder
readonly objectFinder: AdtObjectFinder
creator: AdtObjectCreator

constructor(connectionId: string) {
const config = getRemoteList().filter(
Expand All @@ -39,14 +41,16 @@ export class AdtServer {
if (!config) throw new Error(`connection ${connectionId}`)

this.connection = AdtConnection.fromRemote(config)
//utility components
this.creator = new AdtObjectCreator(this)
this.activator = new AdtObjectActivator(this.connection)

this.objectFinder = new AdtObjectFinder(this.connection)
this.connection
.connect()
.then(pick("body"))
.then(this.objectFinder.setTypes.bind(this))

//root folder
this.root = new MetaFolder()
this.root.setChild(
`$TMP`,
Expand All @@ -65,7 +69,10 @@ export class AdtServer {

await file.abapObject.lock(this.connection)
if (file.abapObject.transport === TransportStatus.REQUIRED) {
const transport = await selectTransport(file.abapObject, this.connection)
const transport = await selectTransport(
file.abapObject.getContentsUri(this.connection),
this.connection
)
if (transport) file.abapObject.transport = transport
}

Expand Down
Loading

0 comments on commit aa4ad75

Please sign in to comment.