Skip to content

Commit

Permalink
refactor: clean up todos
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleoutIce committed Aug 30, 2023
1 parent 9d813cd commit 016ed8f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
6 changes: 1 addition & 5 deletions src/cli/repl/server/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export class FlowRServerConnection {
this.socket.on('data', data => this.handleData(String(data)))
}

// TODO: do we have to deal with partial messages?
private currentMessageBuffer = ''
private handleData(message: string) {
if(!message.endsWith('\n')) {
Expand Down Expand Up @@ -66,7 +65,6 @@ export class FlowRServerConnection {
}
}

// TODO: integrate this with lsp?
private handleFileAnalysisRequest(base: FileAnalysisRequestMessage) {
const requestResult = validateMessage(base, requestAnalysisMessage)
if(requestResult.type === 'error') {
Expand All @@ -85,7 +83,6 @@ export class FlowRServerConnection {
tokenMap: this.tokenMap,
request: requestFromInput(message.content ?? `file://${message.filepath as string}`),
criterion: [] // currently unknown
// TODO: allow to configure the rest?
})
this.fileMap.set(message.filetoken, {
filename: message.filename,
Expand Down Expand Up @@ -123,13 +120,12 @@ export class FlowRServerConnection {
})
return
}
// TODO: cache slices?

fileInformation.slicer.updateCriterion(request.criterion)
void fileInformation.slicer.allRemainingSteps(true).then(results => {
sendMessage(this.socket, {
type: 'response-slice',
id: request.id,
// TODO: is there a better way?
results: Object.fromEntries(Object.entries(results).filter(([k,]) => Object.hasOwn(STEPS_PER_SLICE, k)))
})
})
Expand Down
3 changes: 0 additions & 3 deletions src/cli/repl/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class FlowRServer {
private readonly tokenMap: TokenMap
private versionInformation: VersionInformation | undefined

// TODO: manually shut down everything?
/** maps names to the respective connection */
private connections = new Map<string, FlowRServerConnection>()
private nameCounter = 0
Expand All @@ -46,7 +45,6 @@ export class FlowRServer {
public async start(port: number) {
this.versionInformation = await retrieveVersionInformation(this.shell)
this.server.listen(port)
// TODO: update stuff like this to a normal logger?
console.log(`Server listening on port ${port}`)
}

Expand All @@ -55,7 +53,6 @@ export class FlowRServer {
notYetInitialized(c, undefined)
return
}
// TODO: produce better unique names? :D
const name = `client-${this.nameCounter++}`
console.log(`Client connected: ${getUnnamedSocketName(c)} as "${name}"`)

Expand Down
1 change: 0 additions & 1 deletion src/cli/repl/server/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export function answerForValidationError(client: net.Socket, result: ValidationE
type: 'error',
fatal: false,
id: id,
// TODO: add more information?
reason: `Invalid message format: ${result.reason.message}`
})
}

0 comments on commit 016ed8f

Please sign in to comment.