Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode code inline completion with wrong indentation size #3263

Open
Sma1lboy opened this issue Oct 11, 2024 · 3 comments
Open

VSCode code inline completion with wrong indentation size #3263

Sma1lboy opened this issue Oct 11, 2024 · 3 comments
Assignees

Comments

@Sma1lboy
Copy link
Collaborator

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

@icycodes
Copy link
Member

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.

@Sma1lboy
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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 Sma1lboy self-assigned this Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants