-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Determine and send inline completion session result (#323)
- Loading branch information
1 parent
9d818a8
commit faa503e
Showing
9 changed files
with
344 additions
and
28 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
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
43 changes: 43 additions & 0 deletions
43
plugin/src/software/aws/toolkits/eclipse/amazonq/lsp/model/InlineCompletionStates.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,43 @@ | ||
// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package software.aws.toolkits.eclipse.amazonq.lsp.model; | ||
|
||
public final class InlineCompletionStates { | ||
// Indicates if suggestion has been seen by the user in the UI | ||
private boolean seen; | ||
// Indicates if suggestion accepted | ||
private boolean accepted; | ||
// Indicates if suggestion was filtered out on the client-side and marked as | ||
// discarded. | ||
private boolean discarded; | ||
|
||
public boolean isSeen() { | ||
return seen; | ||
} | ||
|
||
public void setSeen(final boolean seen) { | ||
this.seen = seen; | ||
} | ||
|
||
public boolean isAccepted() { | ||
return accepted; | ||
} | ||
|
||
public void setAccepted(final boolean accepted) { | ||
this.accepted = accepted; | ||
} | ||
|
||
public boolean isDiscarded() { | ||
return discarded; | ||
} | ||
|
||
public void setDiscarded(final boolean discarded) { | ||
this.discarded = discarded; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.format("{accepted=%b, seen=%b, discarded=%b}", accepted, seen, discarded); | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
...tware/aws/toolkits/eclipse/amazonq/lsp/model/LogInlineCompletionSessionResultsParams.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,63 @@ | ||
// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package software.aws.toolkits.eclipse.amazonq.lsp.model; | ||
|
||
import java.util.concurrent.ConcurrentHashMap; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
public final class LogInlineCompletionSessionResultsParams { | ||
// Session Id attached to get completion items response | ||
private final String sessionId; | ||
// Map with results of interaction with completion items/suggestions in the UI | ||
private final ConcurrentHashMap<String, InlineCompletionStates> completionSessionResult; | ||
|
||
// Total time when items from this suggestion session were visible in UI | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
private Long totalSessionDisplayTime; | ||
// Time from request invocation start to rendering of the first suggestion in the UI. | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
private Long firstCompletionDisplayLatency; | ||
// Length of additional characters inputed by user from when the trigger happens to when the first suggestion is about to be shown in UI | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
private Integer typeaheadLength; | ||
|
||
public LogInlineCompletionSessionResultsParams(final String sessionId, final ConcurrentHashMap<String, InlineCompletionStates> completionSessionResult) { | ||
this.sessionId = sessionId; | ||
this.completionSessionResult = completionSessionResult; | ||
} | ||
|
||
public Long getTotalSessionDisplayTime() { | ||
return totalSessionDisplayTime; | ||
} | ||
|
||
public void setTotalSessionDisplayTime(final Long totalSessionDisplayTime) { | ||
this.totalSessionDisplayTime = totalSessionDisplayTime; | ||
} | ||
|
||
public Long getFirstCompletionDisplayLatency() { | ||
return firstCompletionDisplayLatency; | ||
} | ||
|
||
public void setFirstCompletionDisplayLatency(final Long firstCompletionDisplayLatency) { | ||
this.firstCompletionDisplayLatency = firstCompletionDisplayLatency; | ||
} | ||
|
||
public Integer getTypeaheadLength() { | ||
return typeaheadLength; | ||
} | ||
|
||
public void setTypeaheadLength(final Integer typeaheadLength) { | ||
this.typeaheadLength = typeaheadLength; | ||
} | ||
|
||
public ConcurrentHashMap<String, InlineCompletionStates> getCompletionSessionResult() { | ||
return completionSessionResult; | ||
} | ||
|
||
public String getSessionId() { | ||
return sessionId; | ||
} | ||
|
||
} |
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.