tabby icon indicating copy to clipboard operation
tabby copied to clipboard

VSCode code inline completion with wrong indentation size

Open Sma1lboy opened this issue 1 year ago • 3 comments

Describe the bug Sometimes, the code completion hint is not formatted according to the context above or below.

image

Information about your version Please provide output of tabby --version tabby 0.17.0

Sma1lboy avatar Oct 11 '24 07:10 Sma1lboy

Could you provide a detailed log referencing this completion request? It will be very helpful to address the problem.
You can find it at http://localhost:8080/activities (please replace the host and port if you are not using the default local setup). Please unfold the Completion event and copy the full JSON.

icycodes avatar Oct 11 '24 10:10 icycodes

I have performed this test multiple times. I apologize for the messy data here. Thank you for your help.

    "completion": {
      "completion_id": "cmpl-51f901f2-7369-41f5-9554-fee0e27830a7",
      "language": "json",
      "prompt": "<fim_prefix>  ],\n  \"icon\": \"assets/logo.png\",\n  \"engines\": {\n    \"vscode\": \"^1.82.0\"\n  },\n  \"categories\": [\n    \"Programming Languages\",\n    \"Machine Learning\",\n    \"Other\"\n  ],\n  \"activationEvents\": [\n    \"onStartupFinished\"\n  ],\n  \"main\": \"./dist/node/extension.js\",\n  \"browser\": \"./dist/browser/extension.js\",\n  \"contributes\": {\n    \"commands\": [\n      {\n        \"command\": \"tabby.server.test\",\n        <fim_suffix>\n      },\n      {\n        \"command\": \"tabby.toggleInlineCompletionTriggerMode\",\n        \"title\": \"Toggle Code Completion Trigger Mode (Automatic/Manual)\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.inlineCompletion.trigger\",\n        \"title\": \"Trigger Code Completion Manually\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiEndpoint\",\n        \"title\": \"Connect to Server...\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiToken\",\n        \"title\": \"Set Token...\",\n<fim_middle>",
      "segments": {
        "prefix": "  ],\n  \"icon\": \"assets/logo.png\",\n  \"engines\": {\n    \"vscode\": \"^1.82.0\"\n  },\n  \"categories\": [\n    \"Programming Languages\",\n    \"Machine Learning\",\n    \"Other\"\n  ],\n  \"activationEvents\": [\n    \"onStartupFinished\"\n  ],\n  \"main\": \"./dist/node/extension.js\",\n  \"browser\": \"./dist/browser/extension.js\",\n  \"contributes\": {\n    \"commands\": [\n      {\n        \"command\": \"tabby.server.test\",\n        ",
        "suffix": "\n      },\n      {\n        \"command\": \"tabby.toggleInlineCompletionTriggerMode\",\n        \"title\": \"Toggle Code Completion Trigger Mode (Automatic/Manual)\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.inlineCompletion.trigger\",\n        \"title\": \"Trigger Code Completion Manually\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiEndpoint\",\n        \"title\": \"Connect to Server...\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiToken\",\n        \"title\": \"Set Token...\",\n",
        "git_url": "[email protected]:Sma1lboy/tabby.git",
        "filepath": "clients/vscode/package.json"
      },
      "choices": [
        {
          "index": 0,
          "text": "\"title\":  \"Run Test\",\n         \"category\":  \"Tabby\""
        }
      ],
      "user_agent": "Node.js/v20.14.0 tabby-agent/1.8.0-dev Visual-Studio-Code-desktop/1.92.2 TabbyML.vscode-tabby/1.12.1"
    }
    "completion": {
      "completion_id": "cmpl-c6d0dbba-830c-447e-b2f4-419b8423f4fe",
      "language": "json",
      "prompt": "<fim_prefix>  ],\n  \"icon\": \"assets/logo.png\",\n  \"engines\": {\n    \"vscode\": \"^1.82.0\"\n  },\n  \"categories\": [\n    \"Programming Languages\",\n    \"Machine Learning\",\n    \"Other\"\n  ],\n  \"activationEvents\": [\n    \"onStartupFinished\"\n  ],\n  \"main\": \"./dist/node/extension.js\",\n  \"browser\": \"./dist/browser/extension.js\",\n  \"contributes\": {\n    \"commands\": [\n      {\n        \"command\": \"tabby.server.test\",\n        <fim_suffix>\n\n        \n      },\n      {\n        \"command\": \"tabby.toggleInlineCompletionTriggerMode\",\n        \"title\": \"Toggle Code Completion Trigger Mode (Automatic/Manual)\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.inlineCompletion.trigger\",\n        \"title\": \"Trigger Code Completion Manually\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiEndpoint\",\n        \"title\": \"Connect to Server...\",\n        \"category\": \"Tabby\"\n      },\n      {\n<fim_middle>",
      "segments": {
        "prefix": "  ],\n  \"icon\": \"assets/logo.png\",\n  \"engines\": {\n    \"vscode\": \"^1.82.0\"\n  },\n  \"categories\": [\n    \"Programming Languages\",\n    \"Machine Learning\",\n    \"Other\"\n  ],\n  \"activationEvents\": [\n    \"onStartupFinished\"\n  ],\n  \"main\": \"./dist/node/extension.js\",\n  \"browser\": \"./dist/browser/extension.js\",\n  \"contributes\": {\n    \"commands\": [\n      {\n        \"command\": \"tabby.server.test\",\n        ",
        "suffix": "\n\n        \n      },\n      {\n        \"command\": \"tabby.toggleInlineCompletionTriggerMode\",\n        \"title\": \"Toggle Code Completion Trigger Mode (Automatic/Manual)\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.inlineCompletion.trigger\",\n        \"title\": \"Trigger Code Completion Manually\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiEndpoint\",\n        \"title\": \"Connect to Server...\",\n        \"category\": \"Tabby\"\n      },\n      {\n",
        "git_url": "[email protected]:Sma1lboy/tabby.git",
        "filepath": "clients/vscode/package.json"
      },
      "choices": [
        {
          "index": 0,
          "text": "\"title\":  \"Run Test\",\n         \"category\":  \"Tabby\"\n       },\n       {\n         \"command\": \"tabby.server.stop\",\n         \"title\":  \"Stop Server\",\n         \"category\":  \"Tabby\"\n       },\n       {\n         \"command\": \"tabby.server"
        }
      ],
      "user_agent": "Node.js/v20.14.0 tabby-agent/1.8.0-dev Visual-Studio-Code-desktop/1.92.2 TabbyML.vscode-tabby/1.12.1"
    }

    "completion": {
      "completion_id": "cmpl-f1711309-0719-4c69-b305-a998009337ec",
      "language": "json",
      "prompt": "<fim_prefix>  ],\n  \"icon\": \"assets/logo.png\",\n  \"engines\": {\n    \"vscode\": \"^1.82.0\"\n  },\n  \"categories\": [\n    \"Programming Languages\",\n    \"Machine Learning\",\n    \"Other\"\n  ],\n  \"activationEvents\": [\n    \"onStartupFinished\"\n  ],\n  \"main\": \"./dist/node/extension.js\",\n  \"browser\": \"./dist/browser/extension.js\",\n  \"contributes\": {\n    \"commands\": [\n      {\n        \"command\": \"tabby.server.test\",\n      <fim_suffix>        \n      },\n      {\n        \"command\": \"tabby.toggleInlineCompletionTriggerMode\",\n        \"title\": \"Toggle Code Completion Trigger Mode (Automatic/Manual)\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.inlineCompletion.trigger\",\n        \"title\": \"Trigger Code Completion Manually\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiEndpoint\",\n        \"title\": \"Connect to Server...\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiToken\",\n        \"title\": \"Set Token...\",\n<fim_middle>",
      "segments": {
        "prefix": "  ],\n  \"icon\": \"assets/logo.png\",\n  \"engines\": {\n    \"vscode\": \"^1.82.0\"\n  },\n  \"categories\": [\n    \"Programming Languages\",\n    \"Machine Learning\",\n    \"Other\"\n  ],\n  \"activationEvents\": [\n    \"onStartupFinished\"\n  ],\n  \"main\": \"./dist/node/extension.js\",\n  \"browser\": \"./dist/browser/extension.js\",\n  \"contributes\": {\n    \"commands\": [\n      {\n        \"command\": \"tabby.server.test\",\n      ",
        "suffix": "        \n      },\n      {\n        \"command\": \"tabby.toggleInlineCompletionTriggerMode\",\n        \"title\": \"Toggle Code Completion Trigger Mode (Automatic/Manual)\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.inlineCompletion.trigger\",\n        \"title\": \"Trigger Code Completion Manually\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiEndpoint\",\n        \"title\": \"Connect to Server...\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiToken\",\n        \"title\": \"Set Token...\",\n",
        "git_url": "[email protected]:Sma1lboy/tabby.git",
        "filepath": "clients/vscode/package.json"
      },
      "choices": [
        {
          "index": 0,
          "text": "   \"title\":  \"Run Test\",\n         \"category\":  \"Tabby\"\n       },\n       {\n         \"command\":  \"tabby.server.stop\",\n         \"title\":  \"Stop Server\",\n         \"category\":  \"Tabby\"\n       },\n       {\n         \"command\":  \"tab"
        }
      ],
      "user_agent": "Node.js/v20.14.0 tabby-agent/1.8.0-dev Visual-Studio-Code-desktop/1.92.2 TabbyML.vscode-tabby/1.12.1"
    }

    "completion": {
      "completion_id": "cmpl-3117b427-98f1-4fca-9cc6-e64578fd3f42",
      "language": "json",
      "prompt": "<fim_prefix>  ],\n  \"icon\": \"assets/logo.png\",\n  \"engines\": {\n    \"vscode\": \"^1.82.0\"\n  },\n  \"categories\": [\n    \"Programming Languages\",\n    \"Machine Learning\",\n    \"Other\"\n  ],\n  \"activationEvents\": [\n    \"onStartupFinished\"\n  ],\n  \"main\": \"./dist/node/extension.js\",\n  \"browser\": \"./dist/browser/extension.js\",\n  \"contributes\": {\n    \"commands\": [\n      {\n        \"command\": \"tabby.server.test\",\n        <fim_suffix>\n              \n      },\n      {\n        \"command\": \"tabby.toggleInlineCompletionTriggerMode\",\n        \"title\": \"Toggle Code Completion Trigger Mode (Automatic/Manual)\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.inlineCompletion.trigger\",\n        \"title\": \"Trigger Code Completion Manually\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiEndpoint\",\n        \"title\": \"Connect to Server...\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiToken\",\n<fim_middle>",
      "segments": {
        "prefix": "  ],\n  \"icon\": \"assets/logo.png\",\n  \"engines\": {\n    \"vscode\": \"^1.82.0\"\n  },\n  \"categories\": [\n    \"Programming Languages\",\n    \"Machine Learning\",\n    \"Other\"\n  ],\n  \"activationEvents\": [\n    \"onStartupFinished\"\n  ],\n  \"main\": \"./dist/node/extension.js\",\n  \"browser\": \"./dist/browser/extension.js\",\n  \"contributes\": {\n    \"commands\": [\n      {\n        \"command\": \"tabby.server.test\",\n        ",
        "suffix": "\n              \n      },\n      {\n        \"command\": \"tabby.toggleInlineCompletionTriggerMode\",\n        \"title\": \"Toggle Code Completion Trigger Mode (Automatic/Manual)\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.inlineCompletion.trigger\",\n        \"title\": \"Trigger Code Completion Manually\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiEndpoint\",\n        \"title\": \"Connect to Server...\",\n        \"category\": \"Tabby\"\n      },\n      {\n        \"command\": \"tabby.setApiToken\",\n",
        "git_url": "[email protected]:Sma1lboy/tabby.git",
        "filepath": "clients/vscode/package.json"
      },
      "choices": [
        {
          "index": 0,
          "text": "\"title\":  \"Run Test\",\n         \"category\":  \"Tabby\""
        }
      ],
      "user_agent": "Node.js/v20.14.0 tabby-agent/1.8.0-dev Visual-Studio-Code-desktop/1.92.2 TabbyML.vscode-tabby/1.12.1"
    }
  }

Sma1lboy avatar Oct 11 '24 18:10 Sma1lboy

image

record that happen again:

{1 item
"completion":{6 items
"completion_id":string"cmpl-70ff36b1-f69a-4697-8f81-1331e72368d8"
"language":string"rust"
"prompt":string"// Path: file:///Users/jacksonchen/.cargo/registry..."
"segments":{5 items
"prefix":string" context, serper, ..."
"suffix":string" let s = stream! { let cont..."
"git_url":string"[email protected]:Sma1lboy/tabby.git"
"declarations":[5 items
0:{2 items
"filepath":string"file:///Users/jacksonchen/.cargo/registry/src/inde..."
"body":string"/// Constructs an event at the debug level. /// //..."
}
1:{2 items
"filepath":string"ee/tabby-schema/src/policy.rs"
"body":string"#[derive(Clone)]"
}
2:{2 items
"filepath":string"file:///Users/jacksonchen/.rustup/toolchains/stabl..."
"body":string"/// Maps an `Option<&T>` to an `Option<T>` by clon..."
}
3:{2 items
"filepath":string"ee/tabby-schema/src/schema/thread/inputs.rs"
"body":string"#[derive(GraphQLInputObject, Validate, Default, Cl..."
}
4:{2 items
"filepath":string"file:///Users/jacksonchen/.rustup/toolchains/stabl..."
"body":string"/// Copies `self` into a new `Vec`. /// //..."
}
]
"filepath":string"ee/tabby-webserver/src/service/answer.rs"
}
"choices":[1 item
0:{2 items
"index":int0
"text":string" debug!("Answering with user attachment input: {:?..."
}
]
"user_agent":string"Node.js/v20.14.0 tabby-agent/1.8.0-dev Visual-Stud..."
}
}

Sma1lboy avatar Oct 28 '24 07:10 Sma1lboy