getappmap / getappmap/appmap-js

Navie doesn't know the location of code selection items

Open
#2,200 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug navie-plan
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.