getappmap / getappmap/appmap-js
Navie doesn't know the location of code selection items
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 53
- Forks
- 18
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 8
Description
As we can see from the following type, a user code selection doesn't appear to include the file path / location.
export type CodeSelectionItem = {
type: 'code-selection';
content: string;
};
This is going to hamper the ability of FileChangeExtractorService to perform listFiles, because the file name of code selection items will not be available.
export function renderItems(items: ContextItem[], includeContent: boolean = true) {
const renderItem = (i: UserContext.ContextItem) => {
if (UserContext.isCodeSelectionItem(i) && includeContent) {
return `<code-selection>\n${i.content}\n</code-selection>`;
} else if (UserContext.isCodeSnippetItem(i)) {
const content = includeContent ? `\n<content>${i.content}</content>\n'` : '';
return `<pinned-snippet>
<location>${i.location}</location>${content}
</pinned-snippet>`;
} else if (UserContext.isFileItem(i)) {
return `<pinned-file><location>${i.location}</location></pinned-file>`;
}
};
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CodeSelectionItem type and renderItems function shown in the issue, then trace how code selections reach FileChangeExtractorService. Determine where the file location is lost and verify that listFiles can use it once preserved; the issue is done when code-selection items carry their location through this flow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100